I don't understand how waitcnt works
sheonbanks
Posts: 10
I'm reading the ConstantBlinkRate.spin code. It states"
"For a 1 Hz on/off signal, replace both instances of clkfrq/2 with 2_500_000"
which would result in:
waitcnt(2_500_00 + CNT)
If the system clock is 80mHz where does the 1 Hz come from. I don't understand the correlation. Mathematically, given then various terms, I don't understand how you have a number(such as 2_500_000) in mHz producing a 1 Hz blink count?
"For a 1 Hz on/off signal, replace both instances of clkfrq/2 with 2_500_000"
which would result in:
waitcnt(2_500_00 + CNT)
If the system clock is 80mHz where does the 1 Hz come from. I don't understand the correlation. Mathematically, given then various terms, I don't understand how you have a number(such as 2_500_000) in mHz producing a 1 Hz blink count?
Comments
What about the:·· _clkmode·····and the··· _xinfreq·······values ?, in the CON block of the code.....
Why do you afirm that the system clock is 80 Mhz ?? maybe it is only 5Mhz.
Look close at the _clkmode·and the _xinfreq please.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Regards.
Alberto.
Rich