Does the DelayMS routine just do a series of nops, or does it use one of the timers?
The reason I ask is that I made a small change to a piece of software I'm working on and it stopped working, only getting so far. I found that the problem was that it was getting to a DelayMS(250) command and just hanging. The ISR was still running but the delay never completed.
The change I'm working on involves using Timer 0 so I was wondering if this is somehow affecting the Delay routine? If not, are there any known bugs in the routine that would cause it to just hang?
The odd thing is that the delay was working fine, I moved some of the setup code prior to it into a separate Sub and it just stopped. Most odd...
How does DelayMS work?
Moderators: David Barker, Jerry Messina
-
- Posts: 113
- Joined: Mon Jan 11, 2010 10:39 pm
- Location: Chesterfield
- David Barker
- Swordfish Developer
- Posts: 1214
- Joined: Tue Oct 03, 2006 7:01 pm
- Location: Saltburn by the Sea, UK
- Contact:
-
- Posts: 113
- Joined: Mon Jan 11, 2010 10:39 pm
- Location: Chesterfield
OK, that would make sense. Is there any way to identify what registers are used and what might be the cause of the conflict so I can do a work-around?
The software has been working fine for ages, I'm on V2 of the PCB, the only main change is the addition of a buzzer. This needs a square wave to drive it so I've added an ISR for Timer 0 which uses Toggle() to generate the square wave. Could this be the issue?
The software has been working fine for ages, I'm on V2 of the PCB, the only main change is the addition of a buzzer. This needs a square wave to drive it so I've added an ISR for Timer 0 which uses Toggle() to generate the square wave. Could this be the issue?
-
- Posts: 113
- Joined: Mon Jan 11, 2010 10:39 pm
- Location: Chesterfield
- David Barker
- Swordfish Developer
- Posts: 1214
- Joined: Tue Oct 03, 2006 7:01 pm
- Location: Saltburn by the Sea, UK
- Contact:
-
- Posts: 113
- Joined: Mon Jan 11, 2010 10:39 pm
- Location: Chesterfield