VTech Alphabert s Magic Readport User Manual Page 44

  • Download
  • Add to my manuals
  • Print
  • Page
    / 80
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 43
Lab Manual of Microcontroller & Interfacing Page 44
EXPERIMENT NO. 11
AIM: Write a program to receive bytes of data serially and display it on port P0. Use 8 bit
UART mode with baud rate 9600.
Interfacing diagram:
Pin connections:
LEDs are connected to port 0 to display received data from the serial port.
Serial data transfer pins RxD and TxD are connected to the serial port of the computer
thorough IC MAX 232. Max 232 provides necessary voltage conversion from TTL to
serial port standards. As per RS232 standard, logic 1 has voltage range -3 to -25 V and
logic 0 has voltage range +3 to +25 V.
Programming steps:
The TMOD special function register is loaded with the value 20h to use timer 1 in mode
2 (8 bit auto-reload) to set baud rate. The value FDh is loaded in TH1 register to generate
baud rate 9600 for the crystal of 11.059 MHz.
The SCON register is loaded with the value 50h, indicating serial mode 1 in which 8 bit
data is framed with start and stop bits.
The timer 1 run control bit TR1 is set to high.
The RI flag is cleared with the instruction CLR RI.
The RI flag is monitored with the instruction:
CHECK: JNB RI, CHECKinstruction to check whether entire character has been
received or not.
When reception is over, RI is raised by microcontroller which indicates that SBUF has a
byte and we can read it and display it at LEDs connected at Port P0.
Program 1: Serial data reception using polling method:
ORG 00h ; Start program from memory location 00h
MOV TMOD,#20h ;Timer 1, mode-2 ( auto reload mode)
Page view 43
1 2 ... 39 40 41 42 43 44 45 46 47 48 49 ... 79 80

Comments to this Manuals

No comments