2015-07-28 11:19 PM
Hi again :) i am using bluetooth module in my project. My bluetooth module support 1200 bps to 921.6Kbps.However i need first set up 300 bps.Then i need use 600-1200-2400-4800-9600 or 19200 bps .How can i?
2015-07-29 03:10 AM
So problem is with blue-tooth part ?
If yes, read datasheet and first understand how low can you go with bluetooth module, and after that, reconfigure prescalers inside uart config at stm part2015-07-29 03:34 AM
First setup the serial port with 300 baud, send the appropriate AT commands to change the baudrate of the bt module then setup the serial port again for the new baudrate.
2015-07-29 03:41 AM
USARTx->BRR = APBxCLK / Baud;
You could add some rounding, and you might need to enable/disable the USART to do it, and you'd definitely want to wait for the TC event to ensure the current data left the part so as not to change the rate mid-transmission.Not clear what STM32 part you're using, you can usually pull the APB clocks via RCC_GetClocks() or similar API2015-07-29 04:42 AM
Yes,my problem with bluetooth module.Beacuse it doesn't support 300 bps communication.
2015-07-29 06:00 AM
So you have TWO USART channels, and you're trying to mitigate the difference in speed between them?
Do either of the serial connections support flow control?Can you use a simple ring-buffer (FIFO) construction and use those to forward between the serial channels?2015-07-29 06:18 AM
Yes i have 2 Usart channels but unfortunately i use both of them.S,i don't use FIFO ring buffer.
Methinks,i should use other hardware2015-07-29 07:20 AM
Well that's a design decisions you'll have to make with far more information about the requirements than I.
What's 300 baud used for these days? If you're trying to auto-baud there are better ways to do that.2015-07-30 03:45 AM
I am using IEC 62056 protocol for smart electric meter reading.According as this protocol,first communication baudrate is 300,then changes
2015-07-30 06:34 AM
Ok, but that's not bluetooth, right. You can talk over bluetooth at rates convenient to that connection, and negotiate whatever rate you need with the meter over it's connection, and mitigate the difference with the STM32.