Please find attached a zip file, with a simple CVAVR project that uses a clock interrupt at 40 ms to increase/decrease a variable, and a main function that uses that variable to draw a line on ILI9341 GLCD display.
Code works fine on ATxmega128A1U, everything is as expected. Also, setting breakpoints in this code in Atmel Studio 7 is also fine - the breakpoints stop the program, both in the main function, and in the interrupt.
That which puzzles me, is that I cannot simulate this code in Atmel Studio 7.
Rather, the simulator starts up, cycles and PC change as expected - however, the same breakpoints (lines 176 and 199 in `test_xmega_ILI9341_glcd_bp_main.c`), that hit properly in the live debug session with Atmel-ICE, never hit here in the simulator ?!
I've inspected a bit, and all that I can notice is, that when this code runs in the simulator, it gets stuck in an endless loop in assembly here:
00000AD8 SBIW R24,0x01 Subtract immediate from word 00000AD9 BRNE PC-0x01 Branch if not equal
R24 simply counts down from 255 to 0, and then it wraps, and then it counts down again - and this loop is never exited.
My guess is that the GLCD library functions apparently wait for some hardware response from the GLCD, - but as this is in the simulator, there is no model for the GLCD, and such a response/signal never arrives?
Now, I've met this before, and usually the way I handle it, is comment all glcd functions - which is a bit tedious, for one; but more importantly, commenting also changes the timing of the running code.
So, my question is - is there any way that I can "persuade" the Atmel Studio simulator to keep going with the GLCD functions (such that any given breakpoints in the code execute), mostly for the purpose of getting a bit more accurate timing in the simulator - provided that the GLCD libraries that come with CodeVisionAVR are commercial and closed (and thus, there is no source for them)?
Thanks in advance for any responses!