Skip to content

mikechristle/DCC_Monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DCC Signal Monitor

This program will capture and display DCC messages off the tracks. It will capture all messages, or filter messages with a specific address. Filtering only works with addresses in the range 0-127.

Copy the main.py and dcc_capture.py files to the pico module, then cycle power. I use putty to communicate with the module so I can save messages to a log file.

Files

main.py

This is the program main. It sets which GPIO pins are used. It has a callback function to receive messages from dcc_capture.py. It handles address filtering and display.

dcc_capture.py

The DCC_Capture class contains a PIO routine to decode the DCC signal. Data bytes are written to the fifo and a interrupt is generates at the end of each message. A DMA controller copies the data to a buffer. An IRQ routine copies the message data, adds a timestamp, then calls a user callback function. The timestamp is in units of milliseconds.

schematic.pdf

This is the circuit I used to read the signal from the tracks. Please note, component selection was influenced by the contents of my spare parts bin.

Files for unit testing

dcc_generate.py

This class generates a DCC signal for testing of the DCC_Capture class.

dcc_test_main.py

This is the main program that controls a loopback test.

About

Capture and display messages from a DCC model train track.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages