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

Newbie Beset by 16F84A Resets -- HELP!

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







Newbie Beset by 16F84A Resets -- HELP!
PostPosted: Sat Mar 15, 2003 10:55 am     Reply with quote

Greetings All!

Got a CCS compiler and Warp-13A kit a couple of days ago. Migrating from BS2. CCS nicely integrates into MPLAB. Was able to get the obligatory "Hello_LED" program going.

But, when I try any longer program ( more than 1 sec ), the WDT starts up and resets me about every second. I've spent two days reading 16F84A data sheets, digging around the PICLIST, this list, purchasing Predko's book, looking at CCS and PIC code examples. Everything compiles and verifies fine, but something's wrong, but I can't see what it is?

It keeps re-setting as if the WDT was selected on, when the fuses were defined as NOWDT.

I tried a variety of codes. The latest is to light and turn off each segment of a 7-seg LED in a loop. It only lights 3 segments, and then restarts. ( New 9V battery thru

Here's what I've tried, so far to try to get rid of "WDT".

1- Made sure to use a 0.1uF cap to Ground on the PIC Vdd pin.
2- Made sure to have a 10K resistor on Vss pin.
3- Using 7805A 5V regulator with caps - for noise reduction.
4- I've made sure to have the #FUSE say HS, NOWDT
5- I purchased a different PIC and FOX F1100E Osc ( no change).
6- I exchanged the 7-seg-LED for another ( no change ).
7- I exchanged the 7805A for another ( no change ).
8- Ran it in RC mode, with resistor and cap. ( no change ).
9- Resistors on all unused pins and set to output. ( n c ).
10- Set Tris on Ports A and B to zero or not. ( n c ).
11- Tried 2 new 9V batteries -- no change.

Been two days. Looking longingly at all the interesting code. I know I'm doing something wrong, but what?! I can do the kludge of doing a reset WDT, but that's too bad, since I wrote NOWDT, so should not have to do that.

I'm really hoping one of you already have an idea what I might be doing wrong, or what I should try next.


Here is my simple code:

/**/

#INCLUDE <16F84A.h>
#USE delay (clock = 10000000)
#FUSES HS,NOWDT,PUT

set_tris_A(0);
set_tris_B(0);

void poz(){

delay_ms(300);
//#asm
//clrwdt
//#endasm
}

void main()
{
int8 x=0;

do{


output_low(PIN_B0);
poz();
output_high(PIN_B0);
poz();
output_low(PIN_B1);
poz();
output_high(PIN_B1);
poz();
output_low(PIN_B2);
poz();
output_high(PIN_B2);
poz();
output_low(PIN_B3);
poz();
output_high(PIN_B3);
poz();
output_low(PIN_B4);
poz();
output_high(PIN_B4);
poz();
output_low(PIN_B5);
poz();
output_high(PIN_B5);
poz();
output_low(PIN_B6);
poz();
output_high(PIN_B6);
poz();
output_low(PIN_B7);
poz();
output_high(PIN_B7);
poz();


} while(true);
}


Rol - PIC Newbie
___________________________
This message was ported from CCS's old forum
Original Post ID: 12716
sar



Joined: 08 Sep 2003
Posts: 36

View user's profile Send private message

Re: Newbie Beset by 16F84A Resets -- HELP!
PostPosted: Sat Mar 15, 2003 11:39 am     Reply with quote

Rollo
I compiled your code and made delay_ms (2000) and it worked perfect. Did you set your config bits on the warp 13 to no wdt? I used a epic programmer as I don't have the warp 13.
___________________________
This message was ported from CCS's old forum
Original Post ID: 12719
Rollo
Guest







Re: Newbie Beset by 16F84A Resets -- HELP!
PostPosted: Sat Mar 15, 2003 12:42 pm     Reply with quote

YES!... That was it. Thanks so much.

Since I was using MPLAB, and since MPLAB treats a Warp13A as a PICSTART PLUS, and finally since CSS C integrates so well into MPLAB, I had not tried to study or use the Warp13A software, in the first 48hrs of newbie "trial and error".

I didn't realize that adding the CCS #FUSES NOWDT directive wasn't enough to ensure that the WDT would be off when I wanted it off. You've saved me TONS of further aggravation. Thanks!

I wonder if I could achieve the same result somehow from within MPLAB, instead of having to hop over to my Warp13A software each time?

In any case, you pointed me in the right direction, and now I can make this work, and "boldly go" on to larger programs.

Thanks Again for taking the time,

Rol


:=Rollo
:=I compiled your code and made delay_ms (2000) and it worked perfect. Did you set your config bits on the warp 13 to no wdt? I used a epic programmer as I don't have the warp 13.
___________________________
This message was ported from CCS's old forum
Original Post ID: 12721
Rollo
Guest







Addendum - found Config Bits menu in MPLAB
PostPosted: Sat Mar 15, 2003 1:07 pm     Reply with quote

Just to say that I found the config bits submenu in MPLAB, so I can do this from there. Newbie Fog left me confused about the #FUSES directive -- looks like these bits also have to be set manually as well.

Thanks,
Rol
___________________________
This message was ported from CCS's old forum
Original Post ID: 12722
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