The goal of this week is to read the data sheet of a microcontroller; using different programming languages. And also different devices for programming (AVRISP2, ASPUSB 2.0, ubstinyISP)
1. Group Assignment
compare the performance and development workflows for other architectures.
A microcontroller is a compact integrated circuit designed to govern a specific operation in an embedded system. A typical microcontroller includes a processor, memory and input/output (I/O) peripherals on a single chip.Sometimes referred to as an embedded controller or microcontroller unit (MCU), microcontrollers are found in vehicles, robots, office machines, medical devices, mobile radio transceivers, vending machines and home appliances among other devices.
1.1.1 Microcontroller features
A microcontroller's processor will vary by application. Options range from the simple 4-bit, 8-bit or 16-bit processors to more complex 32-bit or 64-bit processors. In terms of memory, microcontrollers can use random access memory (RAM), flash memory, EPROM or EEPROM.
Microcontroller architecture can be based on the Harvard architecture or von Neumann architecture, both offering different methods of exchanging data between the processor and memory. With a Harvard architecture, the data bus and instruction are separate, allowing for simultaneous transfers. With a Von Neumann architecture, one bus is used for both data and instructions.
1.1.2 Intruction set of Microcontroller
Microcontroller processors can be based on complex instruction set computing (CISC) or reduced instruction set computing (RISC). CISC generally has around 80 instructions while RISC has about 30, as well as more addressing modes, 12-24 compared to RISC's 3-5. While CISC can be easier to implement and has more efficient memory use, it can have performance degradation due to the higher number of clock cycles needed to execute instructions. RISC, which places more emphasis on software, often provides better performance than CISC processors, which place more emphasis on hardware, due to its simplified instruction set and, therefore, increased design simplicity, but because of the emphasis it places on software, software can be more complex. Which ISC is used varies depending on application.When they first became available, microcontrollers solely used assembly language. Today, the C programming language is a popular option.
1.1.3 Types of microcontrollers
Common MCUs include the Intel MCS-51, often referred to as an 8051 microcontroller, which was first developed in 1985; the AVR microcontroller developed by Atmel in 1996; the programmable interface controller (PIC) from Microchip Technology; and various licensed ARM microcontrollers. A number of companies manufacture and sell microcontrollers, including NXP Semiconductor, Renesas Electronics, Silicon Labs and Texas Instruments.
1.2 ATtiny25 / ATtiny45 / ATtiny85
ATtiny (also known as TinyAVR) are a subfamily of the popular 8-bit AVR microcontrollers, which typically has fewer features, fewer I/O pins, and less memory than other AVR series chips. The first members of this family were release in 1999 by Atmel.Check " Data sheet"
For this assignment we use the Attiny45, circuit developed in week 7, where we add an LED and a button to the Echo Hello-World board and to test it (Blinking - On / Off button
2. Individual Assignment
Read a microcontroller data sheet
program your board to do something, with as many different programming languages and programming environments as possible
2.1 PROGRAMMING OF MICROCOTROlLER
To program in the AVR-C language, you must verify the output pins of the microcontroller.
VCC: supply voltage
PORT B: 4-bit I / O port - internal pull-up resistors - Digital inputs and outputs.
PORT A: 8-bit I / O port - internal pull-up resistors - analog to digital converter (ADC)
RESET: restart the program
To start programming the microcontrollers, I took the examples provided by the FabAcademy.
This example will be used to program the microcontrollers. This program controls the speed of LED on and off; increasing or decreasing to check if our program was recorded in the microcontroller.
1. Header: These are library files that help us to code.
2. It is the entry point and the main function that is compiled and that you can write what you want.
3. these are the entry or exit records that will be used in the microcontroller.
4. A cyclic structure, which allows us to execute one or several lines of code in a repetitive way without having to have an initial value.
5. It is the task of the microcontroller.
6. This is to indicate the return value of a function..