Microcontroller: Attiny12
Goal: Want to blink two LEDs
Issue #1: Output pins aren't working (seem to be floating)....FIXED
Issue #2: LEDs won't blink (on 100% of time)
Programmer: AVRisp MkII
Compiler: GCC/Win-AVR
IDE: AVR Studio 4, Version 4.15
Updated Feb 9, 2009:
I hooked LEDs up to PORTB3 and PORTB4, and they won't blink like they should. The LEDs are on 100% of the time.
I've successfully used this code on an ATmega32. Why won't it work for an Attiny12?
Here's my code:
#include#include int main(void) { int refreshRate = 1000; DDRB = 0b11111111; PORTB = 0b00000000; //Just initializes PORTB output logical zero while(1) //This is a forever while loop { PORTB = 0b00001000; _delay_ms(refreshRate); PORTB = 0b00010000; _delay_ms(refreshRate); } return 1; }
Any suggestions? Thanks in advance!!!