Programming ATmega328 in Assembly using Arduino IDE and Arduino Uno Development Board
L1........
What is an Embedded System?
It is an integration of Sensors, Actuators and Intelligence with a system to produce more capable, versatile and robust performance.
When to use a microcontroller?
Microcontroller is used when:
- Intelligence is required in the system.
- the complexity reduction of a system is needed.
- Once has to reduce the system design cost.
- A variety of sensors and actuators must be integrated in the system.
- Communication with other devices is necessary.
We will using C/C++/Arduino/Assembly language for higher speed functins/FPGA for highest speed(VHDL).
Microcontroller Manufacturer
- AMCC
- Atmel
- Comfile Technology Inc.
- Coridium
- Cypress Microsystems
- Dallas Semiconductor
- Elba Corp.
- Freescale Semiconductors
- Fujitsu
- Holtek
- Infineon
- Intel
- Microchip Technology
- Natinal Semiconductor
- NEC
- Parallax Inc.
- Philips Semiconductors
- PICAXE
- Renesas Technology
- Silabs
- Silicon Motion
- STMicroelectronics
- Texas Instruments
- Toshiba
- Western Design Center
- Ubicorn
- Xemics
- Xilinx
- ZiLOG
Assembly language is main topic of discussion here, because it performs really fast and very good for time critical operations.
L2........................
Other than Microcontroller there are some other SOC that implies intelligence, so here, some comparison is done between
- uC vs ASIC
- uC vs CPLD
- uC vs DSP
- uC vs FPGA
- uC vs PLC
- uC vs uP
and the comparison is based on the following features...
- Computational Power
- Ease of programming
- Speed of Operation
- Interrupts
- Ease of Interface(analog and digital)
- Overall system cost
- Reconfiguration(How easy to configure for other tas)
- Versatility(How many other tasks it can be configured for)
- Communication with other devices
- Timer/Counter Functions
- Handing Media
- Overall time required(the time required to start working with it for the first time).
Follow the website for different available Arduino Uno shields
Arduino Yun has the same basic arduino along with linux core that can run linux OS.
Arduino Uno Overview
GPIO
- can be used as input or output
- Each pin can be uniquely assignable
- Analog(PWM) output on digital pins 3,5,6,9,10,11
- Analog pins 0-5 can also be used as GPIO
- Pull Up resistor with every GPIO pin is present
Digital Inputs:
Pull up resistors are used to avoid the floating pin problem. when the button is pressed GND will be detected at the input pins and when unpressed it is 5V. If we dont use the pullup resistor and connect the point directly to the 5V it will burn the uC because of high current sinking into the uC.
In this case we can use internal pull resistor but it need more info about the input port but we will see it later.
Analog Inputs:
- Takes a continuous valued input signal from 0-5V, it can be from any sensor.
- Assign the input a value from 0-1027.
Let say the input signal is coming from cruise control or techometer, you need to be careful that the input signal must not go too beyond the 5V level else it will damage the Arduino. Arduino quantize these voltages in a value from 0-1027. Whenever we are reading the analog value it is always instantaneous. Think about aliasing here, that it is going to effect the reading while sampling.
Analog(PWM) Output:
Analog output is produced by means of generating the PWM signal, varying the duty cycle varies the output voltage between 0-5V.
Software comparison that are used to develop code for Arduino
This table gives an idea what tool you should be using for your project. If your application is speed critical then use ASM language. Although, for applications that doesnt need too much speed but needed less development time then you should go for Arduino IDE.
In order to utilize the each and each function of microcontroller assembly is used here. There are some features that cannot be used with the use of Arduino IDE like: internal temperature of Atmega328, 10bit PWM.
L3....................
Here will be focusing on Arduino IDE, one can use processing either.
Arduino IDE is based on C/C++. In Arduino we are gonna be using two function
- void setup(), where you are do all the necessary setup that are needed to be executed once
- void loop(), you need to write the part of code that is required to be executed forever
In case you want to brushup you programming skills in C, please click on the link...
Now, you will be writing the very first code using Arduino IDE that does nothing and compiles perfectly.
- left opamp is working as a shifter and the right opamp is doing the scaling
- S2 is the supply voltage, that is equal to positive opamp biasing voltage
- choose the resistor value using the equation below
- PWM
- There are two types of PWM signal Unipolar and bipolar
- Arduino has only unipolar PWM signalling
- Bipolar is used mostly in motor that can run in either direction
- R-2R Ladder network
- DAC chips/shield
- Hack-method follow the link..
- In TTL, 0-0.8 is considered as logic low during input to TTL circuit. However, 2-5V is considered as logic-high during input to TTL circuit.
- When TTL circuit writes high to a pin it can be anything from 2.7v to 5v, although, for low it is 0-0.5v
- similarly one can see for CMOS
- CMOS is very good for switching
- CMOS is necesserily be between 0-5v, but it can any voltage higher than 5V like: 10V and so
- RS232 is an old serial communication standard but still being used quite a lot.
- typical voltage values for RS232 are +-15V, but it could be +-25V.
Comments
Post a Comment