Hello everyone.
I'm trying to receive a hexadecimal frame over serial from a stepper motor and print its data values in the serial monitor.
The stepper is a closed loop package from BIGTREETECH, it's their S57B model. The package comes with a 32 Bit microprocessor and their own custom firmware.
They specified a protocol that has the following format:
This is how far I've gotten with my experiments:
Command for the read request as per the specified protocol:
void sendReadRequest() {
const size_t packet_length = 8;
uint8_t packet[packet_length] = {0xFE, 0xFE, 0x05, 0xB0, 0xAA, 0xAA, 0x09, 0x16};
Serial.write(packet, packet_length);
}
And on the reading side of things:
void loop() {
if (Serial.available() > 0) {
incomingByte = Serial.read();
Serial.print("I received: ");
Serial.println(incomingByte, HEX);
}
}
There is only some gibberish being printed in the console, so I'm guessing it's in the wrong format and/or is being read in the wrong way. Maybe a Serial.readBytesUntil() would work?
I know that the command for the request must be right tho, because whenever I send it, there is something being printed in the serial monitor.
Thank you guys in advance!
PS: I should also mention that there is an SPI and CAN interface available as well from the stepper. However, since documentation is sparse I do not know how to really use them.
Here is a link to the docs for the stepper: BIGTREETECH-Stepper-Motor-Driver/S57B at master · bigtreetech/BIGTREETECH-Stepper-Motor-Driver · GitHub
