Output Compare block - Behaviour at edges values for OC1max
Posted: Tue Feb 26, 2008 12:32 pm
I'm working on Output Compare block to make a PWM output and came across a strange
phenomena.
What I did was to connect a potentiometer to AN0 and a oscilloscope to OC1.
The potentiometer is hooked to +5V and GND.
I set MaxChannel of OC block to 1e-4, 2e-5,1e-5 to get 10kHz, 50kHz, 100kHz PWM signals.
Channels Input Type is set to be 10 to get variable Down duration.
When I turn the potentiometer in full swing, the PWM Down period varies between:
10kHz 500ns-100us
50kHz 500ns-20us
100kHz 500ns-10us.
OC1max value in each case is:
10kHz 3000
50kHz 600
100kHz 300.
What I think strange is that the pulse duration changes x2000, x400, x200 times.
These numbers should be the same as OC1max values, as they represent the maximum
allowable input to Output Capture block.
Why these difference happens? Is there any setting I miss?
Masaki
phenomena.
What I did was to connect a potentiometer to AN0 and a oscilloscope to OC1.
The potentiometer is hooked to +5V and GND.
I set MaxChannel of OC block to 1e-4, 2e-5,1e-5 to get 10kHz, 50kHz, 100kHz PWM signals.
Channels Input Type is set to be 10 to get variable Down duration.
When I turn the potentiometer in full swing, the PWM Down period varies between:
10kHz 500ns-100us
50kHz 500ns-20us
100kHz 500ns-10us.
OC1max value in each case is:
10kHz 3000
50kHz 600
100kHz 300.
What I think strange is that the pulse duration changes x2000, x400, x200 times.
These numbers should be the same as OC1max values, as they represent the maximum
allowable input to Output Capture block.
Why these difference happens? Is there any setting I miss?
Masaki