I've got an ATTiny13V on a breadboard with LEDs on Portb.3 and Portb.4. I've also got Portb.0 (which should be PCINT0 according to the data sheet pulled up to 5V through a 10K resistor and hooked to a pushbutton to ground.
$regfile = "attiny13.dat" $crystal = 9600000 Config Portb.3 = Output Config Portb.4 = Output Config Portb.0 = Input Do Debounce Pinb.0 , 0 , Switch_led , Sub Toggle Portb.3 Waitms 50 Loop Switch_led: Toggle Portb.4 Return End
I can poll Portb.0 to see when the switch is pressed, but this runs into problems when the period of the other LED flash gets longer. I'd like to enable interrupts and experiment with an ISR to handle the button push.
Can someone give me a little handholding on how to do this using Bascom? Once I get it running under Bascom, I'll try it in C using AVR Studio.