NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Microcontroller Programming » POST (power on self test)

March 12, 2010
by treymd
treymd's Avatar

Since I have the habit of trying to do destructive things to the microcontroller, I added a piezo and a short while loop in main before the main loop to beep a couple times indicating a healthy chip (or at least semi-functional)

something like this

main start....

for (i=0; i<100; ++i)
{
    PORTB |= (1<<PB1);
    delay_ms(1);
    PORTB &= ~(1<<PB1);
    delay_ms(1);
}

your infinite while loop....

you would have to of course include libnerdkits delay.h and set PB1 to be an output pin. This is sufficient to produce a beep just before entering your main loop.

March 12, 2010
by treymd
treymd's Avatar

oops, I meant to say I added a for loop for the beep!

Post a Reply

Please log in to post a reply.

Did you know that you can connect to certain car computers via the OBD-II port with a microcontroller? Learn more...