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

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



Joined: 17 Sep 2004
Posts: 133
Location: UK

View user's profile Send private message

Error
PostPosted: Thu Dec 02, 2004 9:16 am     Reply with quote

Getting the following error:
Halting build on first failed translation as user preferences indicate.

What does it mean?
_________________
Alex
rwyoung



Joined: 12 Nov 2003
Posts: 563
Location: Lawrence, KS USA

View user's profile Send private message Send e-mail

PostPosted: Thu Dec 02, 2004 9:21 am     Reply with quote

It means you have an error in your C code and the compiler's preferences are set to stop the compiling process at the first error.

Post your code if you cannot find the error yourself.
_________________
Rob Young
The Screw-Up Fairy may just visit you but he has crashed on my couch for the last month!
alexz



Joined: 17 Sep 2004
Posts: 133
Location: UK

View user's profile Send private message

PostPosted: Thu Dec 02, 2004 9:29 am     Reply with quote

rwyoung wrote:
It means you have an error in your C code and the compiler's preferences are set to stop the compiling process at the first error.

Post your code if you cannot find the error yourself.




#device PIC16F877 *=16 ADC=8
#include "SFR.h"

#define CHANNEL0 0x01
#define CHANNEL1 0x07

unsigned char Press0;
unsigned char Press1;
unsigned char result;
//==============================================================================================
void main(void);
void Init(void);
void InitADC(void);
void InitSerial(void);
void WriteByte(unsigned char) ;
void ADC_isr(void) ;
//==============================================================================================
void main()
{
Init();
Press0 = 0;
Press1 = 0;

enable_interrupts(INT_AD);
Read_ADC(ADC_START_ONLY);
}
//==============================================================================================
void WriteByte(unsigned char TxByte )
{

while ((TXSTA & 2) == 0)// && CommsTimer < 100)// Wait until end of TXD
{
// CLRWDT();
}
TXREG = TxByte;
}
//==============================================================================================

//==============================================================================================
void Init(void)
{
TRISA = 0xFF;
TRISC = 0xFE;
InitADC();
InitSerial();
}
//===============================================================================================
void InitADC(void)
{
setup_adc_ports(RA0_RA1_RA3_ANALOG);
setup_adc(ADC_CLOCK_INTERNAL );
set_adc_channel(0);
disable_interrupts(INT_AD);
enable_interrupts(GLOBAL);
}
//===================================================================
void InitSerial(void)
{
TXSTA = 0x24 ;
RCSTA = 0x90 ;
SPBRG = 12; // set to 19.2 kBaud, using 19.66 MHz clock
}
//===================================================================
#int_AD
ADC_isr()
{
disable_interrupts(INT_AD);
PIR1bits.ADIF = 0;
Press0 = ADRESH ;
WriteByte(Press0);
}
_________________
Alex
alexz



Joined: 17 Sep 2004
Posts: 133
Location: UK

View user's profile Send private message

PostPosted: Thu Dec 02, 2004 9:32 am     Reply with quote

The following code gives the same error:
#include "SFR.h"
void main ()
{
}

That's why I dont think there is anything to do with the code
I am using the new MPLAB v7.00
_________________
Alex
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Thu Dec 02, 2004 10:07 am     Reply with quote

Well you didn't post the sfr.h file so I just made some stuff up. But it compiled just fine with MPLAB v7.0.
alexz



Joined: 17 Sep 2004
Posts: 133
Location: UK

View user's profile Send private message

PostPosted: Thu Dec 02, 2004 10:25 am     Reply with quote

Mark wrote:
Well you didn't post the sfr.h file so I just made some stuff up. But it compiled just fine with MPLAB v7.0.



The SFR.h is alright, use it all the time.

I have installed the older version of MPLAB v6.
and compiled it ok.
What would you say about that?
_________________
Alex
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Thu Dec 02, 2004 10:28 am     Reply with quote

I'd say mine works and yours doesn't Razz

Check to make sure you have the latest plugin
alexz



Joined: 17 Sep 2004
Posts: 133
Location: UK

View user's profile Send private message

PostPosted: Thu Dec 02, 2004 11:03 am     Reply with quote

Mark wrote:
I'd say mine works and yours doesn't Razz

Check to make sure you have the latest plugin


Where can I get it?
_________________
Alex
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Thu Dec 02, 2004 11:42 am     Reply with quote

Quote:

Where can I get it?


IMO, this is not the lane.
First as rwyoung suggest you, modify the compiler preferences to
no to stop at the very first error found, select:
Error Files [/b[b]]>-- Multi-Lines then when you know
what kind of error you are dealing with, make the corrections.

Best wishes,

Humberto
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Thu Dec 02, 2004 12:45 pm     Reply with quote

Quote:
IMO, this is not the lane.
First as rwyoung suggest you, modify the compiler preferences to
no to stop at the very first error found, select:
Error Files [/b[b]]>-- Multi-Lines then when you know
what kind of error you are dealing with, make the corrections.


There is not a problem with the code. See his post above:

Quote:
I have installed the older version of MPLAB v6.
and compiled it ok.
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Thu Dec 02, 2004 12:46 pm     Reply with quote

alexz wrote:
Mark wrote:
I'd say mine works and yours doesn't Razz

Check to make sure you have the latest plugin


Where can I get it?


Try the download section from CCS. Of course the new version of MPLAB might already have it.
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Thu Dec 02, 2004 2:02 pm     Reply with quote

Quote:

There is not a problem with the code. See his post above:


Hi Mark,
I didn�t mention anything regarding the code,
but the compiler options and the procedure.

Humberto
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Thu Dec 02, 2004 2:22 pm     Reply with quote

Quote:
Multi-Lines then when you know
what kind of error you are dealing with, make the corrections


Quote:
I didn�t mention anything regarding the code


Well he is getting some error when compiling. Now nothing is wrong with the code since it compiles just fine on my machine. Whether or not he stops the compile on the first error isn't going to fix the problem or show him what the problem is. He shouldn't get any errors since it compiles just fine for me. Also, it compiles with the old MPLAB so there must be some sort of installation problem or incorrect setup (not whether or not the compile stops on the first error).
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