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.

Using the Microchip TCP/IP stack on Olimex SBCs

To build a web server application on an Olimex Ethernet SBC, you have to download the Olimex version of the Microchip TCP/IP stack and modify it. To get started with it, as a first step, I got rid of files that I don't need for implementing a web server. The Microchip stack uses a ~ variable embedded in HTML pages to serve your custom information on a web page.

Wednesday, May 15, 2013

Web front-end for an ethernet PIC SBC

I now have a basic web interface with a PIC SBC. It uses ajax to get simple text based information back and forth between the SBC and the browser. This blog looks at building the web front-end to interact with the SBC in a more user-friendly way.
With the limited resources of a PIC, it makes sense to move all the user interface logic to the browser. This will leave just the bare functions within the PIC while still having a reasonably rich UI. Nothing beats understanding a UI by trying it out. Use a dummy version of it to see how it works and study the associated HTML and javascript to explore its inner workings.

Sunday, May 12, 2013

Web Interface for an ethernet based IR Interface

In the past few blogs, we looked at implementing an IR remote control interface on an ethernet SBC. We also looked at how records can be stored on the EEPROM on the SBC. Now we look at the web interface required to use the SBC as an IR remote control.

Implementing EEPROM Storage

In a previous blog, we looked at how you can store a bunch of records of varying types but all of fixed length in an EEPROM on an Olimex ethernet SBC. Now let us take a real world example, well, my world anyway, and store that in an EEPROM. As it is on an ethernet SBC, we will also write code to allow the records to be stored and received using a browser. The data to be stored is the IR signals required to control one or more audio or video components like TVs, DVD Players, etc.

Saturday, May 4, 2013

Storing records on a PIC web server

In a previous blog, I looked at using the TCP/IP stack on an Olimex PIC SBC to implement a web server. In this blog, I look at storing and retrieving data on the EEPROM on the SBC. My data is a collection of records of different types. The SBC in use, the Olimex PIC-WEB SBC, uses an Atmel AT45DB011. This chip has its idiosyncrasies that the storage process takes advantage of.

Tuesday, April 9, 2013

From HDD to SSD - tuning the SSD

This is a summary of the steps to move from an HDD to an SSD based on what worked for me. To round it off, here are also some steps to be taken afterwards to tune your system better for an SSD.
My situation is as follows:
  • The laptop is an HP Envy15-3012TX running Windows 7 Home Premium
  • The disk uses a Dynamic MBR, complicating matters
  • There are a few 'hidden' partitions holding the recovery software that need to be transferred as well
  • The HDD (750GB) is much bigger than the SSD (250GB), which means partitions have to be shrunk and moved
  • Recovery and repair disks are not available

From HDD to SSD - the mechanical bit

After the various attempts to clone my HDD to a new SDD worked, the next step was to physically pull out the HDD and install the SDD. This is an HP Envy15 (Model 15-3012TX) we are talking about. It is a bit weird - you actually need a Torx screwdriver just to change the battery. But when it comes to the HDD, it isn't too bad. The battery might be held with Torx T8 screws but all you need to pull out the HDD is a PH0 Phillips screwdriver.

Wednesday, April 3, 2013

From HDD to SSD - a traveller's travails

It had been a while since I have had my laptop and I thought now would be a good time to upgrade the HDD to one of those new fangled SSDs. Sucker!
This is not a step by step procedure of how to manage the transition from an HDD to an SSD. It is more about the problems I faced doing it. It may help those who hit the same problems. For the record, I did manage to overcome all issues and am now posting from my upgraded laptop.