| A1 |
PPG output is a function for outputting a pulse whose cycle and width is specified.
In this function, the issue is the waveform itself (timing).
Therefore, changes in parameters (pulse cycle and width) are reflected immediately.
Consequently, depending on the timing of the change, the output may be inverted.
In PWM output, the pulse is output as specifying an active period in the specified cycle
so as to output analog amount.
In this function, the issue is the proportion of active period in the specified cycle
rather than the waveform itself.
Consequently, some microcontrollers have a function to output the active period divided
into multiple sections.
Also, in the PWM output function, regardless of the timing at which the parameter
(cycle, active period, etc.) was changed, the change is only reflected at the end of one cycle,
so the output does not become abnormal.
On the other hand, even if the parameter is changed, that change is not immediately reflected in the operation.
|
| A2 |
Yes, a PWM signal can be output using the PPG function.
In this case, however you must be careful when overwriting the cycle or active period parameters.
Be sure to overwrite the cycle parameter at the timing of the interrupt that indicates
in the compare registers end of one cycle.
Also, depending on the timer used, it may be necessary to overwrite the parameter after stopping
the count operation.
The active period parameter can be changed without stopping the count operation, but you must take
care with the timing of overwriting.
A match between the timer counter and the compare register that specifies the active period may occur twice or
may not occur at all in one cycle. In this event, the timer output is inverted and the desired duty is not obtained.
|