參數(shù)資料
型號: MR80C32-36:RD
廠商: ATMEL CORP
元件分類: 微控制器/微處理器
英文描述: 8-BIT, 36 MHz, MICROCONTROLLER, CQCC44
封裝: LCC-44
文件頁數(shù): 120/120頁
文件大小: 25028K
206
8272E–AVR–04/2013
ATmega164A/PA/324A/PA/644A/PA/1284/P
transmitter controls the transfer clock. The data written to UDRn is moved from the transmit buf-
fer to the shift register when the shift register is ready to send a new frame.
Note:
To keep the input buffer in sync with the number of data bytes transmitted, the UDRn register must
be read once for each byte transmitted. The input buffer operation is identical to normal USART
mode, i.e. if an overflow occurs the character last received will be lost, not the first data in the buf-
fer. This means that if four bytes are transferred, byte 1 first, then byte 2, 3, and 4, and the UDRn
is not read before all transfers are completed, then byte 3 to be received will be lost, and not byte
1.
The following code examples show a simple USART in MSPIM mode transfer function based on
polling of the Data Register Empty (UDREn) Flag and the Receive Complete (RXCn) Flag. The
USART has to be initialized before the function can be used. For the assembly code, the data to
be sent is assumed to be stored in Register R16 and the data received will be available in the
same register (R16) after the function returns.
The function simply waits for the transmit buffer to be empty by checking the UDREn Flag,
before loading it with new data to be transmitted. The function then waits for data to be present
in the receive buffer by checking the RXCn Flag, before reading the buffer and returning the
value.
Note:
Assembly Code Example
USART_MSPIM_Transfer:
; Wait for empty transmit buffer
sbis
UCSRnA, UDREn
rjmp
USART_MSPIM_Transfer
; Put data (r16) into buffer, sends the data
out
UDRn,r16
; Wait for data to be received
USART_MSPIM_Wait_RXCn:
sbis
UCSRnA, RXCn
rjmp
USART_MSPIM_Wait_RXCn
; Get and return received data from buffer
in
r16, UDRn
ret
C Code Example
unsigned char
USART_Receive( void )
{
/* Wait for empty transmit buffer */
while
( !( UCSRnA & (1<<UDREn)) );
/* Put data into buffer, sends the data */
UDRn = data;
/* Wait for data to be received */
while
( !(UCSRnA & (1<<RXCn)) );
/* Get and return received data from buffer */
return
UDRn;
}
相關(guān)PDF資料
PDF描述
MQ80C32E-30/883:RD 8-BIT, 30 MHz, MICROCONTROLLER, CQFP44
MC80C32E-36/883 8-BIT, 36 MHz, MICROCONTROLLER, CDIP40
MC80C52TXXX-36/883:D 8-BIT, MROM, 36 MHz, MICROCONTROLLER, CDIP40
MD80C52TXXX-30SHXXX:D 8-BIT, MROM, 30 MHz, MICROCONTROLLER, CDIP40
MR80C32E-36SHXXX:D 8-BIT, 36 MHz, MICROCONTROLLER, CQCC44
相關(guān)代理商/技術(shù)參數(shù)
參數(shù)描述
MR80C51BH 制造商:ROCHESTER 制造商全稱:ROCHESTER 功能描述:CMOS SINGLE - CHIP 8-BIT MICROCOMPUTER 64K program Memory Space
MR80C86 制造商:INTERSIL 制造商全稱:Intersil Corporation 功能描述:CMOS 16-Bit Microprocessor
MR80C86/B 制造商:Rochester Electronics LLC 功能描述:- Bulk 制造商:Harris Corporation 功能描述:Microprocessor, 16 Bit, 44 Pin, Ceramic, LCC
MR80C86-2 制造商:INTERSIL 制造商全稱:Intersil Corporation 功能描述:CMOS 16-Bit Microprocessor
MR80C86-2/883 制造商:Rochester Electronics LLC 功能描述:- Bulk