I have been having some trouble trying to get the delay_ms function to work on a 16F84A. When using MPLAB to step through the source the code loads the delay then jumps to the #use delay statement and stays there.
Is there a problem with using the delay_ms function? are there extra switches or librarys needed by the compiler? I also noticed that if I use a simple FOR loop the code does not appear to create a delay.
Haplo
Joined: 06 Sep 2003 Posts: 659 Location: Sydney, Australia
Posted: Wed Apr 14, 2004 6:29 am
Remember, delay_ms() is just a series of instructions like any other function. In MPLAB, it may look it gets stuck on the #use delay statement, but if you switch to the assembly listing (program memory) window you can actually step through the instructions that create the delay and watch them execute.
TimberWolf
Joined: 14 Apr 2004 Posts: 2
Posted: Wed Apr 14, 2004 8:42 am
Its ok Ive discovered the problem. Iam using the MPLAB development environment. When I compile the CCS code the MPLAB switches to the CCS environment so that I can compile the code. When I exit the CCS environment and return to MPLAB the processor switches for WDT, Clock etc have changed or been reset.
The net effect is that as soon as I start to simulate or run the code the WD timesout and scuppers the execution of the code. I don't need the WD for my current application so I did not include any service routines. [/quote]
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