good morning,
I have a question,
I want to send a frame and display it on the osciloscope .
the sending protocol is as follows:
uint8_t CMD25[] = {0x7D, 0x80, 0x25, 0x00, 0x00};
on the osciloscope I can't display the right frame when decoding
how do you know?
my goal is to send the following frame:
0x7D, 0x80, 0x25, 0x00, 0x00 via TX on the arduino and display this frame on an oscilloscope to see if I've sent it correctly.
Follow these steps to observe a Frame (Asynchronous UART Frame, Fig-1) on the oscilloscope for charcater A (character code: 0x41).
Figure-1:
1. Get an Arduino UNO.
2. Connect scope at DPin-3 and GND.
3. Upload the following sketch in UNO.
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2, 3); // RX, TX pins on Arduino Uno
void setup()
{
Serial.begin(115200);
mySerial.begin(9600);
}
void loop()
{
mySerial.print('A'); //test signal
delay(10);
}
4. Trigger the scope properly to see something like Fig-1 at 10 ms interval.
5. Design sketch to observe the bytes of your following array on the scope:
uint8_t CMD25[] = {0x7D, 0x80, 0x25, 0x00, 0x00};
uint8_t CMD25[] = {0x7D, 0x80, 0x25, 0x00, 0x00};
void setup()
{
Serial.begin(115200);
Serial.write(CMD25,5);
}
void loop() {}
To see the bytes of the given array of post #1 on Serial Monitor, we need to execute print() methods as is shown in the following sketch.
uint8_t CMD25[] = {0x7D, 0x80, 0x25, 0x00, 0x00};
void setup()
{
Serial.begin(115200);
//Serial.write(CMD25,5);
}
void loop()
{
for (int i = 0; i < 5; i++)
{
byte y = CMD25[i];
if (y < 0x10)
{
Serial.print('0'); //leading zero
}
Serial.print(CMD25[i], HEX);
Serial.print(',');
}
Serial.println();
delay(1000);
}
@mlajm
As the bytes are appearing correctly on the Serial Monitor, they will then the corresponding timings will also appear correctly on the scope.
do you have such oscilloscope?
I have wanted to mean -- the correspond timings and NOT the display of the byte values as 7D, 80, 25, 00, 00.
I meant, do you have the same oscilloscope, and are you familiar with such a protocol?
If this question is directed towards me, then I ave not understood the question as to what protocol?
are you understand what TO want to achieve? are you know name of this protocol?
Data sending protocols (in Arduino UNO) could be --
UART
I2C
SPI
The OP has mentioned nothing except data items that are to transmitted!
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.