I am evaluating the xGM210P032 and BGM13P32 for a new product.
1 fixed requiement which has to be fullfilled is that the module can handle a 9 databit UART communcation.
(250kb, no parity, 1 stopbit)
Sadly the uartdrv doesn't support 9 databits.
So is there a way i can make that work ? I found some hints that the peripheral is able to handle 9 databits communcation, but documention is hard to find.
Where should i start?
The simple answer here is: Don't use UARTDRV.
UARTDRV is a very generic piece of SW that is intended to provide a minimum level of functionality across all EFM32/EFR32/EZR32 devices from the original Series 0 Gecko (EFM32G) to the Series 2 xGM210P module you're using. Consequently, it doesn't handle any kind of implementation specific features a lot of customers need, and it rather limits what you can do with the DMA.
Which is fine... You can do more coding for the USART directly as you need to do it. Check out our examples here:
Specifically, the asynchronous ones. If you want to use 9-bit data frames, you'll need to add a line like this:
init.databits = usartDatabits9;
You'll also need to access the data registers like this:
uint16_t myRxData = USART_RxDouble(USART0); uint16_t myTxData = 0x155; USART_TxDouble(USART0, myTxData);
That's about it in a very simple sense. You can check on what API functions are available through emlib here:
The register listing in the xG21 reference manual will help you understand some of the other configuration related things you might want to do, such as using that 9th bit for something like mark/space wake-up.