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

power-on reset execution

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







power-on reset execution
PostPosted: Mon Sep 22, 2008 3:15 pm     Reply with quote

My 16F887 processor does not execute code following power-on resets. It appears to need a hard reset of the MCLR line before it runs.

I vaguely remember having this trouble initially with the 877 processor a ways back.

Is there a line in the .H that helps it wake up after power-on? Or a trick to the MCLR line other than a 47k pull-up?

I removed a lot of extraneous stuff from the standard .H, but it did not seem to help.

.H used
#include <16F887.h>
#device adc=10

#FUSES NOWDT //No Watch Dog Timer
#FUSES

#use delay(clock=20000000)
#use i2c(master, sda=PIN_C4, scl=PIN_C3)
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8)

Thanks
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Sep 22, 2008 5:17 pm     Reply with quote

Quote:
I removed a lot of extraneous stuff from the standard .H,

Don't ever do this. Restore the original 16F887.H file.


The following program will blink an LED on pin B0.
Code:
#include <16F887.H>
#fuses HS, NOWDT, NOPROTECT, BROWNOUT, PUT, NOLVP
#use delay(clock=20000000)

//===================================
void main()
{

while(1)
  {
   output_high(PIN_B0);
   delay_ms(500);
   output_low(PIN_B0);
   delay_ms(500);
  }
 
}

This code assumes that you have a 20 MHz crystal (and associated
capacitors) connected to the PIC.
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