2005-09-02 09:03 PM
2005-08-28 10:04 PM
Hi, I have some problem with parity check on bytes received by UART. The settings for UART are :
UART_OnOffConfig(UART0, ENABLE); UART_FifoConfig (UART0, DISABLE); UART_FifoReset(UART0, UART_RxFIFO); UART_FifoReset(UART0, UART_TxFIFO); UART_LoopBackConfig(UART0, DISABLE); UART_ItConfig(UART0, UART_ParityError, ENABLE); UART_Config(UART0, 9600, UART_EVEN_PARITY, UART_1_StopBits,UARTM_8D_P); UART_RxConfig(UART0, ENABLE); I try to receive bytes from device with both even and odd parity (i'm sure in the correct way checking with oscilloscope) but when i check the parity of received byte with while(!(UART_FlagStatus(UART0) & UART_RxBufFull)); UART_ByteReceive(UART0,(u8 *)&str_viewr[i], 0xFF); if((UART_FlagStatus(UART0) & UART_ParityError) ==UART_ParityError)uart_errors++; my counter uart_errors is always 0. I try also to make this with uart0 interrupt: Set_IRQ(UART0_IRQChannel,1); extern u8 uart_errors; void UART0_IRQHandler(void) __arm { if((UART_FlagStatus(UART0) & UART_ParityError) == UART_ParityError)uart_errors++; } but the result is the same. I think someone have any advice Thanks2005-08-30 06:52 PM
after: UART_ByteReceive(UART0,(u8 *)&str_viewr[i], 0xFF); etc after read rev buffer,the Parity flag is reset.
2005-09-02 09:03 PM
Thank you,
I try to make parity check before Recv Buffer reading and it work!