Professional Documents
Culture Documents
com
www.EmbeddedMarket.com
Workshop Objective
Microcontroller, Arduino & Embedded Kits available at EmbeddedMarket.com Microcontroller Kits Available at www.DeccanRobots.com
www.DeccanRobots.com www.EmbeddedMarket.com
Understand the real world development using Microcontrollers Explore the features of microcontroller and use them in real life applications
www.EmbeddedMarket.com
Details of Workshop
Microcontroller, Arduino & Embedded Kits available at EmbeddedMarket.com Microcontroller Kits Available at www.DeccanRobots.com
www.DeccanRobots.com www.EmbeddedMarket.com
Your Basic Preparation Interface 8051 with various circuits Use built-in features of 8051 Apply above said learning to control a hobby robot This workshop is to learn the control techniques. Mechanical aspects will not be discussed.
www.EmbeddedMarket.com
www.DeccanRobots.com www.EmbeddedMarket.com
Basic Parts of a Computer Processor Hard disk RAM Monitor Keyboard Mouse Ports
www.EmbeddedMarket.com
www.DeccanRobots.com www.EmbeddedMarket.com
Microcontroller has built in Processor Memory to Store Program Memory to Store Data Ports for Input & Outputs Flexible Multipurpose
www.EmbeddedMarket.com
www.DeccanRobots.com www.EmbeddedMarket.com
Why use Microcontroller instead of PC? Why use Microcontroller instead of Digital Circuits?
www.EmbeddedMarket.com
www.DeccanRobots.com www.EmbeddedMarket.com
www.EmbeddedMarket.com
Embedded Vs IT Sector
Microcontroller, Arduino & Embedded Kits available at EmbeddedMarket.com Microcontroller Kits Available at www.DeccanRobots.com
www.DeccanRobots.com www.EmbeddedMarket.com
Microcontroller is entry point to the Embedded Development Embedded is Hardware + Software IT is Software only Recent Global Economic downturn has less effect on Embedded Related companies
www.EmbeddedMarket.com
www.DeccanRobots.com www.EmbeddedMarket.com
You should know: Internals of microcontrollers Writing programs to create application Programming languages Bits , Bytes and Address Binary, Decimal & Hexadecimal Numbers Details of Interface (Input / Output circuits) Built-in Features of Microcontroller
www.EmbeddedMarket.com
www.DeccanRobots.com www.EmbeddedMarket.com
8051 Microcontroller AT89S51 AT89S52 P89V51RD2 Differs in Program memory Size Data Memory Size Certain built-in features
www.EmbeddedMarket.com
www.DeccanRobots.com www.EmbeddedMarket.com
Internals of 89V51RD2 8 Bit processor 64 KB Flash (Memory to store program) 1 KB RAM (Memory to store data) Special Function Registers (SFR Used for Configuration of Built-in Features) 32 I/O Lines
www.EmbeddedMarket.com
www.DeccanRobots.com www.EmbeddedMarket.com
www.EmbeddedMarket.com
www.DeccanRobots.com www.EmbeddedMarket.com
Start:
JB P2.0,Start
JB P1.0,MakeItON SETB P1.0
Machine Code
Hex File
Assembler Software
www.DeccanRobots.com www.EmbeddedMarket.com
www.EmbeddedMarket.com
www.DeccanRobots.com www.EmbeddedMarket.com
MSB
1 0 1 0 1 0 1 0
LSB
Value 0th Bit 1 Byte
Binary = 10101010b Decimal = 170d Hexadecimal = AAh www.EmbeddedMarket.com
7th
Bit
www.DeccanRobots.com www.EmbeddedMarket.com
25d
10111001b
22h
22d
www.EmbeddedMarket.com
www.DeccanRobots.com www.EmbeddedMarket.com
Details of Interface
LED Interfacing Seven Segment Interfacing Reading Input from Switch Display text to LCD Drive DC Motor using L293D Drive Stepper Motor using ULN2803 Driver Relay using ULN2803 Send text to PC using RS232 Serial Communication Transmit Infrared Receive Infrared Signal
www.EmbeddedMarket.com
www.DeccanRobots.com www.EmbeddedMarket.com
www.EmbeddedMarket.com
Flash memory & Data memory Program is written in Assembly Language Assembler software converts it to HEX file Hex File is downloaded to Microcontroller via Programming Device Hex File is Stored in Microcontrollers Flash memory Variables used by this program are stored in Microcontrollers Data memory (RAM)
www.EmbeddedMarket.com
www.DeccanRobots.com www.EmbeddedMarket.com
www.DeccanRobots.com www.EmbeddedMarket.com
www.EmbeddedMarket.com
By now you know Difference between microcontroller, PC and digital circuit Internals of microcontrollers Writing programs to create application Programming languages Bits , Bytes and Address Binary, Decimal & Hexadecimal Numbers Details of Interface (Input / Output circuits) Built-in Features of Microcontroller You have seen one demo
www.EmbeddedMarket.com
www.DeccanRobots.com www.EmbeddedMarket.com
?
Microcontroller, Arduino & Embedded Kits available at EmbeddedMarket.com Microcontroller Kits Available at www.DeccanRobots.com
www.DeccanRobots.com www.EmbeddedMarket.com
www.EmbeddedMarket.com
Assembly Language
Microcontroller, Arduino & Embedded Kits available at EmbeddedMarket.com Microcontroller Kits Available at www.DeccanRobots.com
We will learn (Limited Scope to fit available time) Assigning Byte values Assigning Bit values Logical Operations on Bytes Logical Operations on Bits Rotate Values Increment & Decrement Values Direct Jumps Conditional Jumps For Bytes Calls Conditional Jumps For Bits
www.EmbeddedMarket.com
www.DeccanRobots.com www.EmbeddedMarket.com
Assembly Language
Microcontroller, Arduino & Embedded Kits available at EmbeddedMarket.com Microcontroller Kits Available at www.DeccanRobots.com
www.DeccanRobots.com www.EmbeddedMarket.com
Assigning & Copy Byte values MOV R0, #55h MOV A, R0 MOV A, #55h MOV 90h, A MOV 90h, #33h
www.EmbeddedMarket.com
Assembly Language
Microcontroller, Arduino & Embedded Kits available at EmbeddedMarket.com Microcontroller Kits Available at www.DeccanRobots.com
www.DeccanRobots.com www.EmbeddedMarket.com
Assigning Bit values SETB 00h CLR 00h CPL 00h Copy Bit values MOV C, 00h MOV 00h, C
www.EmbeddedMarket.com
Assembly Language
Microcontroller, Arduino & Embedded Kits available at EmbeddedMarket.com Microcontroller Kits Available at www.DeccanRobots.com
www.DeccanRobots.com www.EmbeddedMarket.com
Logical operations on Byte ANL A, R0 ANL A, 90h ANL A, #55h ANL 90h, A ANL 90h, #55h Same format applies for ORL XRL
www.EmbeddedMarket.com
Assembly Language
Microcontroller, Arduino & Embedded Kits available at EmbeddedMarket.com Microcontroller Kits Available at www.DeccanRobots.com
www.DeccanRobots.com www.EmbeddedMarket.com
www.EmbeddedMarket.com
Assembly Language
Microcontroller, Arduino & Embedded Kits available at EmbeddedMarket.com Microcontroller Kits Available at www.DeccanRobots.com
www.DeccanRobots.com www.EmbeddedMarket.com
RR A 10101100
www.EmbeddedMarket.com
Assembly Language
Microcontroller, Arduino & Embedded Kits available at EmbeddedMarket.com Microcontroller Kits Available at www.DeccanRobots.com
www.DeccanRobots.com www.EmbeddedMarket.com
Increment & Decrement values INC A INC R0 INC 00h DEC A DEC R0 DEC 00h
www.EmbeddedMarket.com
Assembly Language
Microcontroller, Arduino & Embedded Kits available at EmbeddedMarket.com Microcontroller Kits Available at www.DeccanRobots.com
www.DeccanRobots.com www.EmbeddedMarket.com
Following types of commands will be covered during further demos Direct Jumps Conditional Jumps For Bytes Calls Conditional Jumps For Bits
www.EmbeddedMarket.com
Why 89V51RD2?
Microcontroller, Arduino & Embedded Kits available at EmbeddedMarket.com Microcontroller Kits Available at www.DeccanRobots.com
www.DeccanRobots.com www.EmbeddedMarket.com
Reasons for selecting 89V51RD2 8051 compatible No expensive programmer device required Big Flash memory size to store large program hex Easily available
www.EmbeddedMarket.com
www.DeccanRobots.com www.EmbeddedMarket.com
www.EmbeddedMarket.com
www.DeccanRobots.com www.EmbeddedMarket.com
Email your schematics and get the price estimate for PCB Design & manufacturing Payment by DD Delivery by courier Delivery time 6-10 days Single & Double Side Designs Email ID: support@deccanrobots.com
www.EmbeddedMarket.com
Get, Set, Go
Microcontroller, Arduino & Embedded Kits available at EmbeddedMarket.com Microcontroller Kits Available at www.DeccanRobots.com
www.DeccanRobots.com www.EmbeddedMarket.com
Lets begin the real learning Its time to write your First program To Glow One LED
CLR P1.0
Refer next slide for LED circuit. How to write this code? Where to write this code? How to convert it to HEX?
www.EmbeddedMarket.com
Get, Set, Go
Microcontroller, Arduino & Embedded Kits available at EmbeddedMarket.com Microcontroller Kits Available at www.DeccanRobots.com
www.DeccanRobots.com www.EmbeddedMarket.com
www.EmbeddedMarket.com
www.DeccanRobots.com www.EmbeddedMarket.com
www.EmbeddedMarket.com
www.DeccanRobots.com www.EmbeddedMarket.com
2 1 4 8 5
12 10 9 11
www.EmbeddedMarket.com
www.DeccanRobots.com www.EmbeddedMarket.com
9-12V DC
89V51RD2 Internals
Microcontroller, Arduino & Embedded Kits available at EmbeddedMarket.com Microcontroller Kits Available at www.DeccanRobots.com
www.DeccanRobots.com www.EmbeddedMarket.com
64KB Flash memory 1KB Data RAM Special Function Registers 4 Ports
www.EmbeddedMarket.com
89V51RD2 Internals
Microcontroller, Arduino & Embedded Kits available at EmbeddedMarket.com Microcontroller Kits Available at www.DeccanRobots.com
www.DeccanRobots.com www.EmbeddedMarket.com
89V51RD2 Internals
Microcontroller, Arduino & Embedded Kits available at EmbeddedMarket.com Microcontroller Kits Available at www.DeccanRobots.com
www.DeccanRobots.com www.EmbeddedMarket.com
List of Special Function Registers (SFR) Math A, B Interrupt IE Timer Control TMOD, TCON Timer / Counter TH0, TL0, TH1, TL1 Serial Communication SCON, SBUF PORT P0, P1, P2, P3
www.EmbeddedMarket.com
+5V
www.DeccanRobots.com www.EmbeddedMarket.com
P1
P0
P3
www.DeccanRobots.com www.EmbeddedMarket.com
www.EmbeddedMarket.com
www.DeccanRobots.com www.EmbeddedMarket.com
Crystal Frequency is 11.0592 MHz 1 Machine cycle = Crystal frequency/12 i.e. 12 clocks makes one machine cycle Machine cycle is time required to
Fetch instruction from Flash Memory + Execute the instruction
www.EmbeddedMarket.com
www.DeccanRobots.com www.EmbeddedMarket.com
How much time is require to fill this glass? Depends on Water Speed & Glass size
www.EmbeddedMarket.com
89V51RD2 has 3 Timers built-in They are Timer0, Timer1, Timer2 Lets use Timer0 to Generate a delay of approximate 1 second Timer0 is built-in feature of 89V51RD2 SFRs related to Timer0 are: TH0, TL0 (Call it as T0) TMOD TCON
www.EmbeddedMarket.com
www.DeccanRobots.com www.EmbeddedMarket.com
www.DeccanRobots.com www.EmbeddedMarket.com
Special Function register TH0 and TL0 is like empty glass Combined size of TH0 and TL0 is 16 Bits i.e. T0 is of 16 bit size Now you know the size of empty Glass Next Task is to calculate the Time required to fill these 16bits.
www.EmbeddedMarket.com
www.DeccanRobots.com www.EmbeddedMarket.com
T=1/ F T (Time required for 1 machine cycle) =1/0.9216 =1.0850694 =1.085 Micro Seconds (Round Off)
www.EmbeddedMarket.com
www.DeccanRobots.com www.EmbeddedMarket.com
In other words we can say that with 11.0592 MHZ Crystal Connected, Timers value will increment every 1.085 micro seconds. T0 is of 16 bit size, thus it can store 65536 drops of water. T0 will take 65536 x 1.085= 71106.56 Micro Sec Or 71.10 MiliSec to overflow
www.EmbeddedMarket.com
www.DeccanRobots.com www.EmbeddedMarket.com
If we want to count 1 second then we have to overflow timer approximately 14 times. Because 1 sec = 1000 mili sec 1000 / 71.1 =14.06 = 14 times approx
www.EmbeddedMarket.com
www.DeccanRobots.com www.EmbeddedMarket.com
www.EmbeddedMarket.com
www.DeccanRobots.com www.EmbeddedMarket.com
TMOD register is divided into 2 identical parts. Bit M0 and M1 are used to set Mode of timer Bit C/T is used to specify if you want a timer or counter Gate Bit will allow you to use timer as stopwatch, i.e. timer will run only if externally a switch is pressed. Timer 1 7 6 5 4 3 Timer 0 2 1 0
www.DeccanRobots.com www.EmbeddedMarket.com
What will be value of TMOD to generate 1 Second delay? Gate = 0 (We dont want a stop watch) C/T = 0 (We want timer, not counter) M1=0 (*) M0=1 (*) * M1=0 and M0=1 configures the Timer1 as 16bit timer. Other settings are 13 bit timer, 8 Bit timer, Split Timer. The 16 bit timer mode is most suitable for our application.
www.EmbeddedMarket.com
www.DeccanRobots.com www.EmbeddedMarket.com
Now we have configured the Timer0 in 16bit timer mode We know that Timer0 must overflow 14 times to generate 1 second delay But how to Start the Timer?
www.EmbeddedMarket.com
www.DeccanRobots.com www.EmbeddedMarket.com
Use SFR named TCON to start timer TR0 is used to start and stop the Timer0 Lets see our partial code now
7 6 5 4 3 2 1 0
TF1 TR1 TF0 TR0 IE1 IT1 IE0 IT0 Used for Timer Control
www.EmbeddedMarket.com
www.DeccanRobots.com www.EmbeddedMarket.com
Partial Code to generate 1 Second delay MOV TMOD,#00000001b SETB TR0 Now how to monitor the 14 times overflow?
www.EmbeddedMarket.com
www.DeccanRobots.com www.EmbeddedMarket.com
TF0 is set to 1 automatically as T0 Overflows after 71.1 mili sec Thus we should count 14 such overflows by monitoring TF0. See full code on the next page
7 6 5 4 3 2 1 0
TF1 TR1 TF0 TR0 IE1 IT1 IE0 IT0 Used for Timer Control
www.EmbeddedMarket.com
Delay: MOV R0,#14d Configure TMOD MOV TMOD,#00000001b Tstart: Start Timer0 SETB TR0 Loop: Wait for one Overflow JNB TF0,Loop Clear Overflow CLR TF0 Stop Timer CLR TR0 Do it for 14 Times DJNZ R0,Tstart RET
www.EmbeddedMarket.com
www.DeccanRobots.com www.EmbeddedMarket.com
www.DeccanRobots.com www.EmbeddedMarket.com
www.EmbeddedMarket.com
www.DeccanRobots.com www.EmbeddedMarket.com
www.EmbeddedMarket.com
www.DeccanRobots.com www.EmbeddedMarket.com
MOV P2,#00h Start: JB P1.0,Start CPL P2.0 Wait: JNB P1.0,Wait Sjmp Start
www.EmbeddedMarket.com
DC Motor Control
Microcontroller, Arduino & Embedded Kits available at EmbeddedMarket.com Microcontroller Kits Available at www.DeccanRobots.com
www.DeccanRobots.com www.EmbeddedMarket.com
+ H H
OFF
H L
CLK
L L
- +
DC Motor Control
Microcontroller, Arduino & Embedded Kits available at EmbeddedMarket.com Microcontroller Kits Available at www.DeccanRobots.com
www.DeccanRobots.com www.EmbeddedMarket.com
www.EmbeddedMarket.com
DC Motor Control
Microcontroller, Arduino & Embedded Kits available at EmbeddedMarket.com Microcontroller Kits Available at www.DeccanRobots.com
www.DeccanRobots.com www.EmbeddedMarket.com
www.EmbeddedMarket.com
www.DeccanRobots.com www.EmbeddedMarket.com
www.EmbeddedMarket.com
www.DeccanRobots.com www.EmbeddedMarket.com
8 9 V 5 1 R D 2
www.EmbeddedMarket.com
www.DeccanRobots.com www.EmbeddedMarket.com
www.EmbeddedMarket.com
Demonstrated using MITSUMI Make Stepper Motor M35SP-8 Step Angle 7.5o Thus requires 360/7.5 = 48 Steps to complete one full rotation. Stepper motors are used for their accuracy. Stepper motors have no Speed or RPM parameter Most common use is in CNC machines
www.EmbeddedMarket.com
www.DeccanRobots.com www.EmbeddedMarket.com
www.DeccanRobots.com www.EmbeddedMarket.com
+V
B1
A1
B1
A1
www.EmbeddedMarket.com
www.DeccanRobots.com www.EmbeddedMarket.com
+V
A
ON
B1
OFF
ON
B
A B A1 B1
OFF
A1
1 www.EmbeddedMarket.com1 0 0
www.DeccanRobots.com www.EmbeddedMarket.com
+V
A
OFF
B1
OFF
ON
B
A B A1 B1
ON
A1
0 www.EmbeddedMarket.com1 1 0
www.DeccanRobots.com www.EmbeddedMarket.com
+V
A
OFF
B1
ON
OFF
B
A B A1 B1
ON
A1
0 www.EmbeddedMarket.com0 1 1
www.DeccanRobots.com www.EmbeddedMarket.com
+V
A
ON
B1
ON
OFF
B
A B A1 B1
OFF
A1
1 www.EmbeddedMarket.com0 0 1
www.DeccanRobots.com www.EmbeddedMarket.com
VCC
www.EmbeddedMarket.com
www.DeccanRobots.com www.EmbeddedMarket.com
www.EmbeddedMarket.com
Interrupts
Microcontroller, Arduino & Embedded Kits available at EmbeddedMarket.com Microcontroller Kits Available at www.DeccanRobots.com
www.DeccanRobots.com www.EmbeddedMarket.com
www.EmbeddedMarket.com
Interrupts
Microcontroller, Arduino & Embedded Kits available at EmbeddedMarket.com Microcontroller Kits Available at www.DeccanRobots.com
www.DeccanRobots.com www.EmbeddedMarket.com
Interrupts
Microcontroller, Arduino & Embedded Kits available at EmbeddedMarket.com Microcontroller Kits Available at www.DeccanRobots.com
www.DeccanRobots.com www.EmbeddedMarket.com
This subroutine, called an interrupt handler, is only executed when a certain event (interrupt) occurs. Types of interrupts Timer 0 Overflow. Timer 1 Overflow. Timer 2 Overflow Reception/Transmission of Serial Character. External Event 0. External Event 1.
www.EmbeddedMarket.com
External Interrupt
Microcontroller, Arduino & Embedded Kits available at EmbeddedMarket.com Microcontroller Kits Available at www.DeccanRobots.com
www.DeccanRobots.com www.EmbeddedMarket.com
www.EmbeddedMarket.com
External Interrupt
Microcontroller, Arduino & Embedded Kits available at EmbeddedMarket.com Microcontroller Kits Available at www.DeccanRobots.com
www.DeccanRobots.com www.EmbeddedMarket.com
IE
EA: All interrupt enable ES: Enable Serial Interrupt ET1: Enable Timer 1 Interrupt EX1: Enable External 1 Interrupt ET0: Enable Timer 0 Interrupt
External Interrupt
Microcontroller, Arduino & Embedded Kits available at EmbeddedMarket.com Microcontroller Kits Available at www.DeccanRobots.com
www.DeccanRobots.com www.EmbeddedMarket.com
P3.2
www.EmbeddedMarket.com
Counter
Microcontroller, Arduino & Embedded Kits available at EmbeddedMarket.com Microcontroller Kits Available at www.DeccanRobots.com
www.DeccanRobots.com www.EmbeddedMarket.com
TMOD
Timer 1
MOV TMOD,#00000101b
Timer 0
P3.4
TCON
SETB TR0
7 6 5 4 3 2 1 0 TF1 TR1 TF0 TR0 IE1 IT1 IE0 IT0 Used for Timer Control
www.EmbeddedMarket.com
Counter
Microcontroller, Arduino & Embedded Kits available at EmbeddedMarket.com Microcontroller Kits Available at www.DeccanRobots.com
www.DeccanRobots.com www.EmbeddedMarket.com
start:
MOV TMOD,#00000101b
SETB TR0
Loop:
MOV P2,TL0
SJMP Loop
www.EmbeddedMarket.com
Relay Interfacing
Microcontroller, Arduino & Embedded Kits available at EmbeddedMarket.com Microcontroller Kits Available at www.DeccanRobots.com
www.DeccanRobots.com www.EmbeddedMarket.com
+V
N/C C N/O
Use a Switch to ON & Off Relay, Observe the Tick sound generated when Relays magnet is energized
www.EmbeddedMarket.com
Relay Interfacing
Microcontroller, Arduino & Embedded Kits available at EmbeddedMarket.com Microcontroller Kits Available at www.DeccanRobots.com
230V Ph
www.DeccanRobots.com www.EmbeddedMarket.com
+V
N/C C N/O
www.EmbeddedMarket.com
LCD Interfacing
Microcontroller, Arduino & Embedded Kits available at EmbeddedMarket.com Microcontroller Kits Available at www.DeccanRobots.com
www.DeccanRobots.com www.EmbeddedMarket.com
LCD Circuit
www.EmbeddedMarket.com
LCD Interfacing
Microcontroller, Arduino & Embedded Kits available at EmbeddedMarket.com Microcontroller Kits Available at www.DeccanRobots.com
www.DeccanRobots.com www.EmbeddedMarket.com
www.EmbeddedMarket.com
www.DeccanRobots.com www.EmbeddedMarket.com
www.EmbeddedMarket.com
www.DeccanRobots.com www.EmbeddedMarket.com
www.EmbeddedMarket.com
www.DeccanRobots.com www.EmbeddedMarket.com
www.EmbeddedMarket.com
RS232
Microcontroller, Arduino & Embedded Kits available at EmbeddedMarket.com Microcontroller Kits Available at www.DeccanRobots.com
www.DeccanRobots.com www.EmbeddedMarket.com
Use RS232 to communicate between a PC and embedded product Data logger is common example of it
www.EmbeddedMarket.com
RS232
Microcontroller, Arduino & Embedded Kits available at EmbeddedMarket.com Microcontroller Kits Available at www.DeccanRobots.com
www.DeccanRobots.com www.EmbeddedMarket.com
Rx & Tx Pins
www.EmbeddedMarket.com
RS232
Microcontroller, Arduino & Embedded Kits available at EmbeddedMarket.com Microcontroller Kits Available at www.DeccanRobots.com
www.DeccanRobots.com www.EmbeddedMarket.com
Steps to Communicate Both devices (PC & embedded product) must decide on common speed of communication, This speed is called as baud rate We will use 2400 baud rate i.e. 2400 bits per second
www.EmbeddedMarket.com
RS232
Microcontroller, Arduino & Embedded Kits available at EmbeddedMarket.com Microcontroller Kits Available at www.DeccanRobots.com
www.DeccanRobots.com www.EmbeddedMarket.com
SFRs required for Serial Comunication SCON PCON SBUF TMOD Baud rate settings TCON TL1 TH1
www.EmbeddedMarket.com
RS232
Microcontroller, Arduino & Embedded Kits available at EmbeddedMarket.com Microcontroller Kits Available at www.DeccanRobots.com
www.DeccanRobots.com www.EmbeddedMarket.com
RI
Indicates that Data is received
www.EmbeddedMarket.com
RS232
Microcontroller, Arduino & Embedded Kits available at EmbeddedMarket.com Microcontroller Kits Available at www.DeccanRobots.com
www.DeccanRobots.com www.EmbeddedMarket.com
www.EmbeddedMarket.com
RS232
Microcontroller, Arduino & Embedded Kits available at EmbeddedMarket.com Microcontroller Kits Available at www.DeccanRobots.com
www.DeccanRobots.com www.EmbeddedMarket.com
Baud rate = 2400. Mode type = Mode 1 of serial communication. In this mode we can send and receive 8 bit data. Baud rate to send this data can be set using Timer 1.
www.EmbeddedMarket.com
RS232
Microcontroller, Arduino & Embedded Kits available at EmbeddedMarket.com Microcontroller Kits Available at www.DeccanRobots.com
www.DeccanRobots.com www.EmbeddedMarket.com
Timer 1 is used in 8-bit auto reload mode to generate required BAUD rate. We can not use Timer 0. There no such internal provision to do so
www.EmbeddedMarket.com
RS232
Microcontroller, Arduino & Embedded Kits available at EmbeddedMarket.com Microcontroller Kits Available at www.DeccanRobots.com
www.DeccanRobots.com www.EmbeddedMarket.com
www.EmbeddedMarket.com
RS232
Microcontroller, Arduino & Embedded Kits available at EmbeddedMarket.com Microcontroller Kits Available at www.DeccanRobots.com
www.DeccanRobots.com www.EmbeddedMarket.com
This re-load value for TH1 will be calculated using this formula: TH1 = 256 - ((Crystal / 384) / Baud) TH1 = 256 - ((11059000 / 384) / 2400 ) TH1 = 256 - ((28,799) /2400) TH1 = 256 11.99 = 244.00042= =244d
www.EmbeddedMarket.com
RS232
Microcontroller, Arduino & Embedded Kits available at EmbeddedMarket.com Microcontroller Kits Available at www.DeccanRobots.com
www.DeccanRobots.com www.EmbeddedMarket.com
www.EmbeddedMarket.com
RS232
Microcontroller, Arduino & Embedded Kits available at EmbeddedMarket.com Microcontroller Kits Available at www.DeccanRobots.com
www.DeccanRobots.com www.EmbeddedMarket.com
www.EmbeddedMarket.com