Threw together an ATTiny ISP shield - Page 1
Forum section: electronics / projects

author: rrinker
author_rank: Super Contributor
timestamp: November 16, 2016, 01:20:06 am
content: Since I am going to be using a lot of ATTiny 85's in my model railroad electronics, I went whole hog (sort of) and built up a shield using the full Arduino ISP circuit with the indicator LEDs and all.Nothing fancy, just point to point wiring. ISP lines to the socket, yellow LED indicates the programmer is running, red is for errors, and the green flashes while programming is taking place. The clear LED under the socket is actually a blue one, wired to Arduino I/O pin 3 (chip pin 2) so I can run a blink sketch to test them as I go.

author: MarkF
author_rank: Super Contributor
timestamp: November 16, 2016, 03:04:43 am
content: I'm building an interface to my HO railroad also. I still need a few parts to finish one of each board type and begin the final testing phase.I decided to use the old track blocks because DCC prevented a few locomotives that I want to use on the layout.I'm using Microchip PIC processors instead of Arduino. My design criteria are:- Track block power with the capability to output a 0 to 14V DC level or a PWM waveform with selectable pulse amplitude. (PWM is to provide slow speed and start performance.)- Automatic fault (block short) detection.- Relay drivers for turnout control.- Sensor inputs for block occupancy detection.Looks like you're going down a similar path that I have?

author: rrinker
author_rank: Super Contributor
timestamp: November 16, 2016, 01:41:06 pm
content: Sort of, but I am using DCC. I have only a couple of nostalgia pieces that aren't easy to convert, the stuff I have fitting my era and railroad are all DCC already. And really, I think the only one that would be right up there with impossible to convert is an old Hornby Stephenson's Rocket. Effectively the motor IS the loco so there's not even any way to cut into the electrical path.I gave up on Tortoise switch motors a few years ago when I discovered how cheap even commercially available servo controllers were - total package for a controller with pushbuttons, indicator LEDs, AND a DCC decoder built in, plus the servo itself, came in at less than just a Tortoise motor WITHOUT a controlling toggle or LEDs. While my ATTiny85 unit won't have a DCC decoder built in (though if I gave up the centering jumper, technically I could add the circuitry), it will drive 2 servos and cost about $5 in parts. Plus the Tinys will be good for structure lighting - multiple rooms independently lit up with some randomized turning on and off of the lights. So I'll probably be programming multiple dozens of them, which is why I built up this programmer instead of just wiring it on a breadboard like I did to test the first couple.My signal and detection system will use Arduino Nanos plus shift registers to get extra I/O ports. It's loosely based on the Chubb CMRI at least as far as comm protocol between each controller and the computer, although I am simplifying it a bit by doing things like having a fixed message length - doesn't matter if a given controller is using 32 bits of I/O or 48 bits, they all get 64 bits worth of data, so I don't have to do as much data decoding. I'm writing the control software myself, at first just emulating a CTC machine, but my long term goal is to have a physical machine for the dispatcher to operate with the computer tucked away just doing the logic calculations.

author: MarkF
author_rank: Super Contributor
timestamp: November 16, 2016, 07:58:49 pm
content: This little Gandy Dancer moved me away from DCC.My layout is centered around coal mining and steam. The current addressing scheme of my interface provides 30 analog outputs (track blocks), 45 relay drivers and 45 sensors under direct PC control. I'm using nRF24L01 transceivers to implement wireless throttle controllers.Do all of your ATTiny units operate independently? If not, how do you communicate with them?

author: rrinker
author_rank: Super Contributor
timestamp: November 16, 2016, 08:30:17 pm
content: In areas with just local control, like the main yard, the ATTiny units will be fed with pushbuttons. In dispatcher controlled areas, they will be fed with lines from the Nano-based controllers.Then the Uno units communicate to the main computer with RS-485 (using quarter load chips so I can have enough stations) using a modified CMRI protocol.That Gandy Dance may be small (though interesting, it's kind of oversized) but I've seen DCC and SOUND installs in the Grandt Line GE 25 ton boxcab - NOT MU, a single standalone unit. Which is sort of a goal of mine because I have coal and cement traffic on my layout and one of the local cement mills had at least one of them as a plant switcher, and I have a very nice hi res photo of it. Cerulean blue with white lettering and then basically washed all over with grey cement dust.