View previous topic :: View next topic |
Author |
Message |
tomyuen007
Joined: 09 Jul 2007 Posts: 3
|
WATCHDOG TIMER |
Posted: Mon Jul 09, 2007 5:39 pm |
|
|
I am a newbie and i try to compile the ex_wdt.c for 16f877 since i have a dev board but it i just could not make it work. my final mcu is a 16c54. is there anyone has experience to lend me a hand for both 16f877 and 16c54 wdt.
basically, i want to do some processing everytime the mcu is reset by the wdt polling pin_b0. if pin_b0 is high, the code will reset the wdt to continue the process. if pin_b0 is low, put the mcu to sleep and to be wake up by the wdt again.
i thought the ex_wdt.c should work for the above situation but there is not reset. i started with the ex_wdt.c and i thought i will see the reset but i was disappointed.
regards |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Jul 09, 2007 6:50 pm |
|
|
1. Post the manufacturer and model number of your Dev board.
If possible, post a link to the website of the board.
2. Post your compiler version. You can find it at the start of the .LST
file for your project. The .LST file will be in your project directory.
The compiler version is a 4-digit number such as 3.249, or 4.033, etc.
Don't post any numbers that come after the version number. |
|
|
tomyuen007
Joined: 09 Jul 2007 Posts: 3
|
|
Posted: Mon Jul 09, 2007 7:08 pm |
|
|
the dev board is from PRLLC or PRIIO.
the compiler version is 3.128.
regards |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Jul 09, 2007 7:50 pm |
|
|
You need to post the name of the board. Provide a link to the manual.
I want to look at the schematic of the board, so I can see what is
connected to pin B0.
As far as I can tell, PRIIO only makes boards for Atmel processors. |
|
|
tomyuen007
Joined: 09 Jul 2007 Posts: 3
|
|
Posted: Mon Jul 09, 2007 8:18 pm |
|
|
the dev for pic is FlashPIC-Dev and prllc is no longer making this board. prllc does not have any info on the website anymore. but the portb does not connect to anything.
regards |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Jul 09, 2007 9:38 pm |
|
|
With the name of the board, I quickly found the data sheet with Google:
http://www.technology-systems.com/elt241/FlashPIC-Dev.pdf
I installed PCM vs. 3.128, compiled it and programmed it into a
16F877 running at 20 MHz on a PicDem2-Plus board. It worked.
There are a few problems with the Ex_wdt.c file in vs. 3.128.
You should add NOLVP to the #fuses statement. The baud rate is
set to 9200 baud (presumably a typo), and should be changed to 9600.
You should add ERRORS to the #use rs232() statement. See the
changes shown in bold below:
Quote: |
#include <16f877.h>
#fuses HS,WDT,NOPROTECT,NOLVP
#use delay(clock=20000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, ERRORS)
|
I looked at the schematic on page 7 of the FlashPIC-Dev manual.
It shows that jumpers JP9 and JP10 must be installed to enable use of
the serial port. Do you have them installed ? |
|
|
|