Wednesday, October 29, 2008

Faculty License project

"Simulation of an Artificial Horizon system necessary for aircraft piloting" This long and pompous title is the name of my License Project. More news to come after I finish my current Etch a Sketch project, all I can say is that it is going to prove quite a challenge...

Saturday, October 25, 2008

Should I give OpenGL a chance?

Because of a school project, I am compelled to learn OpenGL. I think that it could serve my purposes just fine for this particular project, but as I will progress with more daring projects, which I hope will involve quite a bit of physics, OpenGL will not be a viable solution.

As a side note, I have come up with several other fun applications for this gizmo I am building, for example I could control a game of classic PONG.

Final module is in

I've done it! The nasty part of this project is finally over. I mean the hardware part, the part where I have practically no experience. The board was completed Friday night, today I have tested it with my Win32 Library that I have written a while back. I still have to level out some bugs, but in general it works decent.

Here is a look at how it looks like completely assembled:


And now a back-side view:


Next I must eliminate all the bugs, make the embedded PIC C code as efficient as possible, and then start to write the game using Irrlicht of OPENGL(maybe a new post will follow about my change of heart)

Saturday, October 18, 2008

Serial Module

This week I had the task of soldering the Serial Module to my board.
The serial module consists of the following:

  • Max232 IC
  • 3 1uF capacitors
  • Db9 Serial connector
Things did not go smoothly, but in the end I managed to pull it off. Below is a picture of the finished module:

Now, a short description of why I need MAX232 and how it works. This IC (integrated circuit) converts TTL/CMOS voltage levels for 1 and 0 to RS-232 voltage levels. Here is a quick comparison to show you what I mean : "1" in TTL is roughly 5V, and 11V in RS-232, while "0" in TTL is 0V and -11V in RS-232. When I add the fact that my PIC16F870 knows only TTL voltage levels and any computer knows only RS-232 when it comes to simple serial communication, you understand the need for such a IC.

It works by the aid of 3 charge pumps, which in our case are 3 1uF capacitors, one for the internal voltage doubler, one for the voltage inverter and the last is placed in my case, between the +10V pin and the 5V rail of the board. All is made even clearer by the datasheet.

I tested this module by connecting the board to my computer, to COM1, fired up Hyperterminal, and joined pins 11 and 12 of MAX232 IC, essentially making a loop back, the bytes sent from the computer where converted to TTL levels, and then converted back (pins 11 and 12) to Rs232 levels, then sent back to the computer. It worked fine as I could see the characters I inputted in the terminal where bouncing back on the screen. Job done!

I have only the main microcontroller part to solder on and the eureka moment is finally approaching. Happy me!!

Sunday, October 12, 2008

First module

Today I have soldered the first module, the voltage regulator.



You can see the pre-drilled holes where the linear potentiometers will be, and the Db9 connector is only glued, but not soldered. That is because there is no direct way to solder that connector to a perf board, the pins do not match the holes, so I bent an entire row of pins which are not used by our application. Soldering of this piece will proceed shortly.

Saturday, October 11, 2008

A little shopping

Time for a new post. After a long week at work, I finally managed to write to you again. I finished designing the board, and I also found the time to buy all my necessary parts.

Basically, there are 3 separate modules that come together to form a single unit.First you have a Voltage regulator module, that converts 9V of unregulated voltage and delivers 5V of regulated voltage. Since a microcontroller is very sensible about unstable voltages, this module is very important. Here is a list of parts and a picture of it:

  1. 1 Jack
  2. 1 Diode 1N4007
  3. 1 Voltage regulator LM7805
  4. 2 Capacitors (100 uF and 10 uF)
  5. 1 Switch
  6. 1 330 ohm resistor
  7. 1 LED
Next there is the Microcontroller module, which mainly consists of a 28 pin Socket, where we will place the PIC16F870, the timing circuit for the micro, and the 2 Linear potentiometers which will guide the cursor on our computer monitor. Parts needded:

  1. 1 28 pin microcontroller socket
  2. 1 4 Mhz quartz oscillator
  3. 2 15pF capacitors (as stated in the micro datasheet)
  4. 2 10Kohm linear potentiometers

Next we must deal with the serial module, this is type part of the board that ensures the communication with the computer via a serial cable. Parts we need:

  1. 1 DB9 serial connector
  2. 1 MAX232 IC
  3. At least 3 1uF capacitors (to act as charge pumps for the MAX232 IC)
  4. 1 Male to Female serial cable
In addition we must have a perforated board of about 10cm x 10cm, and a bunch of insulated wires, to make the necessary connection on the board.


Sunday, October 5, 2008

Necesary tools and progress check

Time for a progress check. After trying to write the code in assembler, I realized that I should let my ego have a break and try to find a free C compiler for my PIC.

I am perfectly aware that eventually I could have written the code in asm, but also I would have wasted a lot of time, time which I can use for some other tasks. I fired up good old Google, and did a search on free PIC C compilers. After some reading, I decided to use CC5X free PIC compiler, probably the first ever created. It even integrates itself into MPLAB, which is great, perfect for what I need.

Another quintessential tool is Oshon Soft PicSimulator. It is an amazing software, allowing you to see what your code can do and so many things, until know everything that worked on the simulator, worked the same on the actual microcontroller.

This is how I spent my day, and by the end of it, I had a working program.

I will elaborate further on in my posts about the innerworkings of my Etch a Sketch design. including the hardware and software side.