Connect with us

The specific algorithm of baud rate when communicating with PIC microcontroller serial port?

Discussion in 'Microcontrollers, Programming and IoT' started by bancroft, Aug 6, 2021.

Scroll to continue with content
  1. bancroft


    Apr 23, 2021
    My microcontroller is PIC16F877A, crystal 4M, I want to set the baud rate to 38400, please tell me the exact algorithm.
    Because the baud rate of my Bluetooth module is 38400, initially the baud rate of my microcontroller program is 9600, do I also have to set the baud rate of the microcontroller program to 38400? Or will the Bluetooth module baud rate be set to 9600? The main thing is that my computer does not have Bluetooth, so there is no way to modify the baud rate of the Bluetooth module.
  2. Harald Kapp

    Harald Kapp Moderator Moderator

    Nov 17, 2011
    Baudrates need to match. It doesn't matter on which board you change the baudrate to get a match. But as you can't change it on the bluetooth module, you obviously need to do it on the µc side.
    Work through this tutorial on baudrate calculation for the PIC.
    davenn and bancroft like this.
  3. bancroft


    Apr 23, 2021
    Thank you so much!!!
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day