欢迎访问ic37.com |
会员登录 免费注册
发布采购

89C51RB2-UM 参数 Datasheet PDF下载

89C51RB2-UM图片预览
型号: 89C51RB2-UM
PDF下载: 下载PDF文件 查看货源
内容描述: 8位微控制器,带有16K / 32K字节的闪存 [8-bit Microcontroller with 16K/ 32K Bytes Flash]
分类和应用: 闪存微控制器
文件页数/大小: 127 页 / 1478 K
品牌: ATMEL [ ATMEL ]
 浏览型号89C51RB2-UM的Datasheet PDF文件第67页浏览型号89C51RB2-UM的Datasheet PDF文件第68页浏览型号89C51RB2-UM的Datasheet PDF文件第69页浏览型号89C51RB2-UM的Datasheet PDF文件第70页浏览型号89C51RB2-UM的Datasheet PDF文件第72页浏览型号89C51RB2-UM的Datasheet PDF文件第73页浏览型号89C51RB2-UM的Datasheet PDF文件第74页浏览型号89C51RB2-UM的Datasheet PDF文件第75页  
AT89C51RB2/RC2  
Figure 27. Full-Duplex Master-Slave Interconnection  
MISO  
MOSI  
MISO  
MOSI  
8-bit Shift register  
8-bit Shift register  
SPI  
SCK  
SS  
SCK  
Clock Generator  
SS  
VDD  
Master MCU  
Slave MCU  
VSS  
Master Mode  
The SPI operates in Master mode when the Master bit, MSTR (1), in the SPCON register  
is set. Only one Master SPI device can initiate transmissions. Software begins the trans-  
mission from a Master SPI Module by writing to the Serial Peripheral Data Register  
(SPDAT). If the shift register is empty, the Byte is immediately transferred to the shift  
register. The Byte begins shifting out on MOSI pin under the control of the serial clock,  
SCK. Simultaneously, another Byte shifts in from the Slave on the Master’s MISO pin.  
The transmission ends when the Serial Peripheral transfer data flag, SPIF, in SPSTA  
becomes set. At the same time that SPIF becomes set, the received Byte from the Slave  
is transferred to the receive data register in SPDAT. Software clears SPIF by reading  
the Serial Peripheral Status register (SPSTA) with the SPIF bit set, and then reading the  
SPDAT.  
Slave Mode  
The SPI operates in Slave mode when the Master bit, MSTR (2), in the SPCON register is  
cleared. Before a data transmission occurs, the Slave Select pin, SS, of the Slave  
device must be set to ’0’. SS must remain low until the transmission is complete.  
In a Slave SPI Module, data enters the shift register under the control of the SCK from  
the Master SPI Module. After a Byte enters the shift register, it is immediately trans-  
ferred to the receive data register in SPDAT, and the SPIF bit is set. To prevent an  
overflow condition, Slave software must then read the SPDAT before another Byte  
enters the shift register (3). A Slave SPI must complete the write to the SPDAT (shift reg-  
ister) at least one bus cycle before the Master SPI starts a transmission. If the write to  
the data register is late, the SPI transmits the data already in the shift register from the  
previous transmission. The maximum SCK frequency allowed in slave mode is FCLK PERIPH  
/4.  
Transmission Formats  
Software can select any of four combinations of serial clock (SCK) phase and polarity  
using two bits in the SPCON: the Clock Polarity (CPOL (4)) and the Clock Phase  
(CPHA4). CPOL defines the default SCK line level in idle state. It has no significant  
effect on the transmission format. CPHA defines the edges on which the input data are  
sampled and the edges on which the output data are shifted (Figure 28 and Figure 29).  
The clock phase and polarity should be identical for the Master SPI device and the com-  
municating Slave device.  
1.  
The SPI Module should be configured as a Master before it is enabled (SPEN set). Also,  
the Master SPI should be configured before the Slave SPI.  
2.  
3.  
The SPI Module should be configured as a Slave before it is enabled (SPEN set).  
The maximum frequency of the SCK for an SPI configured as a Slave is the bus clock  
speed.  
4.  
Before writing to the CPOL and CPHA bits, the SPI should be disabled (SPEN = ’0’).  
71  
4180E–8051–10/06  
 复制成功!