

I am not relying on the debug to be accurate timing wise, it is just helpful sometimes to be able to see the values of some of the variables when trying to resolve bugs. I do not need or use 'debuggers' or 'simulators' as they do NOT emulate the real world. How much, you'll have to run a simple test to see, or maybe others here will know. I am at the scratch my head stage now!Īny debug or simulator will NOT run at the normal speed, so delays will be longer. Thanks in advance for any help you may be able to give me. #FUSES NOWRTB //Boot block not write protected #FUSES NOCPB //No Boot Block code protection #FUSES NOPROTECT //Code not protected from reading #FUSES NOEBTRB //Boot block not protected from table reads #FUSES NOEBTR //Memory not protected from table reads #FUSES IESO //Internal External Switch Over mode enabled #FUSES NOWRTC //configuration not registers write protected #FUSES NOWRTD //Data EEPROM not write protected #FUSES NOWRT //Program memory not write protected #FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O #FUSES DEBUG //Debug mode for use with ICD #FUSES STVREN //Stack full/underflow will cause reset #FUSES FCMEN //Fail-safe clock monitor enabled #FUSES INTRC_IO //Internal RC Osc, no CLKOUT #device ICD=TRUE //disable this for production as it removes code protection Problem is, whenever this subroutine is called, the code stops running at the #use delay(clock=8000000) line.Īny ideas on what may be causing this? Am I doing something wrong? I allow a delay between switching the output on/off to allow the device to switch off/on completely.

If this sequence is followed then I know that the device and all cabling in between is healthy. Then I switch the output ON again and check that the input also switches on. The ouput PIN RC1 is connected to a relay which then switches off the device and I check to see if the input then switches off. The code is pretty simple, when I see the input on RC0 go low, I run a sub routine to check the health of one of the devices connected to the inputs. I am using the MPLAB ICD3 debugger and using the MPLAB IDE v8.60 for debugging. I am using a PIC18F2520 with CCS compiler PCH v4.114. I am having a strange problem when I call the delay_ms function, when I call this function, the code stops running (in debug mode) and I then have to press RUN (play button) to continue running the code.

Please do not post bug Reports on this forum. CCS :: View topic - PIC hanging on delay_ms callįAQ Forum Help Official CCS Support Search Register Profile Log in to check your private messages Log inĬCS does not monitor this forum on a regular basis.
