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

PIC16F887 Startup Problem

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



Joined: 07 Dec 2007
Posts: 8

View user's profile Send private message

PIC16F887 Startup Problem
PostPosted: Fri Dec 07, 2007 12:21 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Dec 07, 2007 12:46 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Dec 07, 2007 1:10 pm     Reply with quote

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 Smile

Thanks for the fast reply!
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