Wednesday, August 31, 2011

Power & IO PCB for Attitude System (Thesis)

Over the last couple of days I did another module for the attitude system stack. The last one I did was the uC PCB, which won't be used in the final system, due to its low processing power. This  new power and IO will be part of the final system, as it will take care of the external power and interface convertion.

First of all, the PCB takes power and regulates the voltage down to 1.8V, 3.3V, and 5V for all the sensors and uC/FPGA. I was a little unsure of wether I should put in a bridge rectifier on the power input, to make sure the polarity would always be correct. In the end I skipped it. Secondly the PCB has a USART signal converter for external I/O, together with a 9 pin DSUB-F connector. This  is my primary interface.

I also put on a RJ45 socket, in case I also implement an  ethernet interface, but with just a simple 2x4 header.

Finally I have to commend the guys at iTead Studio for their excellent service. I was very pleased with the last batch of PCBs they made for me, at a price you just can't beat. But this time they kindly pointed out to me that I was missing two drill holes for the RJ45 socket (see picture). That is just awesome! Thank you!! The error was due to the way STARCAD was set up not to include non plated drill holes in the drill file. Quickly fixed, and updated files sent away. Now for the waiting part ;-)


Friday, August 26, 2011

Software Decoder for Attitude System (Thesis)

I thought it might be easier to code a program in a computer, rather than in a microcontroller or FPGA. The idea is to transfer the selected algorithm at a later stage, when I have a better understandig of the calculations involved.

At the moment, the program reads the data strings from the serial port and then parses the data. The program then optionally applies bias and converts the raw data to real values. I also quickly threw together a simple PID algorithm to give me an idea of the data I'm getting.

I will later implement proper algorithms, I just need to get my head around some heavy maths first.

I also plan to implement a charting / visualising option, and the ability to log various data to disk.


Thursday, August 11, 2011

Microcontroller PCB for Attitude System (Thesis) - Part V

So I did some changes to the uC firmware, so there is no preformating. I also replaced gcc's dtostr function with my own code, as it was eating up allot of space. All output is now 16 bit signed, and I also saved about 30% program space. I can also shave of some of the RAM, but I'm not using much anyway. I should have put some of my code into procedures, but I'm going to focus on developing the PC side app.

I'm going to use Lazarus IDE, which is based on free-pascal, which is GNU. At the moment I have been using 32 bit XP, but I hope the switch to 64 bit W7 will be painless.

I'm closing this post with a sample of the raw serial output from the uC, as it appears on the PC serial port.


Sunday, August 7, 2011

Microcontroller PCB for Attitude System (Thesis) - IV

Here are all the parts working together. The ISP and USART is connected to the STK600 card, but the new PCB has its own voltage connector, so it can run independently, only I forgot to include the GND pin. Not a problem thought, as there is a spare ground pin.

I'll probably crack on with making a power and interface PCB soon...

I'm happy that both sensors worked fine over the I2C bus, and that the external interrupts worked well. The only issue I had was a stupid naming error declaring the external interrupts as inputs, as the atmega1280 and atmega8 differ slightly.

So next I'll clean up the code slightly, implementing a temperature string among other, and then concentrate on coding a data app in windows.