i am now using the "Ateml T89c51rc2" to develope my project. In the Keil uVersion2, i can select this chip as my target chip. However, in the chip's function description window, it does not this chip have SPI function. However,according to the chip's datasheet, this chip have the SPI function. Then, can i programming the spi port by Keil compiler?
You can always access the peripherals on a given chip. Just create the appropriate SFR's at the correct addresses (from the chip's datasheet) and then use them. A compiler turns C code into object code, why would an SPI peripheral matter to a compiler?
"why would an SPI peripheral matter to a compiler?" It shouldn't; however, uVision should be aware of it - and create the appropriate SFR definitions for the Compiler. Sounds like just an omission from the Device Database and/or Keil's header file - you need to contact Support for an update; see http://www.keil.com/support/email.htm
Andrew, do you really use the Keil device header files? In the past 8 years or so I haven't. I just sfr or sbit the few SFR's I need in the .c files I use them in. I guess this stems from not being able to get past assigning a value to something in all upper case, e.g.
SCON = 0x00;
r_scon = 0x00;
P3 |= RED_LED_ON;
r_redLedOn = 1;
View all questions in Keil forum