Come join the Darkside Skywalker…..The Switch from PIC to AVR

I’ve been playing around with the Arduino Diecimila and the ATMEGA168 over the last couple of weeks to better familiarise myself with the AVR ATMega168 MCU, I’ve been using PICs on and off the last few years, but the decision was made to use the ATMEGA as the MCU of choice for the Strobit Triggr project, mainly due to the open source tool chains available, and the simply programmer required.

In short I’m glad I’ve made the switch and I must say I’m loving the learning experience.  I’ve moved from the Arduino software development platform as I found it very limiting and am now using the open source avr-gcc (win-avr) and Eclipse, using the AVR plugin and CDT plugin as my development platform of choice, I’m comfortable with eclipse as my editor as I’ve been using this for my Java development for the last 5 or so years.

As a task I set for myself to learn the onboard peripherals,  I’ve created a Weather Shield for the Arduino, so far it has the RFM12B RF module, DS1307 RTC, HH10D Humidity Sensor, a HP03D, combined barometric pressure and temperature sensor, and soon to have a light sensor and Dallas 1-Wire interface for talking to the Dallas Weather Station that I’ve had lying around in a box for the last 10 years, (yes one of the original ones released by Dallas in 1998, I’ve been waiting to move in my house for a long time),  I’ll post the weather shield design up on a separate topic later, but suffice to say, I’ve enjoyed playing with the SPI, I2C, ICP, UART and onboard timers.

Strobit M8 Files

Jans Gentsch has made his compact version of the Strobit Triggr available to the community, his version, the Strobit M08 based on AVR design can be found here.   Please note that there are a couple of things that need doing to the PCB, if you get a chance to implement Jans design, please post back any changes to me so I can make them available.

Hello Stephen,

I’ve attached the Eagle-Design-Data as well as the source code. I haven’t found time to do anything on those since my post, so the are not in the best state. There are a few Problems with the board design:

Transmitter – There is a connection missing between the processor and NIRQ of the transmitter-module (the transmitter module doesn’t have a fifo, so that the nirq-line is needed to clock out the data). I just added a piece of loose wire during assembly.
Receiver – NIRQ isn’t connected as well, so I am constantly polling, not really a power saving design. however I am still running on the first set of batteries so it’s not like they are being drained empty immediatly.
IO-Board – Thr optocoupley was meant to sit on the bottom side but I got confused. It has to sit on top now.

Getting everything into the housing was a major challenge.

The source code has been developed using avr-gcc and the eclipse ide.
As it stands only the most basic function, tiggering, is working. The control flow will have to be reworked in order to add the rest of the functionality. And of course my “magic” trigger id should be changed.

Have fun!

Alle the best
Jan

Files

You will need Eagle PCB to view/edit the schematics and PCB files, found here –http://www.cadsoft.de/

The firmware is written using winavr found here – http://winavr.sourceforge.net/

Interrupts – Steep Learning Curve

Well have the controller setup and have uploaded the demo code, all working 🙂  Now down too some serious work in getting buzzbot connected to the board. 

The Board is based on the AT91SAM7X MPU, of which I have absolutely no experience, so the learning curve begins (right at the bottom).  First thing I want to do is get the interrupts for the two wheel encoders working.  From my initial research I gather that any of the inputs on the GPIO can generate an interrupt on a state change, exactly what I want.  So now more research on how to make it happen using the ARM7 GCC tools I’ve installed, all demo code is compiling and working ok.

Looks like my starting point is some examples found here http://gandalf.arubi.uni-kl.de/avr_projects/arm_projects/index_at91.html