Has anybody had problems with the delay_ms() statement hanging your program? I had a program working just fine and after adding a bit of code things hang when it hits the first delay statement. I didn't touch the #fuses or #use statments and I added code in various parts of the body and now POOF it pukes on me. I'm not sure if I want to scratch my head and try to remember where I changed things either. Just wondered if anybody has had a problem with them hanging a program.
Ronald
valemike Guest
Posted: Mon Jul 26, 2004 11:27 am
Nope, never had delay_ms() cause problems, even with the supposed bugs in some of the recent versions.
Do you use delay_ms() both in an ISR and in your non-isr code? The compiler makes delay_ms() reentrant if you are using it in both. Part of reentrancy I think involves turning off interrupts. Perhaps you're missing an interrupt. But then again, that interrupt flag would pend, so who knows.
rnielsen
Joined: 23 Sep 2003 Posts: 852 Location: Utah
Posted: Mon Jul 26, 2004 1:10 pm
A-HA! I was able to figure out what I had done. During my edits, I had remarked out timer_2's ISR but left the interrupt enabled. The program would run just fine until I called my first delay_ms() and then it would hang. I tested this with the other timer interrupts and they caused the same thing. Oh well. *shrug*
Ronald
Smile, you're one day closer to retirement.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum