參數資料
型號: MR80C52CXXX-12/883:D
廠商: TEMIC SEMICONDUCTORS
元件分類: 微控制器/微處理器
英文描述: 8-BIT, MROM, 12 MHz, MICROCONTROLLER, CQCC44
文件頁數: 13/125頁
文件大?。?/td> 6456K
182
8021G–AVR–03/11
ATmega329P/3290P
The following code example shows a simple USART receive function that handles both nine bit
characters and the status bits.
Note:
The receive function example reads all the I/O Registers into the Register File before any com-
putation is done. This gives an optimal receive buffer utilization since the buffer location read will
be free to accept new data as early as possible.
Assembly Code Example
USART_Receive:
; Wait for data to be received
sbis
UCSR0A, RXC0
rjmp
USART_Receive
; Get status and 9th bit, then data from buffer
in
r18, UCSR0A
in
r17, UCSR0B
in
r16, UDRn
; If error, return -1
andi
r18,(1<<FE0)|(1<<DOR0)|(1<<UPE0)
breq
USART_ReceiveNoError
ldi
r17, HIGH(-1)
ldi
r16, LOW(-1)
USART_ReceiveNoError:
; Filter the 9th bit, then return
lsr
r17
andi
r17, 0x01
ret
C Code Example
unsigned int
USART_Receive( void )
{
unsigned char
status, resh, resl;
/* Wait for data to be received */
while
( !(UCSR0A & (1<<RXC0)) )
;
/* Get status and 9th bit, then data */
/* from buffer */
status = UCSR0A;
resh = UCSR0B;
resl = UDRn;
/* If error, return -1 */
if
( status & (1<<FE0)|(1<<DOR0)|(1<<UPE0) )
return
-1;
/* Filter the 9th bit, then return */
resh = (resh >> 1) & 0x01;
return
((resh << 8) | resl);
}
相關PDF資料
PDF描述
MC80C52EXXX-12SC 8-BIT, MROM, 12 MHz, MICROCONTROLLER, CDIP40
MD80C52TXXX-16SHXXX:D 8-BIT, MROM, 16 MHz, MICROCONTROLLER, CDIP40
MR80C52CXXX-12SCR 8-BIT, MROM, 12 MHz, MICROCONTROLLER, CQCC44
MQ80C52XXX-25 8-BIT, MROM, 25 MHz, MICROCONTROLLER, CQFP44
MD80C52EXXX-20SB 8-BIT, MROM, 20 MHz, MICROCONTROLLER, CDIP40
相關代理商/技術參數
參數描述
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
MR80C86-2/B 制造商:Intersil Corporation 功能描述:MPU 80C86 16BIT CMOS 8MHZ 44PLCC - Rail/Tube