Hi! I want to learn Assembler, so I bought ATmega32A kit (for education).
I wrote a program, which turn on LED when you press the microswitch (as far as RESET button pressed).
And I have a problem, LED turn automatically (I don't press the microswitch) when I turn on DC. Not always, but usually (randomly).
.org 0 ldi r16,0xFF out DDRA,r16 //PORTA as output out PORTA,r16 //set 0xFF to PORTA Â ldi r16,0x00 out DDRB,r16 //PORTB as input ldi r16,0xFF out PORTB,r16 //pull-up resistor - ON Â Â START: sbis PINB,0 //IF "1" on PINB,0 skip next instruction cbi PORTA,0 //set "0" to PORTA,0 - LED ON Â rjmp START .exit
What can I do?