I'm using an oscilloscope and double checking with a logic probe, in case DIRECTION_PIN sets low several seconds after the transmit, and the oscope isn't catching it returning to LOW.
In this part of the code
if ( pid == RDM_DISC_MUTE ) {
if ( destination == SAMD21DMX.THIS_DEVICE_ID ) {
// discovery_enabled = 0; //<-------------- comment out here
// send ACK
// UID source;
// source.setBytes(&rdmdata[RDM_IDX_SOURCE_UID]);
// SAMD21DMX.sendMuteAckRDMResponse(RDM_DISC_COMMAND_RESPONSE, source, RDM_DISC_MUTE); // to here }
I can see on the oscope the DIRECTION_PIN going HIGH and LOW as it should @ 1ms. The return UID is sent 10 times as follows. I see all 10 pulses of the DIRECTION_PIN going HIGH and LOW
CC0124FFFFFFFFFFFF43540000000032010000001000010C000000000000FFFFFFFFFFFF0DCCFEFEFEFEFEFEFEAAEE7DFA7DAF5FAA5FAE5DAE5FAF57BB550000
CC01186C780F0A0C0E43540000000033010000001000020002D900
CC01186C780F0A0C0E43540000000034010000001000020002DA00
CC01186C780F0A0C0E43540000000035010000001000020002DB00
CC01186C780F0A0C0E43540000000036010000001000020002DC00
CC01186C780F0A0C0E43540000000037010000001000020002DD00
CC01186C780F0A0C0E43540000000038010000001000020002DE00
CC01186C780F0A0C0E43540000000039010000001000020002DF00
CC01186C780F0A0C0E4354000000003A010000001000020002E000
CC01186C780F0A0C0E4354000000003B010000001000020002E100
CC01186C780F0A0C0E4354000000003C010000001000020002E200
CC0124FFFFFFFFFFFF4354000000003D010000001000010C000000000000FFFFFFFFFFFF0DD7FEFEFEFEFEFEFEAAEE7DFA7DAF5FAA5FAE5DAE5FAF57BB550000
And both the DMXit Discovery CMD and the RDMserial Test repeat endlessly.
When I
uncomment the same code I get something like
CC0124FFFFFFFFFFFF43540000000048010000001000010C000000000000FFFFFFFFFFFF0DE2FEFEFEFEFEFEFEAAEE7DFA7DAF5FAA5FAE5DAE5FAF57BB550000
CC01186C780F0A0C0E43540000000049010000001000020002EF00
after which DIRECTION_PIN remains HIGH and nothing happens.
I've managed to get RDMDeviceTest_SAMD21 running as .cpp on PlatformIO, and its a lot easier to jump around to all the code, I'm rechecking the DIRECTION_PIN function as PIO caught an error that Arduino IDE did not.
// ***************** input callback function *************
void gotDMXCallback(int slots) {
got_dmx = slots;
}
void gotRDMCallback(int len) {
// rdm start code and checksum are validated before this is called
got_rdm = len;
}
was not in the correct place - due to my own mistake. However, PIO is reporting an error here
SAMD21DMX.setDataReceivedCallback(&gotDMXCallback); //gotDMXCallback this is defined
SAMD21DMX.setRDMReceivedCallback(&gotRDMCallback); // <-- error identifier "gotRDMCallback" is undefinedC/C++(20)
Yet I can see it is defined in the code, as can you. I tried changing
(int len) to
(int RDMlen) as len is a common variable name in string maniputlation. For what its worth, in PIO, (int slots), the word slots is light blue, yet (int len) is white. I'll try to post a pix. The code compiles, even with this error, but maybe its part of the problem.

- RDMcallbackError.jpg (147.45 KiB) Viewed 63246 times