We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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?
"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;
However, in the chip's function description window, it does not this chip have SPI function. The description is just a terse text field that we use to write a description of the device. Refer to http://www.keil.com/dd/chip/3230.htm to view the one for the T89C51RC2. Notice that the description doesn't mention the voltage required or the number of pins or the package type. But, the chip has these attributes as well. The contents of the description neither hinder nor aid your ability to use the part and certainly do not affect the header file nor any other aspects of the tools. I did notice that there is a problem with other aspects of the support for this device. 1. The header file does not include the SFRs for the SPI. 2. SPI simulation support is not listed (either as supported or as not supported). After investigating I've found that the reason is because it appears that the T89C51RC2 is NOT campatible with the T80C51RC2, T83C51RC2, T87C51RC2 devices. The datasheet for the T89C51RB2/T89C51RC2 lists the SPI but the datasheet for the T89C51RD2 does not. We usually add support for a device long before the general public even knows about it. Most times, documentation is not even available. In the case of the T89C51RC2, the documentation for the T89C51RD2 device was used. We will correct the problems with the T89C51RB2/RC2 parts ASAP. In the mean time, to use the SPI, you must include the following SFR definitions in your project.
sfr SPCON = 0xC3; sfr SPSTR = 0xC4; sfr SPDAT = 0xC5;