2010-09-03 05:38 AM
USART Receiver problem
2011-05-17 05:05 AM
Works fine if you don't enable SCLK
USART1->BRR = 0x0341; // 9600 USART1->CR1 = 0x200C; // Enable USART, TX, RX USART1->CR2 = 0x0000; // Not Synchronous Your TX code would also work more effectively if you monitored TXE rather than TC, and your RX code will foul up if there is any kind of receive error state pending. Still it might be instructive if you evaluate how the library code is setting up the hardware so you can also debug your own code.2011-05-17 05:05 AM
thank you now my code is working fine with USART-CR2=0x0000, but in Synchronous mode we have to enable the CLKEN bit right then why it is not working. and in the manual it is written also as follows
USART Synchronous mode is selected by by writing CLKEN bit in USART_CR2 register.2011-05-17 05:05 AM
In synchronous mode, the are no start or stop bits. So Hyperterminal will not be compatible with it.
2011-05-17 05:05 AM
>>thank you now my code is working fine with USART-CR2=0x0000, but in Synchronous mode we have to enable the CLKEN bit right then why it is not working.
You're doing synchronous serial with Rx, RxClk, Tx, TxClk? That would be useful information to provide in your question. Most synchronous applications these days use SPI, and classic UART applications are typically asynchronous (ie without a clock).