Problem in sdcc

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 #include

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 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

Reply to
mimran
Loading thread data ...

[...]

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.

Reply to
Bryan Hackney

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

formatting link
forum that mentioned a few differences.

JG

Reply to
Joe G (Home)

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.