All Assembley Notes For Embedded System
All Assembley Notes For Embedded System
Lecture 1
Embedded Systems
1 Introduction to Microcontrollers
2 Examples of applications
6 Structure of a microcontroller
1 Introduction to Microcontrollers
2 Examples of applications
6 Structure of a microcontroller
1 Introduction to Microcontrollers
2 Examples of applications
6 Structure of a microcontroller
1 Introduction to Microcontrollers
2 Examples of applications
6 Structure of a microcontroller
1 Introduction to Microcontrollers
2 Examples of applications
6 Structure of a microcontroller
1 Introduction to Microcontrollers
2 Examples of applications
6 Structure of a microcontroller
1 Introduction to Microcontrollers
2 Examples of applications
6 Structure of a microcontroller
1 Introduction to Microcontrollers
2 Examples of applications
6 Structure of a microcontroller
1 Introduction to Microcontrollers
2 Examples of applications
6 Structure of a microcontroller
THANK YOU
I
Eng George Mugala ( THE COPPERBELT UNIVERSITY
Principle of Operation
SCHOOLofOF
Microcontroller/MicroprocessorLecturer
ENGINEERING) August2Embedded
28, 2017 Systems
9 / 60
BIG INDIAN AND LITTLE INDIAN POLICY
RAM
I SRAM- SRAM (static RAM) is random access memory (RAM) that
retains data bits in its memory as long as power is being supplied.
I DRAM -Dynamic random-access memory (DRAM) is a type of
random-access memory that stores each bit of data in a separate
capacitor within an integrated circuit. The capacitor can be either
charged or discharged; these two states are taken to represent the
two values of a bit, conventionally called 0 and 1.
RAM
I SRAM- SRAM (static RAM) is random access memory (RAM) that
retains data bits in its memory as long as power is being supplied.
I DRAM -Dynamic random-access memory (DRAM) is a type of
random-access memory that stores each bit of data in a separate
capacitor within an integrated circuit. The capacitor can be either
charged or discharged; these two states are taken to represent the
two values of a bit, conventionally called 0 and 1.
ROM
I EPROM-An EPROM (rarely EROM), or erasable programmable
read-only memory, is a type of memory chip that retains its data
when its power supply is switched off. The memory can be erased
and reused.Erasure is caused by shining an intense ultraviolet light
through a window that is designed into the memory chip
1 Select a particular AVR chip and construct the program flow chart
2 Write the program(Using Note pad,Avr studio or any development
software)
3 Assemble the Program
4 Simulate or Emulate the program to see whether or not it works
5 Program the AVr(Feeds what you have written into the actual chip)
flow chart
October 9, 2017
1 Introduction to ISA
2 kinds of instruction
3 Addressing Modes
1 Introduction to ISA
2 kinds of instruction
3 Addressing Modes
1 Introduction to ISA
2 kinds of instruction
3 Addressing Modes
1 Arithmetic/logic instruction
I Add,subract,Multiply,Divide,Compare
I OR,AND,NOT, XOR
I Shift(Left/right,arithmetic/logical),rotate
1 Arithmetic/logic instruction
I Add,subract,Multiply,Divide,Compare
I OR,AND,NOT, XOR
I Shift(Left/right,arithmetic/logical),rotate
2 Data transfer Instruction
I Load(Copy data to a Register from Memory)
I Store(Copy Data to a Memory location from a Register)
I Move
3 Control transfer functions
I Jump,Conditional Branch,function call,Return
4 Other type of instructions
I e.g halt instruction
I
Eng George Mugala ( THE COPPERBELT UNIVERSITY
Introduction to
SCHOOL
Instruction
OF Set
ENGINEERING)
ArchitectureLecture 3 Embedded
October
Systems
9, 2017 8 / 27
CONTENTS OF THE REGISTER AFTER
COMPILATION
1 Introduction to ISA
2 kinds of instruction
3 Addressing Modes
1 Introduction to ISA
2 kinds of instruction
3 Addressing Modes
1 Introduction to ISA
2 kinds of instruction
3 Addressing Modes
1 Introduction to ISA
2 kinds of instruction
3 Addressing Modes
1 Introduction to ISA
2 kinds of instruction
3 Addressing Modes
1 Introduction to ISA
2 kinds of instruction
3 Addressing Modes
3 TIMER/COUNTER 0
6 PROGRAMING EXAMPLES
8 TIMER/COUNTER1
3 TIMER/COUNTER 0
6 PROGRAMING EXAMPLES
8 TIMER/COUNTER1
3 TIMER/COUNTER 0
6 PROGRAMING EXAMPLES
8 TIMER/COUNTER1
I
I flag is set when the counter overflows
F can be checked and cleared by software
I Atmega32 has 3 timers
F TIMER 0,TIMER1 and TIMER2
3 TIMER/COUNTER 0
6 PROGRAMING EXAMPLES
8 TIMER/COUNTER1
3 TIMER/COUNTER 0
6 PROGRAMING EXAMPLES
8 TIMER/COUNTER1
3 TIMER/COUNTER 0
6 PROGRAMING EXAMPLES
8 TIMER/COUNTER1
3 TIMER/COUNTER 0
6 PROGRAMING EXAMPLES
8 TIMER/COUNTER1
3 TIMER/COUNTER 0
6 PROGRAMING EXAMPLES
8 TIMER/COUNTER1
3 TIMER/COUNTER 0
6 PROGRAMING EXAMPLES
8 TIMER/COUNTER1
Fast PWM
As shown in table, for the output to go high on compare and the output
will stay high until max value (as shown in figure at bottom). We have
to choose inverting mode to do that, so COM00=1; COM01=1.
Now for varying the brightness of LED we have to change the DUTY
RATIO of PWM signal. In order to change duty ratio, we need to
change the OCR0 value. When we change this value of OCR0, the
counter takes different time, to reach the OCR0. So the controller pulls
the output high at different times.
The center of the wave is normally out sync in fast PWM for different
duty cycles, however in phase correct phase is maintained. This for
some applications such as server motors, it may be very important to
run the motors in phase correct and not Fast PWM
TCCR0 = 0b01110001
this sets WGM00 to 1 which is bit 6 and clears WGM01 which is
bit bit 3, bit 0 is 1 to mean no prescalar and normal mode
I
I Since we are using internal reference of 2.56V, REFS1 and REFS0 =1
I Since we are using channel 0, MUX1 to MUX4 = 0
I ADLAR We shall wrt 0 since we want the result to be right justified.
I Binary number to be loaded:0b11000000