pumazzz
Joined: 19 Oct 2011 Posts: 12
|
setup_wdt() on different CCS version |
Posted: Mon Feb 06, 2012 12:47 pm |
|
|
At the very beginning, I use CCS v4.032.
and I can handle a period wake up by using the following code
Code: |
#include <16F88.h>
#FUSES INTRC, WDT, NOPROTECT ,NOLVP, NOBROWNOUT
#use delay(clock=8000000)
void main()
{
….………..
……………
setup_wdt(WDT_ON|WDT_18MS);
while(1)
{
output_high(LED);
delay_ms(2);
output_high(LED);
delay_ms(2);
sleep();
delay_ms(2);
}
}
|
But now I use the same code in CCS v4.057, my PIC16 can not wake up.
I have tried the following two solutions, but none of them work.
1)
Code: |
#include <16F88.h>
#FUSES INTRC, NOWDT, NOPROTECT ,NOLVP, NOBROWNOUT
#use delay(clock=8000000)
void main()
{
….………..
……………
setup_wdt(WDT_ON|WDT_18MS); //watchdog setup to wake up PIC periodically
while(1)
{
output_high(LED);
delay_ms(2);
output_high(LED);
delay_ms(2);
sleep();
delay_ms(2);
}
}
|
2)
Code: |
#include <16F88.h>
#FUSES INTRC, WDT, NOPROTECT ,NOLVP, NOBROWNOUT
#use delay(clock=8000000)
void main()
{
….………..
……………
setup_wdt(WDT_18MS); //watchdog setup to wake up PIC periodically
while(1)
{
output_high(LED);
delay_ms(2);
output_high(LED);
delay_ms(2);
sleep();
delay_ms(2);
}
}
|
Does anyone have the same problem and how to solve it? Thanks |
|