Posted: Sat Oct 06, 2018 5:18 pm Post subject: ATMega88PB calculating problem
Hello to all,
i'm counting two PWM-Pulses (500Hz) into PinC.1 and PinC.2 of an ATMega88PB (10MHz Crystal).
Therefore i'm using Timer1 with a Prescaler of 8.
Data input:
Start Timer1
Timer1 = 0
while PinC.1 = 1
wend
value = Timer1
this measurement i'm doing 10 times in a loop to achieve higher value for calculation
the single value is always correct, but the value calculated after the loop is wrong in ONLY ONE POSITION OF PWM:
Stepping down in 1µs steps, it jumps at a value of 6300 about 200 digits to 6100. After that, counting is correct again (6100, 6090, 6080.....)
This means, that the 10 times counting loop is wrong on only this single position.
Stepping up, the same jump happens (6090, 6100, 6300, 6310, 6320...)
The PWM time at this issue is 630µs
NEW:
i had a serial display attached on PortE.3 to show these values. When i take the display programm out of the code, everything works fine... don't understand this, because counting loop is in a complete other programm section.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum