[Share]sdcc toolchain support
dwin released some C51 source codes for T5L core, in order to work with Keil developemnt tool. but I choose to use sdcc. After reading the source codes for Keil c51. I figured out only a few changes can make sdcc work as well.1. put DWINT5 to the right place. I get this done by assmbly code. I put following code into T5L.as and link it to my firmware.
.area CSEG (abs, CODE)
.org 0xf8
.globl __T5L_init__
__T5L_init__: .db 0xff, 0xff
.db 'D','W','I','N','T','5'
2. make sure initialize the registers at the beginning of the "main" function.
CKCON = 0x00;
T2CON = 0x70;
DPC = 0x00;
PAGESEL = 0x01;
D_PAGESEL = 0x02; //DATA RAM0x8000-0xFFFF
MUX_SEL = 0x00; //UART2,UART3关闭,WDT关闭
RAMMODE = 0x00;
3. make sure the linker included following options: --xram-loc 0x8000 --xram-size 0x7fff.
because the external ram starts from 0x8000 to 0xffff, only 32k, not 65k.
4. the sdcc has different mcs51 extentions vs Keil.
for example, all the keywords __xdata, __data, __sfr. everything has "__" as prefix. I have to go through all the SFR definitions to replace the Keil style with sdcc style.
Keil is the best 8051 compiler, but sdcc still works and free. Dear,thank you for sharing your experience.
页:
[1]