Saturday, August 24, 2013

PCB Design Goofs and fixing them

As mentioned in a previous blog, the PCB I designed and ordered from Itead arrived and I started assembling it. Once I got going, I discovered a few problems. Itead did its job immaculately but I managed to make quite a few mistakes - some big, some small. Some involved just fixing the design, some involved tweaking the KiCAD library. I am continuing to test the board and am likely to find a few more. Once all the circuit bugs are ironed out, I can order a fresh set.
One of the great things about KiCAD is all its files are in text format. This allows me to look at and fix things without trying to find a parameter in a dialog box.

Thursday, August 22, 2013

A Plastic Sanga Case for my PCB

Soon after ordering the PCB, I came across Seeed Studio’s acrylic laser cutting service. Once the PCB is assembled and tested, it would be nice to have an acrylic case for it.

The current trend for acrylic cases is the plastic sanga. The other option is the case put together with slots and screws. I don’t much like this look so I opted for the plastic sanga.

Ordering PCBs from Itead Studio

The last time I designed and got a PCB ordered was in 2010 and it cost $125 for 5 pieces. As expected, there were a few mistakes in the PCB design and a second batch never got designed.

This time around I found that there were other sources more suitable for hobbyists. The widely mentioned ones were Seeed and Itead. They offered what appeared to be a 50x50mm PCB for $10 which seemed reasonable. But, no, it turned out it was $10 for 10 PCBs! That is like a buck a PCB. This changed the entire way I looked at PCBs.

Monday, July 8, 2013

An Interrupt based DCC Decoder

In the early days of DIY DCC decoders, the preferred method of DCC decoding logic was to write precisely metered sections of hand-written assembly code that sampled the DCC input. These were based on the venerable 16C84 running at 4MHz.

But with modern PICs running at 32 MHz and over, it is possible to write an interrupt driven DCC decoder. This means no more intricately hand-coded assembly. You could write it in C without worrying too much about the code generated - within reason. So what is a good interrupt period to sample the DCC input? OK, 22us. But how accurate does this period have to be? Can we use the internal oscillator in a PIC? Yes, we can!

Saturday, July 6, 2013

A Small N Scale Layout

My previous layout was simple dog-bone that was 2800x460mm to fit on top of a wall unit. This time around I had much less space – 1200x600mm. The old one was well above eye level and most of the layout was out of sight. This time it is just 60mm off the floor and the whole layout can be sighted.

It is not based on any prototype. Truth be told, it is a test bed for my DCC project so all I wanted is enough complexity in this small space. In order to provide this complexity, I have pushed the specs up to and, possibly, beyond the edges of sanity. Future operations will tell if this was a wise decision.

Sunday, June 9, 2013

IR Interface for an Ethernet SBC

In a previous blog, we looked at a range of ethernet based SBCs. We have also been looking at various IR Remote Control signals. The next step is to bring the two together - to build a circuit to send and receive IR signals using an ethernet based SBC. This blog describes a small bit of hardware added to the SBC to do this.

IR Firmware for the PIC 18F

Almost every one of my designs involves a periodic timer interrupt. This is used for all timing. For the IR receive, the input may have to be sampled every 25 us. This is a very short interrupt period. For an IR send, the input has to be toggled every 12.5 us. This is just not practical.

It was time to explore some of the features of the PIC 18F that I had long ignored. One was the PWM feature which was used to do the IR send. The other was CCP that was used to do the IR Receive. The hardware used has been described in a previous blog.