Forum : ARM
Original Post
Post Information | Post |
---|---|
February 17, 2010 - 2:34am
|
Hi! |
Forum : ARM
Post Information | Post |
---|---|
February 17, 2010 - 2:34am
|
Hi! |
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...
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
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...
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...
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
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);
}
I don't think that's right?
Hi!
The code present in the anwser above is correct and currently working.
Best Complements...
But it's not really making use of the Mulriprocessor facilitiry - which is wat the 9-bit mode is specifically designed for...