Saturday, July 26, 2008

Using only AVR to produce both Video & Sound

The device is called "Craft" by www.linusakesson.net, it used only one ATmega88 to producce both video & sound on the TV. The animation is awesome, please take a look:


Thursday, July 24, 2008

Nixie Tube Clock.

I always want to build a nixie clock, but it is difficult to find the nixie tube and also the tube driver ICs. The kit available on the internet is still expensive for me.

Here is a cool video of nixie tube filling with blue led, it becomes more attractive!

Sunday, July 6, 2008

CTC mode on Tiny13

There are two OC0A and OC0B compare outputs in Tiny13. It is useful to generate waveform . In this example, we use OC0A to output a square wave to blink the LED which is very similar to the previous timer interrupt example instead the output is generate inside Tiny13 but not our interrupt routine.

int main (void)
{
b0_output; //OC0A as led output

TCCR0B = 0x03; //select timer clkio/64

TCCR0A = (0x01)<<6 | 0x02; // Toggle OC0A | CTC MODE
TCNT0 = 0x0; //starting couter value

OCR0A = 0x7F; //around frequency @ 2.2HZ

//make the clk cpu slower
CLKPR = 1<<CLKPCE; //tell cpu to update the CLKPR

CLKPR = 0x8; //clkio = clkcpu/256


while(1) {
;; //interrupt do the rest
}
}

We set the output to be toggled every time the counter value match our OCR0A value. Thus, a square wave is generated:



The complete project can be found here: http://labs.bitartist.org/compare_int.tar.gz

Timer interrupt on Tiny13

Sometimes we have to do somethings in certain period, so timer may be useful for you.
AVR tiny13 have one timer and it count until to 0xFF value for each clock. An interrupt will be then generated and call your interrupt routine.

In our example, we have the following interrupt routine:

ISR(TIM0_OVF_vect) {
if (led){
b0_high;
led = 0;
} else {
b0_low;
led = 1;
}
}


This routine is used to toggle the LED On or Off.

The complete project code can be found here: http://labs.bitartist.org/timer_int.tar.gz