Wolferl UAVP Software or How do I program a PIC?!
Created by Amir on the 23. Mar 2007 at 14:45 in UAVP | Permalink

I already talked about different implementations of UAVPs. One of them, the Wolferl-Board, is a UAVP built by Wolfang Mahringer, one of the pioneers of QuadCopters. Wolfgang succeeded in building a successful flying UAVP closed-loop control already back in January 2006.

The following picture shows Hammer's QuadCopter using a Wolferl-Board:

Wolfgang continuously extended and improved his board design troughout the last year and it's now a very reliable base platform for building an UAVP. Many successful flying UAVP are built usinging a Wolferl-Board as base.

The day before yesterday I wrote a mail to Wolfgang asking if I could receive a copy of the software which runs on a PIC microcontroller in the center of the board. I could not belive it, but already some hours later I received the source code (version 3.05) from Wolfgang!

Thank you Wolfgang! For the great work you did, for the source code, for making it Open Source and available to everyone!

The big black chip in the center is the 8bit microcontroller PIC 16F876 built by the company Microchip. Note that it has a 8bit data bus but 12bit code and address bus which is a bit special.

The PIC16F876A features 256 bytes of EEPROM data memory, self programming, an ICD, 2 Comparators, 5 channels of 10-bit Analog-to-Digital (A/D) converter, 2 capture/compare/PWM functions, the synchronous serial port can be configured as either 3-wire Serial Peripheral Interface (SPI) or the 2-wire Inter-Integrated Circuit (I2C) bus and a Universal Asynchronous Receiver Transmitter (USART). It can be programmed in C and all needed development tools are free of charge which is something which suits me very well.

Dear interested reader, this is the thingy which runs the C source code I've received from Wolfgang. The code gets compiled into a .HEX file which then can be programmed into the PIC.

Looking into the code I realized that I got quite a nice bit of software here. Wolfgang's code is good documented and has a README explaining how to setup the free IDE MPLAB and the CC5X compiler needed to generate code for the PIC. The compiler integrates nicly with the IDE.

Wolfgang also wrote a very nice PDF documentation how to build a Wolferl-Board. This document contains plans, layouts and everything needed to build a Wolferl-Board by yourself.

Digging the code I realized that the code contained a command interface implemented using the serial console on the board which I understud quite easily. Using that serial console you can send commands to the board and control certain aspects and parameters of the closed-circuit loop. Soon I realized that it would be quite easy to extend this command interface with new commands.

I decided to implement new commands to continously monitor all sensor and actor data using the serial port. Furthermore I wanted to implement another command using which the 4 motors of the QuadCopter can be remotly controlled. This is exactly what David, who is an UAVP enhusiast also, chatted about on IRC last week.

I started last night and in the morning around 0500 I could compile the code on my own box and understud how to add new commands. It's now work in progress, but I think it won't take too long to finish...

Expect more information about this project soon...

Amir Guindehi's Blog

Bits and pieces of my digital life...