- Problem in sdcc
- Posted by mimran on June 24th, 2006
Hi All,
I have a little problem, hope you can help me in this regard.
I have this simple program. this is sending the continuous data usin
UART0 of the EZ USB FX2.
#define ALLOCATE_EXTERN
#include <fx2.h>
#include <fx2regs.h>
void init_fx2(void);
void init_uart(void);
void init_uart(void){
SCON0 = 0x52; // 8 bit UART mode
TMOD = 0x21; // Timer 0 and Timer 1 are initialize
to mode 1 n 2 resp
TH1 = 0xEC; // Reload value for 9600 baud rate a
48MHz clock
T1M = 1;
SMOD1 = 1;
TR1 = 1; // Start the Timer 1
}
void main(void)
{
char a = 0x41; // Character A
init_uart();
while(1){
while(TI){
TI = 0;
SBUF0 = a;
}
}
}
When i compile this program using Keil software on windows environmen
and upload the .hex file onto the EZ USB FX2 board using fxload, it
working fine. But the problem is that when i use the same program an
compile using sdcc, it gives me the error message like missing ; in lin
bla bla....
but if omit the include<fx2.h> then program compiles and makes the .ih
file but when i upload this file, it does not work at all.
I hope to help me in this regard
Best Regards
Muhammad Imran
- Posted by Bryan Hackney on June 25th, 2006
mimran wrote:
The non-C semantics are different between Keil and SDCC.
These might include bit variable qualifiers, memory
type qualifiers, etc, all very un-C and compiler
specfic.
- Posted by Joe G \(Home\) on June 25th, 2006
The header files between SDCC and Keil are different.
The terms "port" from one compiler to another or "port" from one micro
controller to another should be inserted here.
Also the compilers may use non-standard C commands to talk to the hardware
directly etc...
Suggest you carefully look up bothKiel and SDCC user manuals and compare the
differences.
There was an article on www.8052.com forum that mentioned a few
differences.
JG
"Bryan Hackney" <nobody@home.here> wrote in message
news:vPmng.33957$vU.7519@tornado.texas.rr.com...