|
|
View previous topic :: View next topic |
Author |
Message |
baumgarcX Guest
|
power-on reset execution |
Posted: Mon Sep 22, 2008 3:15 pm |
|
|
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
|
|
Posted: Mon Sep 22, 2008 5:17 pm |
|
|
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. |
|
|
|
|
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
|