CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Wizzard Error? Undefined Identifiers WDT_ON & WDT_DIV_16

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

Wizzard Error? Undefined Identifiers WDT_ON & WDT_DIV_16
PostPosted: Tue Feb 26, 2019 10:06 am     Reply with quote

Please pardon a very rusty PIC CCS programmer. I am trying to write new code for an old product using PIC16C58A chips. My 20 year old code doesn't compile under (PCWH) PCB 5.058 so I am trying to start with "Hello World" and add one part at a time. I used the Wizard to make is simple dummy program to start with:
Dummy_main.c
Code:

#include <Dummy_main.h>

void main()
{
   setup_wdt(WDT_ON);
   setup_wdt(WDT_2304MS|WDT_DIV_16);      //~2.3 s reset


   while(TRUE)
   {


      //TODO: User Code
   }

}


Dummy_main.h
Code:

#include <16C58A.h>

#FUSES WDT                      //Watch Dog Timer

#use delay(crystal=7.3728MHz,restart_wdt)


When I try to compile this simple bit I get:
Code:

*** Error 12 "Dummy_main.c" Line 5(11,17): Undefined identifier   WDT_ON
*** Error 12 "Dummy_main.c" Line 6(22,32): Undefined identifier   WDT_DIV_16
      2 Errors,  0 Warnings.
Build Failed.


"WDT_ON" and "WDT_DIV_16" do not appear in 16C58A.h.
Is the Wizard putting in things it should not, or should these WDT bits be defined elsewhere?
_________________
The search for better is endless. Instead simply find very good and get the job done.
temtronic



Joined: 01 Jul 2010
Posts: 9123
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Tue Feb 26, 2019 10:59 am     Reply with quote

The 'Wizard' is as smart as PROTEUS......

simply do NOT use it...

I started with PCM V2.534 and have never used either. Frankly I don't trust them. been proven over and over they ain't smart
Consider who wrote the Wizard. That guy does NOT code the way you or I do, so 'stuff' is either defaulted on or off, the opposite of how we program so you'll spend hours in a daze wondering WHY it doesn't work...it used to...

Start from scratch, enter in EVERY fuse the way YOU want, cut a 'flashing LED' program. When it finally works save it twice. The second copy is your starting point for the next program. This way you'll ALWAYS have KNOWN programs to go back to. If you keep editing the same program over and over...it'll fail and you'll be in a daze again.....

Jay
Ttelmah



Joined: 11 Mar 2010
Posts: 19238

View user's profile Send private message

PostPosted: Tue Feb 26, 2019 11:14 am     Reply with quote

The problem here is that the 16C58A, does not have a software
configurable WDT. On early PIC's the watchdog can only be enabled
in the fuses. No software option.
On the timings, this chip only has the 'expected times', not divisors
directly available. So WDT_288MS.

I think these chips really 'predate' the Wizard, so it does not properly
handle them.

At the very least, you should be using the 58B, not the A. This is a
slightly later replacement chip. However even better there are 'F' chips
that are pin compatible and would help the overall performance.

The 16F716 for example, is pin compatible, more RAM, more ROM etc..
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group