This week assignment is to do the following tasks:
I have a previous knowledge with Microcontrollers as I used PIC microcontroller in many projects but I never used AVR microcontroller, so I wanted to recap first some important concepts. (This is just a quick recap of all the links listed down).
Microprocessor | Microcontroller |
---|---|
MPU | MCU |
An integrated circuit used for general purpose computing tasks. | An integrated circuit used for specific applications only |
Usually used in computers | Usually used in embedded systems and Engineering projects |
Must be connected to external peripherals to work. ( like memory ) | It doesn’t need any external peripherals to work. ( it has memory inside) |
It has ALU ( Arithmetic Logic Unit) , I/O ports and Registers | It has CPU (Central processing unit), RAM / ROM, programmable I/O ports, serial port, timer, And all required components |
In simplest term,
MPU = CPU
MCU = MPU + Peripherals + Memory
Peripherals = Ports + Clock + Timers + UART/USART + ADC + DAC + LCD Drivers + Other Stuffs
Memory = Flash + SRAM + EPROM + EEPROM
Useful links to understand more:
- http://maxembedded.com/2011/06/mcu-vs-mpu/
- https://circuitdigest.com/article/what-is-the-difference-between-microprocessor-and-microcontroller
There are many Microcontrollers families like 8051, PIC, AVR, ARM to name just a few. These families are different from each other in the processor architecture, Number of registers which means the amount of numbers that can be stored, Speed of execution, number of instructions, peripherals and off course the manufacturer. Each family contains number of microcontrollers which differ from each other in number of ports, number of clocks, amount of memory… So in any project we have to choose the family and then which controller in this family to use.
Useful links:
- https://ti.tuwien.ac.at/ecs/teaching/courses/mclu/theory-material/Microcontroller.pdf
- https://www.engineersgarage.com/tutorials/getting-started-with-microcontrollers
The family that we will work with is the AVR family manufactured by Atmel. Its architecture is based on RISC, 8 and 32 bits registers. It has high computing performance with better power efficiency according to Atmel website.
You choose an IDE (Integrated Development Environment) which you can install on your computer and write the code on it using a programming language. The IDE work as a compiler, it will extract the machine language from your code. After that the code will be uploaded to the MCU using a circuit connected to both your computer and your MCU.
Useful links:
- http://www.build-electronic-circuits.com/microcontroller-programming/
I started scrolling down in the datasheet through the things that I thought I need to know which are the function of each pin and what I can do with this microcontroller
Pin NUmber | Name | Main Function |
---|---|---|
1 | VCC | Supply voltage |
14 | GND | The ground |
2,3,4,5 | Port B = PB0-PB3 | I/O port consists of 4 pins = 4 bit port |
6,7,8,9,10,11,12,13 | PORTA= PA0-PA7 | I/O port consists of 8 pins = 8 bit port |
These are the main functions but each pin can be used in other functions
The ATtiny has:
There are all the details that anyone needs to know about ATtiny in the data sheet so I thought it’s better to check it again when I need any information and I will update it here .
(In our fab lab we face a problem of broken milling tool so I didn’t got the chance to make the board so I will update this part after the arrival of the new milling tool)
That's all :)