VTech Alphabert s Magic Readport User Manual Page 41

  • Download
  • Add to my manuals
  • Print
  • Page
    / 80
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 40
BM Dept., Govt. Engg. College, Gandhinagar Page 41
MOV P1,#0ffh ;Make P1 output port
MOV P2,#00h ;Make P2 output port
MOV TMOD,#20h ;Timer 1, mode-2 ( auto reload mode)
MOV TH1,#0FDh ;Count value for baud rate 9600
MOV SCON,#50h ;8 bit UART mode, REN enable
MOV IE,#90h ; Enable serial interrupt and EA bit
MOV R0,#20h ;Pointer to the RAM location
SETB TR1 ;Start timer 1 to generated baud rate.
next: MOV A,@R0
MOV SBUF,A
INC R0
CJNE R0,#2Fh,next
serial: JB TI, transmit
MOV A, SBUF
MOV P0, A
CLR RI
RETI
transmit: CLR TI
RETI
END
:: WORKSHEET::
Exercise:
A. Modify program to transmit string “WELCOME TO GEC GANDHINAGAR” using
serial port. Use interrupt method and baud rate 9600.
Memory
Location
HEX
code
Label Opcode Operands Comments
Page view 40
1 2 ... 36 37 38 39 40 41 42 43 44 45 46 ... 79 80

Comments to this Manuals

No comments