Sunday 20 February 2011

Circuit design program - KICAD

As described in the last post, I started by wanting to display a decent circuit diagram for the circuit I had working back in July 2009, before I start to figure out what to do and where to go with the system.  This way I will at least have a record of all that work I did two years ago before I take it apart to try and figure out what everything means!


So I found what appears to be a promising Open Source GPL software package called "KICAD".  Now I've not used many CAD programs before, and I think the software used at University was something like "Rational Rose", however since I only used that very briefly I don't really have much of a working knowledge about how Circuit designers work.  Like most open source software though I have to admit that I am expecting a steep learning curve, (since the app programmers tend to be busy writing code to do what they want, and they tend not to be that great at User interface design, at least that's how I tend to program when writing open source software anyway and how most other GPL software I've seen tends to be laid out).

The KICAD download is actually a decent size, (~100 MB), and the screen shots on the base web page all look rather impressive.  After downloading the Windows version for my laptop, the installation was pretty easy, (next...next...next), the final screen did provide a link to a 3D app required to show electronic components, but since I'm not interested in that right now I thought I'd skip that for now, I can always do that later.

Running the main program creates a base project in the application program files directory... So the first thing I did was a file-new to create a project in a directory I much prefer, (under  My Documents).  Shame that the app doesn't default to the documents or application work directories, but not exactly a problem!

Since I'm wanting to create a Circuit Schematic I guess I need to click the EESchema Editor button...  And since I want to start with a PIC18F2455, I guess we should start there... So where's that Add component button... ahh yes a tiny button on the right of the screen...

Searching the component list for "PIC" there are three PIC components listed, none of which are the one I need.  So then how do I create a new component for the processor I want...

The Component Library Editor looks like it may be what I want...  Some help file searching, (a nice long descriptive PDF file, but unfortunately no nice index), shows that if you want a line over the top of a pin the pin must start with "~"...  No initial idea how to draw the Pin however... Ahh a "Place" menu option allowing the placement of a Pin...  So Pin 1 on the PIC 18F2455 is described as "MCLR/Vpp/RE3" with the MCLR having a line over the top, but a ~ puts a line over the whole pin description...  Ahh cool a second ~ ends the line over the top of the pin, that's good!

I think I'm getting the hang of this editing components stuff... Added 28 pins, and set what appears to be the correct text labels as listed by the microprocessor PDF specification file...  I can't seem to find a method of sub-scripting text which would be useful.  It'd also be nice if pressing enter on the pin entry window would close the window, (Ok button being the form default button).



So exiting the editor and going back to the Schema editor I added a component, I entered PID and pressed enter, (previously I'd clicked the "Search by Keyword" function)...  Annoyingly a new list of PIC processors opened up...  There were only two 18F diagrams, however annoyingly they included the PIC18F2550 which is the 32K version of the one I did above.  Also while I had assumed the pin outs should all be displayed in pin order like on the chip, the sample actually includes the outputs on one side organised into 8-bit entries, which is a lot more useful for seeing what is happening.

So using the original library chip I'll start creating that circuit diagram...

After playing around a little bit, I have to admit it is a little more intuitive than I expected, however that isn't stopping me from having a load of learning curve issues... Like how do I add a resistor... Turns out I add a component and type in "R".  A capacitor is "C", the crystal appears to be "Crystal", although I'm not certail I have the right symbol really.  Adding a Ground connection then it is adding a power component "GND".

When selecting multiple items by drag-selecting a selection box over items, all items covered are selected.  Push CTRL at the same time and only the end points covered are selected, (allowing componenets to be moved while keeping connections to other wires).  SHIFT-Selecting makes a copy of what is covered.

One thing which bugs me quite a bit is that I keep rolling my mouse wheel trying to move up or down the page, however instead it zooms in, CTRL/SHIFT can be used with the wheel to scroll sideways/updown.

I'm actually not sure which crystal I bought two years ago... Looking at the specification sheet, and also based on the capacitor values I'm using, I think it must be an 8MHz Crystal resonator...

Looking at the connections I put into the MCLR pin, it reminds me that I don't have a set of any Diodes, (well other than led's)...  Not sure if I need them, or why I have the connections set around the MCLR pin, I guess it was needed to run the system from an external power source.

Anyway after a good few hours working on it, spending some time re-accustomizing myself with some things like how to tell what resistance a resistor is, and searching for and re-reading through various specifications and help files about the Chip, LCD screen, PICkit 2 and the KICAD application help file...  Here's what I think my last circuit looks like, (remember it may not be the best circuit I am still really a beginner here).



I guess I'm failing miserably to help anyone who doesn't know much about electronics... Ahh well with luck, my progress or lack of progress will perhaps be able to help someone one day who knows enough to want to know a few pitfalls I've made...  Never mind, maybe one day I can use all this as a base to a book, although I have a feeling that is a wild dream that will never happen.

Anyway in summary about KICAD... Well it looks good, it has a number of oddities which took a while to get used to, but for an open-source app I actually think it is pretty good.  I'm considering it good enough though that for the moment I'm not going to look for any other circuit schematic designer for a while anyway.

No comments:

Post a Comment