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 CCS Technical Support

Error 128 A #DEVICE before this line

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







Error 128 A #DEVICE before this line
PostPosted: Mon Mar 08, 2010 8:17 am     Reply with quote

When I compile my program using CCS compiler, I get this error in the line 6. My code is:

Code:
/*
Biblioteca lcd_4x20
Paulo Lacet
3/3/10
*/
#device *=16 ICD = TRUE
#use delay(clock=4000000)
#ifndef Fosc
#define Fosc 4 //Define a frequência do oscilador. Este valor deve corresponder a frequência do oscilador utilizado pelo PIC18.

// Os nome definidos são os próprios nomes dos pinos do display LCD.
#define B7 PORTBbits.RB7 //Define o nome B7 para a estrutra.
#define E_B7 TRISBbits.TRISB7=1;
#define S_B7 TRISBbits.TRISB7=0;
#define B6 PORTBbits.RB6 //Define o nome B6 para a estrutura.
#define E_B6 TRISBbits.TRISB6=1;
#define S_B6 TRISBbits.TRISB6=0;
#define B5 PORTBbits.RB5 //Define o nome B5 para a estrutura.
#define E_B5 TRISBbits.TRISB5=1;
#define S_B5 TRISBbits.TRISB5=0;
#define B4 PORTBbits.RB4 //Define o nome B4 para a estrutura.
#define E_B4 TRISBbits.TRISB4=1;
#define S_B4 TRISBbits.TRISB4=0;
#define E PORTDbits.RD6  //Define o nome E para a estrutura.
#define E_E TRISDbits.TRISD6=1;
#define S_E TRISDbits.TRISD6=0;
#define RW PORTDbits.RD1//Define o nome RW para a estrutura.
#define E_RW TRISDbits.TRISD1=1;
#define S_RW TRISDbits.TRISD1=0;
#define RS PORTDbits.RD7 //Define o nome RS para a estrutura.
#define E_RS TRISDbits.TRISD7=1;
#define S_RS TRISDbits.TRISD7=0;
#endif

I am using the PIC18F4550
Any ideas ?
dyeatman



Joined: 06 Sep 2003
Posts: 1934
Location: Norman, OK

View user's profile Send private message

PostPosted: Mon Mar 08, 2010 8:28 am     Reply with quote

Where is your #include <18F4550.h> device definition line?
It has to be before the #device *=16 ICD = TRUE line.
_________________
Google and Forum Search are some of your best tools!!!!
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