Arduino support package baud rate

Hello,
When using the arduino support package, is it possible to increase the baud rate within MATLAB from 9600 to 115200? I am aware that this can be done in the Arduino program, sent to the serial port and read by MATLAB, but I am not sure how to make this work within MATLAB and allow for simultaneous control of the digital out pins.
Thanks for your help!

Answers (1)

I am not sure which version of the support package you are using, but I am working with 15a and here is a file that might help you - boards.xml
Try this in MATLAB (it is from the doc) so might work in the older versions too.
>> edit(fullfile(arduinoio.SPPKGRoot, '+arduinoio', '+internal', 'boards.xml'))
If not here is how I got to it on my installation. Support package installation area - C:\MATLAB\SupportPackages\R2015a
The location of the file inside the support package installation area - arduinoio\toolbox\matlab\hardware\supportpackages\arduinoio\+arduinoio\+internal
so the actual path - C:\MATLAB\SupportPackages\R2015a\arduinoio\toolbox\matlab\hardware\supportpackages\arduinoio\+arduinoio\+internal
If you edit the boards.xml file and change the baud rate it might work.
Also ensure you clear classes in MATLAB after updating the file.

3 Comments

Thanks for your answer. I am using 2015a as well. After updating the .xml file, I get the following error:
" Updating server code on board Nano3 (COM4). Please wait. Error using Example1_Example1_OpeningFcn (line 66) Cannot program board Nano3 (COM4). Please make sure the board is supported and the port and board type are correct.
Error in gui_mainfcn (line 220) feval(gui_State.gui_OpeningFcn, gui_hFigure, [], guidata(gui_hFigure), varargin{:});
Error in Example1 (line 42) gui_mainfcn(gui_State, varargin{:}); "
Hi Christopher, I am currently using 2018a, and from what I have seen this happens due to the Matlab communicating with the Arduino faster than what it can operate, such as trying to overclock the speed. I am currently using the MEGA2560 Arduino Board.
Hello, I am using MATLAB 2019b and I am trying to modify the Baud rate of my arduino Uno set by MATLAB support package. I found the .xml file 'boards.xml' but there were no content related to baud rate.
boards.xml
boards.png

Sign in to comment.

Categories

Find more on MATLAB Support Package for Arduino Hardware in Help Center and File Exchange

Asked:

on 11 Dec 2015

Commented:

on 17 Dec 2019

Community Treasure Hunt

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

Start Hunting!