Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
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

List of 26 messages in thread
TopicAuthorDate
SDCC and Keil and I/O            01/01/70 00:00      
   No big changes for SDCC            01/01/70 00:00      
   Nothing obvious            01/01/70 00:00      
   just curious            01/01/70 00:00      
      Just what do you mean, Erik?            01/01/70 00:00      
         even the SDCC 'friends' agree            01/01/70 00:00      
         Answers to your quiz            01/01/70 00:00      
            5th            01/01/70 00:00      
            But the really difficult question is...            01/01/70 00:00      
      Thanks! and a bit of background            01/01/70 00:00      
         Am I going crazy?            01/01/70 00:00      
         Is the code large then 2K?            01/01/70 00:00      
            Keil deserves a medal if it is using USB in less than 2kB            01/01/70 00:00      
               Keil probably has nothing to do with the USB?            01/01/70 00:00      
                  If only it where that simple            01/01/70 00:00      
                  TUSB3410            01/01/70 00:00      
         Test costs?            01/01/70 00:00      
   Initially maintain a compatible source            01/01/70 00:00      
      But            01/01/70 00:00      
   Can you have a look at this?            01/01/70 00:00      
      use "__xdata volatile unsigned char __at(0xfffb) bMODECNF"            01/01/70 00:00      
         Done!            01/01/70 00:00      
            thanks            01/01/70 00:00      
      register bank, ar4?            01/01/70 00:00      
   A free 3-month full Keil PK51 licence            01/01/70 00:00      
      Thanks for the link!            01/01/70 00:00      

Back to Subject List