Author |
Message |
Topic: PIC16f690 WDT problem |
peter-storm
Replies: 6
Views: 12030
|
Forum: General CCS C Discussion Posted: Sat Mar 01, 2008 5:02 am Subject: PIC16f690 WDT problem |
What I want to do is control the wdt in software as the help suggests I can. The problem is while WDT_OFF works, WDT_ON will not start the wdt and so the device enters sleep and does not return.
Ch ... |
Topic: PIC16f690 WDT problem |
peter-storm
Replies: 6
Views: 12030
|
Forum: General CCS C Discussion Posted: Sat Mar 01, 2008 3:58 am Subject: PIC16f690 WDT problem |
Hi arunb,
Thanks for your reply. A couple of things - I want the PIC to enter sleep until the watchdog timer causes an interrupt, and I believe that CCS inserts a sleep command after all code has ... |
Topic: PIC16f690 WDT problem |
peter-storm
Replies: 6
Views: 12030
|
Forum: General CCS C Discussion Posted: Fri Feb 29, 2008 6:22 pm Subject: PIC16f690 WDT problem |
Hi again, I'm having another problem, this time with my watchdog timer.
I want to use the timer in software mode i.e. be able to turn it on/off and change the delay time appropriately.
I want th ... |
Topic: SPI freezes PIC16f690 |
peter-storm
Replies: 3
Views: 4125
|
Forum: General CCS C Discussion Posted: Wed Feb 27, 2008 5:01 am Subject: SPI freezes PIC16f690 |
#include <16f690.h>
#fuses HS, NOWDT, NOPROTECT, BROWNOUT, PUT
#use delay(clock=8000000)
#use rs232(baud=19200,parity=N,xmit=PIN_B7,rcv=PIN_B5,bits=8,STREAM=ETRX)
#use sp ... |
Topic: SPI freezes PIC16f690 |
peter-storm
Replies: 3
Views: 4125
|
Forum: General CCS C Discussion Posted: Tue Feb 26, 2008 6:33 pm Subject: SPI freezes PIC16f690 |
Hi all,
If I implement my code using spi_write() the program works. If I use spi_xfer instead, it hangs at the first instance of this command and I'm not sure why. The help doesn't really explain t ... |
Topic: Long delay using watchdog timer |
peter-storm
Replies: 12
Views: 12301
|
Forum: General CCS C Discussion Posted: Sun Jan 27, 2008 6:24 pm Subject: Long delay using watchdog timer |
You have a good point, so I have replaced the NORMAL_POWER_UP: with default:, that should do the trick? |
Topic: Long delay using watchdog timer |
peter-storm
Replies: 12
Views: 12301
|
Forum: General CCS C Discussion Posted: Sun Jan 27, 2008 6:10 pm Subject: Long delay using watchdog timer |
How would I make it not reset the value every time?
Don't initialize 'timer' above main(). Just declare it.
Example:
int8 timer;
Initialize it at the start of main(). But, qualify the init wi ... |
Topic: Long delay using watchdog timer |
peter-storm
Replies: 12
Views: 12301
|
Forum: General CCS C Discussion Posted: Sun Jan 27, 2008 6:02 pm Subject: Long delay using watchdog timer |
if (timer == 1){
output_toggle(PIN_C1);
timer = 5;
}
else
timer--Your code now loops 4 times. If you want to loop 5 times, than change to if (timer == 0){
... |
Topic: Long delay using watchdog timer |
peter-storm
Replies: 12
Views: 12301
|
Forum: General CCS C Discussion Posted: Sun Jan 27, 2008 5:24 pm Subject: Long delay using watchdog timer |
int delay = 500;
In CCS, an 'int' is an unsigned 8-bit integer. Use 'long' or 'int16' instead.
Both are 16-bit unsigned integers in CCS.
Oh ok, thanks for the info. The delay variable isn't us ... |
Topic: Long delay using watchdog timer |
peter-storm
Replies: 12
Views: 12301
|
Forum: General CCS C Discussion Posted: Sun Jan 27, 2008 4:51 pm Subject: Long delay using watchdog timer |
Thanks, Ttelmah.
The precision isn't particularly important to me, so I have gone ahead and written the following:
#include <16f690.h>
#fuses HS, WDT, NOPROTECT, BROWNOUT
#use delay& ... |
Topic: Long delay using watchdog timer |
peter-storm
Replies: 12
Views: 12301
|
Forum: General CCS C Discussion Posted: Sat Jan 26, 2008 12:40 pm Subject: Long delay using watchdog timer |
Hi all.
I have a PIC16f690 that must use the lowest possible power for as long periods of time (up to an hour). I would like to utilise the watchdog timer, which has a max time of 268 seconds, in t ... |
|