MATLAB Serialport , sending data to 8051
2 ビュー (過去 30 日間)
古いコメントを表示
Hi, I have connected my 8051 board via USB as Serialport ("COM5") to MATLAB R2022b v3.
8051 doesn't receive a simple data , but seems trying to receive something.
MATLAB has recognized a COM for communication.
- I know how to send a data to Arduino via serial and its work .
- The 8051 dev board is working well .
- I have send data via some serial terminals (visual studio ) and other to 8051 and they communicate correctly.
- When i try to send a data to 8051 all others terminals are turned off.
- I have read ALL documentation about serialport and it is helpfuless
- Also i tried to send data via Serial Explorer but with the same result (with Arduino it works)
- Communicational parameters are 9600,no parity , 1 stop bit , no hardware,8 bits data
- Instrument toolbox is installed
thanks for any help
some code :
ports = serialportlist;
disp(ports);
d = serialport("COM5", 9600);
pause(1);
writeline(d,"1");
pause(1);
write(d,"0x31","char");
pause(1);
clear device d
0 件のコメント
回答 (1 件)
Dhruv
2023 年 2 月 23 日
I understand that you are trying to communicate with 8051 board via USB Serialport through MATLAB. In order to assist you better, please send me the following information:
1. Can you please elaborate more on your workflow and what are you trying to achieve in your workflow.
2. Are you facing any specific issue while trying to implement your workflow, as an issue with a particular function in MATLAB or something similar.
I am looking forward to getting this information from you.
However, It is recommended that you attempt the following troubleshooting steps in order to potentially resolve the issue.
• Try checking if there are any conflicts between MATLAB and the other serial terminals that you've used to communicate with the 8051 board. It's possible that another program may be blocking the COM port and thus preventing MATLAB from communicating with the board.
• Use the MATLAB Instrument Control Toolbox to monitor the serial communication between MATLAB and the 8051 board. You can use the 'configureTerminator' method which can help you identify any issues with the data format or timing.
• Try sending a different message or sequence of messages to the 8051 board to see if it responds.
• Check if there are any errors or warnings in the MATLAB command window or log files that may help troubleshooting.
Hopefully, these suggestions will help solve the issue, if it still persists feel free to provide more information about the specific error that may be encountered and I will be happy to assist you further.
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!