View previous topic :: View next topic |
Author |
Message |
alexz
Joined: 17 Sep 2004 Posts: 133 Location: UK
|
Error |
Posted: Thu Dec 02, 2004 9:16 am |
|
|
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
|
|
Posted: Thu Dec 02, 2004 9:21 am |
|
|
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
|
|
Posted: Thu Dec 02, 2004 9:29 am |
|
|
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
|
|
Posted: Thu Dec 02, 2004 9:32 am |
|
|
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
|
|
Posted: Thu Dec 02, 2004 10:07 am |
|
|
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
|
|
Posted: Thu Dec 02, 2004 10:25 am |
|
|
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
|
|
Posted: Thu Dec 02, 2004 10:28 am |
|
|
I'd say mine works and yours doesn't
Check to make sure you have the latest plugin |
|
|
alexz
Joined: 17 Sep 2004 Posts: 133 Location: UK
|
|
Posted: Thu Dec 02, 2004 11:03 am |
|
|
Mark wrote: | I'd say mine works and yours doesn't
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
|
|
Posted: Thu Dec 02, 2004 11:42 am |
|
|
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
|
|
Posted: Thu Dec 02, 2004 12:45 pm |
|
|
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
|
|
Posted: Thu Dec 02, 2004 12:46 pm |
|
|
alexz wrote: | Mark wrote: | I'd say mine works and yours doesn't
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
|
|
Posted: Thu Dec 02, 2004 2:02 pm |
|
|
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
|
|
Posted: Thu Dec 02, 2004 2:22 pm |
|
|
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). |
|
|
|