Interesting deal on small AVR board.

Here is another link for the board http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-42671-ATtiny104-Xplained-Nano_User-Guide.pdf

Microchip regularly offers free shipping deals and I was able to get that board without paying for shipping - see https://forum.allaboutcircuits.com/...ences-that-may-be-missed.143272/#post-1212449

Which reminds me that it has been almost a year. Have done next to squat with it. Atmel Studio is a variety if Visual Studio. With the board you don't need to have a programmer and that makes it easy to get acquainted/started with C.

Here is the ubiquitous blink program:
Code:
#include <avr/io.h>

int main(void)
{
   /* enable the pull-up function */
   PUEB |= 1<<PORTB1;
   /* enable pull-up for button */
   PORTB |= 1<<PORTB1;
   /* configure LED pin as output */
   DDRA |= 1<<DDRA5;
   while  (1)
   {
     /* check the button status (press - 0 , release - 1 ) */
     if(!(PINB & (1<<PINB1)))
     {
       /*switch on the LED until button is pressed */
       PORTA &= ~(1<<PORTA5);
     }
     else
     {
       /* switch off the LED if button is released*/
       PORTA |= 1<<PORTA5;
     }
   }
}
 
Top