So I decided to make a simple LED candle as an exercise to learn ADC, USART, and random number generation in one shot. Everything was going fine till a strange reset issue arose.
As I am using CV I disabled interrupts during my delay as recommenced by CV for an accurate delay using their function. I've done this on several other programs with no problems however this part of the code in this program causes a reset. I'm guessing this is due to using this code in conjunction with the surrounding code in the manner I am but have no idea why.
Can anyone explain this to me? I'm at a loss :?
When the 2 #asm lines are removed no rest occurs.
Code below, Thanks