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 CCS Technical Support

Odd pathology PIC16F877

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







Odd pathology PIC16F877
PostPosted: Tue Feb 22, 2005 8:30 am     Reply with quote

Hi,

I'm implementing a fairly straightforward up/down counter using a PIC16F877A with PCM 3.185.

The counter works as a counter, that isn't the problem. The trouble occurs because I'm using the RB6 and RB7 lines as counter inputs (the only lines physically available at the board edge connector). I've bodged it using RB4 and RB5 and the problem seems to go away using these inputs.

The trouble? The PIC frequently crashes when one of the count lines is brought low (pullups are enabled, lines idle high), and the watchdog only resets it occasionally. I'm thinking that this behaviour may have something to do with the LVP/ICSP mode and I'm causing the PIC to enter a programming state - am I right? Pin RB3 is pulled to 0V via 10K. I can't see what's causing this - my fuses line reads:
Code:

#pragma fuses HS,WDT,PUT,BROWNOUT,NOLVP,NODEBUG,NOPROTECT


Any ideas/suggestions?
Ttelmah
Guest







PostPosted: Tue Feb 22, 2005 9:13 am     Reply with quote

Are you sure your actual programming routine is reading the fuses?. Some packages 'override' the fuses, ignoring some of them, and requiring you to set these manually in the programmer software. Check in this, that the fuses are as expected.

Best Wishes
Guest








PostPosted: Wed Feb 23, 2005 10:05 am     Reply with quote

I've just checked this - a good point.
The fuses would appear to be set correctly in the programmer, and I've confirmed this by reading back a programmed chip.
Fuses are: (Enabled) WDT,BODEN,PWRTE, WRT Enable (Disabled) CPD,DEBUG,Code Protect,LVP. Oscillator is HS. That's the contents of the fuses screen on the programmer other than the chip ID.
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