Page 1 of 1

Generate NMRA DCC Wave Form Using ESP32

Posted: Thu Feb 22, 2018 8:14 pm
by densha
Hi Forum

I am learning how to program on the ESP32. I would like to implement the NMRA DCC Protocol https://en.wikipedia.org/wiki/Digital_Command_Control using the ESP32. Basically the DCC protocol can be used to control the model train speed and direction by varying the period of the voltage is applied to the railway track. This voltage is a variations is used to encode a data signal that is decoded by a decoder in the model train. To represent a binary one a nominally 58 µs half cycle, while a zero is represented by a nominally at least 100 µs half cycle.

I have used PWM signal to control power to motors previously, however the NRMA signalis very different.

Could someone suggest approaches I should review to implement a NRMA signal generator on ESP32/

Thanks

Densha

Re: Generate NMRA DCC Wave Form Using ESP32

Posted: Sat Feb 24, 2018 3:39 am
by ESP_Sprite
I would use the RMT peripheral; it is very well-suited to generating these types of signals.

Re: Generate NMRA DCC Wave Form Using ESP32

Posted: Sat Feb 24, 2018 8:41 am
by densha
Thanks - I'll have a look at RMT. I have not come across that yet.

Could you suggest any examples generating a PWM or motor control signal I can learn from?

Thanks

Densha

Re: Generate NMRA DCC Wave Form Using ESP32

Posted: Mon Feb 26, 2018 5:39 am
by ESP_Sprite
Not sure - if you haven't done it, please at least have a look in the examples directory of esp-idf, if any it shows you how you can use the peripheral drivers.