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

ccs error, please help

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



Joined: 22 Mar 2010
Posts: 5

View user's profile Send private message

ccs error, please help
PostPosted: Mon Mar 22, 2010 1:37 pm     Reply with quote

hi guys,
I have got this error
Error 18 "pic18f4520.c" Line 0(0,0): File can not be opened

When I use my code to build it.

What does it mean ? and how can I resolve it.

Please help.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Mar 22, 2010 1:41 pm     Reply with quote

It probably means you are trying to compile source code that was
written for some other compiler than CCS.

If it was CCS source code, it would say this at the top of the program:
Code:

#include <18F4520.h>
rajabcomp2



Joined: 22 Mar 2010
Posts: 5

View user's profile Send private message

PostPosted: Mon Mar 22, 2010 2:00 pm     Reply with quote

this is the code which I did to build
Code:

#include <18f4520.h>
#device ICD=TRUE
#fuses HS,NOLVP,NOWDT
#use delay (clock=40000000)
#use rs232 (stream=LCD, baud=9600, xmit=PIN_B5, rcv=PIN_B4)
#include <ctype.h>
#include <stdlib.h>

#define delay_s(x) delay_ms(x*1000) // delay in seconds
#define velocity_cm 34442.4   // velocity of ultrasonic wave in cm/s
#define velocity_in 13560   // velocity of ultrasonic wave in
// inches/s
#define instruction_time (40000000/4)   // clock divide by 4
#define speed_50 192   // PWM on time for 50% speed
#define speed_65 211   // PWM on time for 65% speed
#define speed_75 224   // PWM on time for 75% speed
#define PWM_period 0.0004096 // Total PWM time period

// Global Variables
char display_lcd[15];   // characters diplayed on LCD
int32 left_distance, front_distance, right_distance;   //from
//ultrasonic sensors
// left_distance is left_front sensor reading
// right_distance is left_back sensor reading
int16 overflow_count;   // overflow count for timer 1
int value = 0;   // PWM on time value in terms of #
// between 0 to 255 signed int Speed = 0;   // Desired speed
int leftturn, rightturn = 0;   // number of left and right turns


// Subroutines
void lcd_putc(char c[], int d);   // display characters on LCD
void convert_display_lcd(int32 x, int y); // convert integers into
// ascii characters void get_value();   // get PWM on time value for speed void ultrasonic();   // read distances
void move_fwd();   // move forward
void move();   // move forward in the beginning
void increase (int amount);   // increase speed by amount in %
void decrease (int amount);   // decrease speed by amount in %
void turn_right(int time);   // turn right for x amount of time (x is
// called time)
void turn_left();   // turn left

// Interrupts
#int_timer1   // interrupt for timer overflow void timer1_isr()   // interrupt service routine
 

{
overflow_count++;   // increment overflow counter
}
rnielsen



Joined: 23 Sep 2003
Posts: 852
Location: Utah

View user's profile Send private message

PostPosted: Tue Mar 23, 2010 8:27 am     Reply with quote

You need a name for the interrupt routine and you've commented it out. Try:
Code:
// Interrupts
#int_timer1   // interrupt for timer overflow void timer1_isr()   // interrupt service routine
void timer1_isr()
{
  overflow_count++;   // increment overflow counter
}


That might help a bit.

Ronald
rajabcomp2



Joined: 22 Mar 2010
Posts: 5

View user's profile Send private message

PostPosted: Tue Mar 23, 2010 11:49 am     Reply with quote

ok guys, thx a lot for your help

I already solved the problem
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