Help with custom baud rate (100000) for Arduino MKR WiFi 1010 in Simulink

26 views (last 30 days)
Hello MATLAB Community,
I am working on a project where I need to interface an Arduino MKR WiFi 1010 with a Microzone MC7RB receiver using the m.bus protocol, which is similar to Futaba's S.Bus protocol. I am trying to create a Simulink model to read the channel data from the receiver and process it.
I have already successfully implemented a solution using Arduino IDE with a custom baud rate of 100000 bps and the Serial1 port on the Arduino MKR WiFi 1010. However, when I try to implement the same functionality in Simulink, I am facing an issue with the baud rate.
In Simulink, the available baud rates for the "Serial Receive" and "Serial Send" blocks are limited, and I cannot find an option to set a custom baud rate of 100000 bps, which is required for the m.bus protocol. The closest option available is 115200 bps, but that is not suitable for my project.
Could you please guide me on how to set a custom baud rate of 100000 bps for the Arduino MKR WiFi 1010 in Simulink? Is there any workaround or method to achieve this functionality?
Any help or suggestions would be greatly appreciated.
Thank you in advance.
Best regards

Answers (1)

Atharva
Atharva on 26 Apr 2023
Hey Fellarrusto,
Yes, it is possible to set a custom baud rate of 100000 bps for the Arduino MKR WiFi 1010 in Simulink.
To set a custom baud rate in Simulink, you will need to follow the steps below:
  1. Open your Simulink model and add the "Serial Configuration" block from the Simulink library.
  2. Double-click on the "Serial Configuration" block to open its parameters.
  3. In the "Serial Configuration" parameters dialog box, set the "Baud rate" to "Custom" and enter "100000" as the custom baud rate.
  4. Set the "Data bits" to "8", "Stop bits" to "1", and "Parity" to "None" (unless you need to use different values).
  5. Set the "Flow control" to "None".
  6. Click "OK" to save the changes.
  7. Connect the "Serial Configuration" block to the "Serial Send" and "Serial Receive" blocks in your Simulink model.
  8. Compile and download the Simulink model to the Arduino MKR WiFi 1010.
After completing these steps, you should be able to use the custom baud rate of 100000 bps for serial communication between the Simulink model and the Arduino MKR WiFi 1010.

Products


Release

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!