That is when the fun startsthere can be many things that can go wrong
Can you post your whole code?
The actual problem might be someplace else.
That is when the fun startsthere can be many things that can go wrong
Can you post your whole code?
The actual problem might be someplace else.
Dave
Always wear safety glasses while programming.
Here, the fun has alredy started
So, I can see b living with nap or sleep commented, but it hangs when not commented.Code:DEFINE LOADER_USED 1 DEFINE RESET_ORG 1000h ' For Microchip USB Bootloader DEFINE INTERRUPT_ORG 1008h ' For Microchip USB Bootloader define WDT_ON define WDTPS 128 DEFINE LCD_DREG PORTD ' Set LCD Data port DEFINE LCD_DBIT 4 ' Set starting Data bit (0 or 4 if 4-bit bus) DEFINE LCD_RSREG PORTC ' Set LCD Register Select port DEFINE LCD_RSBIT 2 ' Set LCD Register Select bit DEFINE LCD_EREG PORTC ' Set LCD Enable port DEFINE LCD_EBIT 1 ' Set LCD Enable bit DEFINE LCD_BITS 4 ' Set LCD bus size (4 or 8 bits) DEFINE LCD_LINES 4 ' Set number of lines on LCD DEFINE LCD_COMMANDUS 2000 ' Set command delay time in us, 2000 us = 2ms DEFINE LCD_DATAUS 50 ' Set data delay time in us, 50 us = 0,05ms powerOut var PORTE.0 onOffPressed var PORTD.2 b var byte clear TRISE = %00001000 TRISC = %10110000 TRISD = %00001100 powerOut = 1 pause 1 lcdout $FE, 1 pause 1 pstart: powerout = not onoffpressed lcdout $FE,2, "b=", dec b pause 100 b = b + 1 'nap 5 goto pstart![]()
Hi,
From " The Manual" $ 5.46
Alain
The 16-bit
core devices, including the 17Cxxx and 18Xxxxx parts use a postscaler
set at programming time to configure the Watchdog timeout period.
The compiler will disregard the Period set in the NAP instruction for the 16-
bit core devices.
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Hi,
You want a ~1 sec PAUSE ...
use PAUSE 1000 !!!
a PAUSE can be "interrupted" so, there are no problem to use it ...
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
If you're using the Microchip USB loader, it may have WDT disabled in config.
Try inserting WDTCON.0=1 before any NAP or SLEEP commands to enable WDT.
Bookmarks