Embedded Freaks..

February 10, 2009

FreeRTOS for ATMega128

Filed under: avr — Tags: — kunilkuda @ 12:01 pm

FreeRTOS is free open source RTOS that supports several architectures. You can get its source code here. This post is my port for my ATMega128 board. It may run on your board (or may not). (more…)

November 17, 2008

Composite Pattern for C (AVR-GCC)

Filed under: avr, programming-tips — Tags: , — kunilkuda @ 5:41 pm

In java, you can have composite pattern easily using interface, like this:

Animal[] animals = new Animal[] { new Elephant(), new Cow(), new Cat() };
for(Animal currAnimal : animals) {
  // Do the stuff here
}

Now, I want to have the same thing for serial RX interrupt in AVR. Something like this:

ISR(USART0_RX_vect) {
  uint8_t data = UDR0;
  for(InterruptHandler currHandler: interruptHandlers) {
    currHandler.handle(data);
  }
}

By that way, I can chain the interrupt handler easily. Of course, mixing C and Java in C-compiler won’t be OK for AVR-GCC. But I found out some way to do the similar thing in C.

(more…)

November 11, 2008

Simple AT Parser for AVR

Filed under: avr — Tags: — kunilkuda @ 10:06 am

After some failure with the direct translation of Java simple AT parser to AVR-GCC, I’ve come out with new design of AT parser, special for AVR.

It’s not complete yet, but I can use it to setup the modem, and send the SMS. I hope I can do more with it soon. Here’s the link of my source code.

Older Posts »