Topic : USART ARM CORTEX M3 STM32F103

Forum : ARM

Original Post
Post Information Post
February 17, 2010 - 2:34am
Guest

Hi!
Can you tell me how can i ''set'' or ''reset'' the 9th bit in asynchronous mode, for 9 bits configuration, with parity disable?
Thanks!

Replies
Post Information Post
+1
0
-1
February 18, 2010 - 5:30pm
Guest

Hi!
Sorry, but is this a stupid question? If in USART asynchonous mode 9bits with parity disable, what would be the state of 9th bit in transmission?
It is possible?
Thanks again...

+1
0
-1
February 19, 2010 - 9:12am
Raisonance Support Team

Hi Xisca,

Looking at the STM32F10x reference manual, it looks like the 9th bit is a "possible parity bit", so it cannot be a data bit.
As of its state (0, 1, even or odd) it is not documented in the manual. Either make som experiments with a scope and check what happens; or go to the ST support people and ask them, they should be more helpful than we are on such elements.

Let us know if you find something interesting.

Regards,
Bruno

+1
0
-1
February 19, 2010 - 12:00pm
Guest

Bruno wrote:
Looking at the STM32F10x reference manual, it looks like the 9th bit is a "possible parity bit", so it cannot be a data bit.

I think the STM32 supports the 9-bit "Multiprocessor" mode - as found, for example, on the 8051.

Here, the 9th bit is not a "data" bit, but is used to identify "address" bytes.

As Bruno says, this is a hardware detail of the chip; it has nothing to do with the software tools (eg, Raisonance) - so it's really a question for the ST forum...

+1
0
-1
February 19, 2010 - 5:07pm
Guest

Hi!
Thanks for your anwser. I read the manual too and its is not documented, like a lot of things. This is not your departament,
thats clear, i only think that if it is possible to do that, may be you could know about it. I would like to use this bit to data/command control. I dont think they thought in that, but i will try to ask them...
Sorry to bother you again.
Thanks for help, anyway...

+1
0
-1
February 19, 2010 - 6:04pm
Guest

https://my.st.com/public/STe2ecommunities/mcu/Lists/ARM%20CortexM3%20STM32/Flat.aspx?RootFolder=%2fpublic%2fSTe2ecommunities%2fmcu%2fLists%2fARM%20CortexM3%20STM32%2fUSART%20STM32%20asynchonous%20mode&FolderCTID=0x01200200770978C69A1141439FE559EB459D758000626BE2B829C32145B9EB5739142DC17E

+1
0
-1
February 19, 2010 - 6:05pm
Guest

Message send by: Clive (on ST Forum - USART STM32 asynchonous mode)

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.

/*******************************************************************************
* 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);
}

+1
0
-1
February 19, 2010 - 6:47pm
Guest

xisca wrote:
Message send by: Clive (on ST Forum - USART STM32 asynchonous mode)

The USART Data Register (DR) is 16-bits wide, to accommodates all 9 bits (D0..D8)


I don't think that's right?
+1
0
-1
February 21, 2010 - 12:08am
Guest

Hi!
The code present in the anwser above is correct and currently working.
Best Complements...

+1
0
-1
February 21, 2010 - 3:54pm
Guest

But it's not really making use of the Mulriprocessor facilitiry - which is wat the 9-bit mode is specifically designed for...