Model Train Digital Command Control using PRUs on BBB.

Hi Forum

I would like to learn to use the PRUs on the Beaglebone Black. I am thinking to implement the NMRA DCC command protocol using the PRUs. to have a goal.

I would use Linux on the BBB to provide a GUI for a application to control the trains and use the PRU to generate the DCC signal. I would use shared memory from BBB to PRU to update the PRU about the packets to be sent to the track. The PRU would just produce signal based on data passed from the Linux application on the BBB.

The DCC signal is a square form wave with a cycle period of 58us for 1 and approx 100us for 0. I would use PRU0 as a programming track and PRU1 as a live track with an appropriate H-Bridge.

I have been reading the PRU assembly documentation. However I would like guidance on the best way to produce the signal in the PRU?

Should I use the IEP timer or is there a better way? Are there any examples using the clpru compiler for this or should I stick with pasm?

I would like advice on approaches before I start so I learn as much as I can by doing this project.



I think the WS281x LEDs use a similar signaling protocol. Perhaps some of the code in the LEDScape project can help:

It uses pruss, not remoteproc, however. You might want to develop your code to use remoteproc to talk to the PRUs.