Multiple Serial connection from Arduino to Qt Creator and Matlab - matlab

I am currently doing a project that uses this 3 softwares. Qt, Arduino Uno and MAtlab.
In my project, I was planning to use Qt to transmit an input value into Arduino in which Arduino will give a feedback in return, in which the feedback output is serially received by Matlab.
I have tried performing the serial connection, unfortunately Arduino Uno can only initiate serial connection with either one of them, and not both.
Is there any way to perform multiple transmit/received method between this Qt-arduino-Matlab serial connection?
Thank you for your time and aid

If I understand correctly, you have an Arduino device as serial port, and you want to communicate with it from Matlab and Qt simultaneously under the same host computer.
Under Windows, there seems no simple solution, unless you write some low level code to open the device with special share mode.
Under unix, you can open the serial port from Qt (it seems this works for you), and if needed, you start Matlab as sudo, so you have full control over the serial port, which allows you to open it again.

Related

How to flash without STLINK

My STLINKV2 is not working anymore, not detected by Linux, it failed after the first successful flash. I ordered a new one but it will take 60+ days to arrive. Meanwhile I have heard on Youtube you can program Bluepills directly by connecting cut open USB cable to certain pins and then using a jumper. But I cannot get any precie information on this, is this really possible and how?
You should use the embedded bootloader. You can flash it through several interfaces. Look at AN2606, maybe you can find an already written flasher. Good luck STM32CubeProgrammer handle it.
If you intend to program it through usb, look also at AN3156 all protocols document are referred in chapter 2 of AN2606
THOSE AREN'T CUT OPEN USB CABLES they are USB to serial adapters for arduino's bootloader
They connect them like this:
The problem is that this requires the Arduino STM32 bootloader to be flashed in it.
Another option will be to use STM32CubeProg this program allows you to program your stm over
Serial
SPI
I2C
USB
You'll need to set the BOOT0 and BOOT1 pins to the correct value (HIGH slash LOW) to allow it to go in flash mode during boot.
Here is semi outdated tutorial which tells most of the steps to program a STM using serial. (the Flash Loader Demonstrator is outdated and you should use STM32CubeProg)

Simulate serial-port communication

This semester I have a project where I need to send data from my microcontroller to my PC and read/interpret its data. We are doing this using an ftdi cable and using matlab to read the data.
I would like to know if there is a way that I can see if my matlab code works that doesn't involve me going to the lab to test it. That is, if there is a way to simulate receiving data in a USB port of my computer so that I can test if my code is working.
Thanks in advance

reading text message through matlab using AT commands and bluetooth

I want to read text message using Matlab as hyperterminal using AT commands and bluetooth as connection medium since I am new in it could somebody suggest that how can I do it.
I am using nokia c2-03 for sending the message but if you suggest any other phone i can that too
I connected my phone through USB, saw the Port name then connected it through matlab using
s=serial('COM1');
and then opened the port
fopen(s)
now I don't know what to do I mean now how can send at command to control the device.
PS I am sure that my device supports serial communication.

arduino +odroid (linaru ubuntu with eclipse and opencv) + usb camera

I hope you can help me. I am trying to build a robot but I am kind of stuck. The Arduino Mega is controlling the stepper motors drivers of the robot. The odroid-x is a single board computer that has installed linaro ubuntu and eclipse c++. All the programming is done in C++ and OpenCV is an image processing library.
The odroid-x has only as input a color camera. Therefore, the information from the camera is received and is processed in eclipse. Then, according to the information that is received, the odroid-x should send different integers to the arduino. The arduino should have a program already uploaded in itself, so it will be waiting for an integer and that integer is going to determine what the arduino is going to send to the drivers.
My questions are the following:
How can I do a serial communication between the arduino and the odroid-x?
How can I send information from eclipse to the arduino with a serial connection?
Thanks so much for any guide you can give me
First, be very, very, very careful. The ODROID boards use 1.8V signalling, so hooking up your 3.3V or 5V Arduino to the pins that expect no more than 1.8V will give you a burnt ODROID-X. It is possible to hook these two boards together if you put a level converter between them, and Sparkfun and Adafruit have some of those converters available. There is even a 1.8V reference voltage pin available... one of the pins that go to the LCD panel RGB-to-LVDS converter board puts out a constant 1.8V.
You could use either the four pins of the little white connector, or UART1, as a serial port, or you can use some of the pins in the 50-pin GPIO block as UART4. There are board schematics available on Hardkernel's website. These two UARTs show up as /dev/ttySAC0 (UART1) and /dev/ttySAC3 (UART4).
I don't know how to talk to those UARTs from a program, personally, but I know there are serial communications libraries available for python from watching threads pop up on the ODROID forums.

Sending serial data without RS232 port

I want to send data serially from MATLAB, but my laptop doesn't have a serial port. Do I have to use a USB-to-RS232 converter? Will my program remain the same?
I have some RS232-USB-Converters and never had any trouble. I need adapters for embedded devices and embedded development.
If your driver is properly installed and works then it is presented as an serial device to the OS.
The device presented (on linux) is named differently (ttyUSB) but that doesn't matter.
And using stdio functions like fopen/fclose is one more layer above (libcall, not syscall).