Mahmoud Alaa

Embedded Programming

Reading the data sheet

This week we're told to read a microcontroller data sheet so i chose to read ATtiny24A/44A/84A, So i started reading it and here is what i learned about this chips.

ATtiny24A/44A/84A are low-power CMOS 8-bit microcontrollers based on something called "the AVR enhanced RISC architecture". They have 2K/4K/8K Bytes of Flash Program Memory, 128/256/512 Bytes of Programmable EEPROM. 128/256/512 bytes SRAM, 12 general purpose I/O lines, 32 general purpose working registers, an 8-bit Timer/Counter with two PWM channels, a 16-bit timer/counter with two PWM channels, Internal and External Interrupts, a 8-channel 10-bit ADC, a programmable Watchdog Timer with internal oscillator, internal calibrated oscillator, and four software selectable power saving modes. and the operating voltage between 1.8 ~ 5.5V.

The ATtiny24A/44A/84A have two kinds of ports, port A and port B.
Port A pins are 8-bit bi-directional I/O port with internal pull-up resistors. Port A has alot of main functions like analog inputs for the ADC, analog comparator, timer/counter, SPI and pin change interrupts. pin names are from PA0 to PA7.
Port B pins are 4-bit bi-directional I/O port with internal pull-up resistors. pin names are from PB0 to PB3. PB3 which is the RESET pin can be used as a I/O pin by programing RSTDISBL fuse.

The only question that i have are how to deal with the registers and their adresses and i think i have to learn and read more to find out and to fully understand how the microcontrollers work.

Programming the board

This week we were told to program the board we made earlier in week 6 assignment, So after searching i wanted to program it using arduino because i am good with arduino codes. So after searching i found HighLowTech Tutorial i followed every step in it and installed attiny files in my ide. After doing so i connected my board with my fabisp and burned the arduino bootloader for my attiny44a with external 20mhz resenator.

After burning the bootloader it is time for code so i wrote a simple arduino sketch that activate 2 leds and turns of the third when the button is pressed.

Download The Arduino sketch

Download The Eagle board file