When debugging atmega2560, I found several bugs:
1. In timer mode 12 (TIMER1, CTC, TOP=ICR1), an interrupt on the ICF1 flag is not triggered when TOP is reached. Interruption not occurs. I didn't check other timers, maybe the same thing.
2. When writing to the OCR5B, OCR5C, OCR4B, OCR4C registers, 0 is always written to the 7th bit of the lowest byte.
3. The condition from the datasheet is not met: "All CPU writes to the TCNTn Register will block any compare match that occurs in the next timer clock cycle, even when the timer is stopped."
Comparison and, accordingly, interruption still occurs.
All these bugs are only in Proteus, everything works fine in hardware.
ATMEGA2560 simulation bugs
ATMEGA2560 simulation bugs
Last edited by Reopold on Wed 2021-11-24 12:44, edited 1 time in total.
Re: ATMEGA2560 simulation bugs
Hi,
Please can you send your project and a link to this thread to support@labcenter.com so we can take a look? Thanks
Regards,
Dave.
Please can you send your project and a link to this thread to support@labcenter.com so we can take a look? Thanks
Regards,
Dave.
Re: ATMEGA2560 simulation bugs
I sent an email with projects to support@labcenter.com.
I also attach a file with projects here so that anyone can test.
I would also like to clarify this issue:
3. The condition from the datasheet is not met: "All CPU writes to the TCNTn Register will block any compare match that occurs in the next timer clock cycle, even when the timer is stopped."
I also attach a file with projects here so that anyone can test.
I would also like to clarify this issue:
3. The condition from the datasheet is not met: "All CPU writes to the TCNTn Register will block any compare match that occurs in the next timer clock cycle, even when the timer is stopped."
- Attachments
-
- AVR issues.zip
- Projects
- (122.53 KiB) Downloaded 116 times
Re: ATMEGA2560 simulation bugs
I hate to tell it but you are using an illegal copy of the software.
Please purchase a licence from https://www.labcenter.com/pricing/comm/
Please purchase a licence from https://www.labcenter.com/pricing/comm/
Kind regards,
Ettore Arena - Labcenter Electronics.
Ettore Arena - Labcenter Electronics.