Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Tools
Old 27th July 2006, 02:44 PM   #1
Default Problem with 1st MCC18 program?

Hi guys,

Anyone familiar with Microchip C18 who can tell me why I'm getting a syntax error on the line below;

TIA, Mike

Code:
#include <p18f2320.h>

#pragma config  OSC    = INTIO1
#pragma config  BOR    = ON, BORV = 45
#pragma config  WDT    = OFF
#pragma config  MCLRE  = OFF
#pragma config  CCP2MX = C1
#pragma config  LVP    = OFF


#pragma code rx_interrupt = 0x08
void rx_int (void)
{
 _asm GOTO rx_handler _endasm
{
#pragma code

#pragma interrupt rx_handler
void rx_handler (void)         /* <--- compiler syntax error
{
 PIR1bits.CCP1IF=0
}
<added> looks like the paren' is pointing the wrong way. Doh!

Last edited by Mike, K8LH; 27th July 2006 at 04:03 PM.
Mike, K8LH is offline  
Old 27th July 2006, 07:31 PM   #2
Default

Hey guys,

I figured it out. Seems MCC18 is very picky about having function prototypes defined somewhere and then there's those missing semi-colons to contend with (grin). This is going to be quite an adventure (grin).

Regards, Mike
Mike, K8LH is offline  
Reply

Tags
1st, mcc18, problem, program

Thread Tools
Display Modes




All times are GMT. The time now is 04:23 AM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker