2024-02-08 01:05 AM
Need to achieve 38400 baud rate for reception of NMEA messages but here 38400 is not in the multiple of binary numbers.
Setting the clock to 8MHz and then using prescaler is just setting it to 31.25 Kb.
How to adjust to be able to achieve that baud rate ?
2024-02-08 02:07 AM
Hello,
I think you can use PLL for this.
I had a trial and achieved 38.411Kb/s . I don't know if it does fit your expectation:
2024-02-08 05:55 AM - edited 2024-02-08 06:00 AM
Typically, SPI speed is specified as a maximum speed. Have never seen a chip which required an exact SPI clock frequency.
What chip? Are you sure you're not mixing up SPI and UART? 38400 sounds like a UART baud rate from a GPS receiver.
2024-02-08 12:52 PM - edited 2024-02-08 12:52 PM
I also suspect an UART output, as this is typically used for NMEA messages, as @TDK said. But even then you don't have to hit 38400 to several decimal places because UART works with oversampling and has a certain frequency tolerance - 1% deviation is no problem at all, and the proposal of @SofLit is only 0.029% off.