Ravi Kumar Posted May 14, 2020 Posted May 14, 2020 I want to send commands to openscope from arduino mega using UART. I connected OpenScope UART to Serial#1 pins of Arduino Mega. You can read the attached arduino ino code. It writes JSON Commands to Serial#1(OpenScope) , reads characters from Serial#1(OpenScope) and writes it onto Serial #0(Serial Monitor). There is a problem in Serial#1 communication, you can see the output below: sketch_may13a.ino
JColvin Posted May 14, 2020 Posted May 14, 2020 Hi @Ravi Kumar, My understanding is that Serial1 will need to be run at 1250000 baud rather than 115200 baud because 1.25 MBaud is what the OpenScope MZ has been setup to run at in order to correctly receive characters. I believe it is possible run it at slower baud rate though the OpenScope material would need to be adjusted accordingly. Thanks, JColvin
Ravi Kumar Posted May 15, 2020 Author Posted May 15, 2020 Oh no, I edited the source code from github https://github.com/Digilent/openscope-mz , and changed the baud rate to 115200.
JColvin Posted May 15, 2020 Posted May 15, 2020 Hi @Ravi Kumar, Is there a particular reason in your readreply function that you are waiting for data to become available in Serial (i.e. Serial.available ) rather than Serial1 which the OpenScope is using? If you are using the Serial.available you are waiting for the data to come from the PC before reading the Serial1 line. Thanks, JColvin
Ravi Kumar Posted May 16, 2020 Author Posted May 16, 2020 Sorry for that, I uploaded the older file, I did write Serial1.available() in the code that I compiled and uploaded to mega. Also, I updated the file in first comment. Still not working, need help ! @JColvin
Ravi Kumar Posted June 3, 2020 Author Posted June 3, 2020 @JColvin Issue is still not solved. please reply.
JColvin Posted June 5, 2020 Posted June 5, 2020 Hi @Ravi Kumar, I apologize. We're not certain what the problem might be. The strange bit is that the code seems to report data correctly temporarily, loses communication, and then seems to successfully regain communication. If you have an oscilloscope or logic analyzer to look at what is happening, that could help reveal the problem. Beyond that, I am not certain. Thank you, JColvin
Recommended Posts
Archived
This topic is now archived and is closed to further replies.