Starting Point System : Forum

You are not logged in.

#1 2011-10-15 11:47:09

gremlinc5
Member

Clarification on COUNTER modality

PWM is for output use. For Input count refer to:

Timer Capture Cycle

See: http://www.starting-point-systems.com/f … hp?id=4656


ST7FLite39 daughter board
REva 2.10
RLink 3.4
"uChameleon" as: SPI Master for debug, Analog output for sensing emulation

Offline

 

#2 2011-10-15 21:32:09

gremlinc5
Member

Re: Clarification on COUNTER modality

petpan wrote:

Is “pwm PIN counter” used to count the number of input pulses on that pin?

I have doubts about it and the user guide says just a little.

When I send for example “pwm 9 counter” just after uChameleon reset I receive “pwm 9 counter 0”. Then, if I start the output pwm on pin 10, I receive an answer when I ask “pwm 9 counter”. Let’s say “pwm 9 counter 1234”.

What is that number? PIN 9 is open, I wouldn’t expect any counts on in.

Can I have some tips on the use of counters?

Thanks in advance

"pwm 9 counter 1234" without prescaler mean (as manual at 1.12.4 say):

pwm 9 is putting out of the pin a signal with frequency 1234 times lower than fcpu, like
(24MHz fcpu ) / ( 1234 ) = 19448 Hz

You get an output signal with frequency of 19KHz.

If you get nothing it's because you don't set a duty cycle to it, try:

pwm 9 width 308 (25% duty cycle)
pwm 9 width 617 (50% duty cycle)
pwm 9 width 925 (75% duty cycle)
pwm 9 width 1234 (100% duty cycle)

If you dont have an oscilloscope try with a multimeter. You will get:
1,25 volt
2,5 volt
3,75 volt
5 volt

PS If you need to count input signals refer to 1.14 on the manual.

Last edited by gremlinc5 (2011-10-15 21:35:41)


ST7FLite39 daughter board
REva 2.10
RLink 3.4
"uChameleon" as: SPI Master for debug, Analog output for sensing emulation

Offline

 

Board footer

Powered by FluxBB

Home