View previous topic :: View next topic |
Author |
Message |
rlgreen
Joined: 07 Dec 2007 Posts: 8
|
PIC16F887 Startup Problem |
Posted: Fri Dec 07, 2007 12:21 pm |
|
|
Hello All,
I have a problem getting my pic to run. The board works, because it works in assembly. I am sure it's my config setup. I'm using ver 4.023 and here is the simple code:
Code: | #use delay (clock=8000000)
#fuses INTRC,NOMCLR,IESO,PUT,NOPROTECT,NOWDT,BROWNOUT,NOLVP,BORV21,FCMEN,NODEBUG
#use rs232(baud=19200, xmit=PIN_C6,rcv=PIN_C7)
void main (void)
{
set_tris_C(0x00); //allouts
setup_oscillator(OSC_8MHZ);
//----------
// main loop
//----------
while(TRUE)
{
PORTC = 0XFF;
delay_ms(10);
PORTC = 0X00;
delay_ms(10);
}
} |
I put a scope on portc and nothing. I'm sure it's me. What am I missing? |
|
|
ECACE
Joined: 24 Jul 2006 Posts: 94
|
|
Posted: Fri Dec 07, 2007 12:46 pm |
|
|
For starters, you have not defined the processor.
You first line should be something like:
#include <16F877A.h>
Try that and see if it works. Of course though if you did not have that in your code, I doubt it would compile without it. Did you list your whole program? _________________ A HW Engineer 'trying' to do SW !!! Run!!! |
|
|
rlgreen
Joined: 07 Dec 2007 Posts: 8
|
|
Posted: Fri Dec 07, 2007 1:10 pm |
|
|
I did not list the whole file. i did have the include file. It seems that when I commented out the //#use(baud.....) the thing started working, so I guess it reserves that pinC6 for the uart. I'll get the hang of this C compiler yet
Thanks for the fast reply! |
|
|
|