2010-02-19 08:23 AM
USART STM32 asynchonous mode
2011-05-17 04:40 AM
The USART Data Register (DR) is 16-bits wide, to accommodates all 9 bits (
D0
..D8
) You should always write the DR as an ''unsigned short'' or ''u16'', if using DMA the 9-bit mode would require you send Half Words, not Bytes. -Clive /******************************************************************************* * Function Name : USART_SendData * Description : Transmits single data through the USARTx peripheral. * Input : - USARTx: Select the USART or the UART peripheral. * This parameter can be one of the following values: * - USART1, USART2, USART3, UART4 or UART5. * - Data: the data to transmit. * Output : None * Return : None *******************************************************************************/ void USART_SendData(USART_TypeDef* USARTx, u16 Data) { /* Check the parameters */ assert_param(IS_USART_ALL_PERIPH(USARTx)); assert_param(IS_USART_DATA(Data)); /* Transmit Data */ USARTx->DR = (Data & (u16)0x01FF); }2011-05-17 04:40 AM
It would be polite to acknowledge the help that you've already received on this:
2011-05-17 04:41 AM
2011-05-17 04:41 AM
There is an example of using the USART in Multiprocessor Mode (ie, 9-bit mode) included in the Standard Peripheral Library:
Project\STM32F10x_StdPeriph_Examples\USART\MultiProcessor2011-05-17 04:41 AM
Have you read the description of the Multiprocessor Mode in the RM0008 Reference Manual?