Looks more like a kind of compiler problem. But could also be related to Simu:
the "short" counter gets the "if" compiled into assembler instruction "brlt", for the working "unsigned short" it gets "brcs". I'm not so familiar with AVR assembler. :-/
hex files and sim1 (V 1.0.0-R815) is attached.
short not_working = 1;
//unsigned short working = 0;
OCR0A = not_working;
if (not_working > 3) not_working = 0;
//OCR2A = working;
//if (working > 3) working = 0;
- You don't have permission to download attachments.
- (2 Kb) Downloaded 1 times
Last edited by arcachofo on Sat Jan 15, 2022 1:02 am; edited 1 time in total (Reason for editing : Marked as solved (green color).)