[quote:8b39425f98="Visovian"][quote:8b39425f98]What happens is that the timing of the pin toggle is not regular when the code is compiled with the line "bit_1 = bit_2" in the sub routine. It seems that the bit "tick" is corrupted. With the line removed the timing of the pin toggle is perfect. [/quote:8b39425f98]
I can confirm it.
I have tested on my board with mega88, 8 MHz.
I have set prescaler and OCR for 1 sec interrupt.
With this it looks like every 14th toggle in main is missing.
When the Bit_operation() is not called then the code works well.
Strange.
1.11.9.1 demo[/quote:8b39425f98]
Thanks Visovian,
Maybe I'm not going crazy, just yet.
Here are some screen shots from my 'scope showing the pin that is toggled. One without the bit operation and one with. With the bit operation statement the toggle is really messed up, although a regular pattern:
[URL=http://s980.photobucket.com/user/neill_b/media/TEK00000_zpsc880623a.png.html][img:8b39425f98]http://i980.photobucket.com/albums/ae281/neill_b/TEK00000_zpsc880623a.png[/img:8b39425f98][/URL]
I will delve into the assembler code and see what is happening...
[URL=http://s980.photobucket.com/user/neill_b/media/TEK00001_zps3678ea85.png.html][img:8b39425f98]http://i980.photobucket.com/albums/ae281/neill_b/TEK00001_zps3678ea85.png[/img:8b39425f98][/URL]
↧