??? 03/10/09 12:29 Read: times |
#163298 - SDCC and Keil and I/O |
I have inherited a project due to staff changes at work. It uses a TUSB 3410 (8052 based) The project was built a long time ago using the Keil C51 compiler and I would like to change to use SDCC. First step was to get it building on SDCC. I made all the required changes as far as I could see (mostly the syntax for the sfrs and xdata placement). Now everything works perfectly except that the application does some I/O using the TUSB's GPIO pins which are mapped to P3 on the 8052. The output on the pins does not change in the SDCC version. I've got code like (in C)
T0 = TRUE; where T0 is defined as sbit T0 = P3^4; on Keil and __sbit __at (0xB4) T0; on SDCC and TRUE is 1. I've checked that both Keil and SDCC are producing the same assembly code (setb T0) and the code is being executed. I'm not familiar with the 8052, so am I missing something obvious? Has anyone else gone from Keil to SDCC and had something similar. I have searched on Google but not found anything; it seems like P3 is also a serial port for the 8052, am I missing some init code to make it work like a GPIO instead of serial. Thanks in advance, James |