I'm a complete beginner in microprocessor programming. I managed to program my ATtiny25-20PU with AtmelStudio 7 and an AVR-ISP-MkII. However, I don't get any output on my output pins!
The ATtiny is new and never used before. I'm pretty sure that the programming worked, since device signature could be read and the programmer could verify the program. So I think the problem is in my simple program or in my even simpler circuit. I've never done this before and maybe missed something obvious?
The entire circuit (when testing, after programming) was:
- Connect VCC to 5V.
- Connect GND to ground.
- Connect RESET to ground for a while, then connect it to VCC. I also tried doing this using a button but observed no difference.
But PB3 and PB4 are low all the time! This is the program:
#define F_CPU 1000000UL
#include <avr/io.h>
#include <util/delay.h>
int main(void) {
DDRB |= 1<<PB4;
while (1)
{
DDRB |= 1<<PB3;
_delay_ms(200);
DDRB &= ~(1<<PB3);
_delay_ms(200);
}
}
So I'm expecting PB3 to go high and PB4 to give a square wave. What can I do to keep troubleshooting? Or verify that I actually managed to program the ATtiny? I'm completely stuck.