# How can I verify my ATtiny25 programming? Seeing nothing on output pins

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.

• When you program your uC using AtmelStudio, it should tell you the outcome on the screen. Nov 11 '16 at 19:42
• @Naz What do you mean by outcome?
– Anna
Nov 11 '16 at 19:44
• Don't you have a window like this, that tells you the results of the programming process in the left bottom corner? Nov 11 '16 at 20:04
• @Naz I understand, yes, that's what I meant by "the programmer could verify the program". I don't know the right words. This is why I thought the problem was in my circuit or code, and not in the programming. And it was!
– Anna
Nov 11 '16 at 20:07

DDRx sets the direction. PORTx determines the output level and presence of the input pull-up resistor.

int main(void)
{
DDRB |= _BV(PB4);
while (1)
{
PORTB |= _BV(PB3);
_delay_ms(200);
PORTB &= ~_BV(PB3);
_delay_ms(200);
}
}

• Wow, I spent so much time double-checking everything. It's working now. Thank you so much!
– Anna
Nov 11 '16 at 19:42