The Electronics
PIC Programming
The first challenge I had building the Scalextric Power Base according to the Electric Images' blue prints was to get all the components and to "burn" the program into the PIC18F2550 processor. I thought it's best to buy just the PIC to start with and try to get it working. I found a test circuit board I created in vocational school for a PIC16F84 processor and thought that it must somehow be possible to use the Ludipipo/JDM programmer on it, even if it's as simple as a programmer can be (only three resistors and a diode). Because the test board was designed for a much smaller PIC than the 18F2550 didn't of course fit, so I taped a breadboard onto one side of the test board and connected power and data to it (see pic).I had a very tough time getting the programmer to work with the PIC, I almost gave up. I probably tinkered with it for like 4 months! before I got it to work (but don't think I'm that crazy that sat every evening with it, after all it was summer so in total it took me perhaps one or two weeks worth of evenings). On the same time, I got to blow some dust off my rusty electronic knowledge.
The trick that finally made it work was found here, a short but very important notice about a low pass filter on the data line that decouples them from high frequent noise.
After I got the programmer to work, I burned a bootloader (such as the one described in this blog post) into the device to be able to program it via the USB interface instead of using the troublesome serial port. When the USB programming went smooth, I could concentrate on the program itself. It took some trial and error before I understood how the MPLAB IDE and the C18 compiler worked, and I didn't of course want to ruin the bootloader that I finally got into the PIC, which of course required some extra fiddling with linker scripts.
Circuit Board
Now that I got something into the PIC, the next step was to try getting all the required components for the power base. After trying hard to find a place selling the BTS7960B half bridge IC on the net I realized that it is discontinued and is replaced with another one, called BTN7960B. This made it a little bit easier as I now found it on digi-key. While waiting for the components to arrive from the states, I begun designing the more permanent stripboard on which the circuit would sit.To do this I used an application called VeeCAD, which makes the design phase much easier than trying to figure out a working design on the physical board itself.
Download the VeeCAD file here
When I had all the components that I needed and the design was completed I soldered it all together and tried it out using a car directly connected to the output, and to my big surprise it worked the first time!!
When I later connected the power base to the track and added a lane changer (LC) to the game, some bug/design flaw appeared. When the car moved over the IR-sensor of the LC, the car stopped and the LC made some strange noise. Read more about the problem at SlotForum. I still haven't fix the root problem, but found a workaround (described in the forum thread).