|
|
BACK
NEXT
Basic
Connection: Microcontroller 8051 with Printer Dot Matrix

( Download Circuit File : printer1.pdf
)
( Download asembly file :printer1.asm
)
( How to build an
easy and cheap Programmer 89Sxxx, only $1 )
( More about
LPT Pin Configuration )
;===================================================
; Printing out data to Dot Matrix Printer
; By: Triwiyanto
; www.mytutorialcafe.com
;===================================================
busy bit P1.5 strobe bit P1.4 portData equ P2 ; org 0h start: call word_Welcome ; to print ' Welcome To ' call enter ; new line feed call word_Lab ; to print ' Computer Laboratory ' call enter ; new line feed ; quit: sjmp Quit ; Hang Forever until reset pressed ; ;=========================================================== ;This subroutine is used to print single character ;trough Port Data ;before printing a character,a busy signal must be detected ;till a low logic received, than a strobe ( --__-- ) pulse ;must be generate to starts printing a character. ;========================================================== Printchar: mov portData,A jb busy,$ setb strobe clr strobe acall delay Setb strobe acall delay ret ; delay: mov R7,#2 del1: mov R6,#20 DJNZ R6,$ DJNZ R7,del1 ret ;=========================================================== ;This subroutine is used to print a text ' Welcome To' ;this subroutine will print character by character till '$' ;character is detected, when this character is detected then ;It's indicated that a text has finished ;=========================================================== word_welcome: mov DPTR,#Text_welcome lagi1: clr A movc A,@A+DPTR cjne A,#'$',Print1 sjmp Out1 Print1: call Printchar inc dptr call delay sjmp lagi1 Out1: ret ; ;=========================================================== ;This subroutine is used to print a text ' Computer Laboratorium' ;this subroutine will print character by character till '$' ;character is detected, when this character is detected then ;It's indicated that a text has finished ;========================================================== word_Lab: mov DPTR,#Text_lab lagi2: clr A movc A,@A+DPTR cjne A,#'$',Print2 sjmp Out2 Print2: call Printchar inc dptr call delay sjmp lagi2 Out2: ret ; Enter: mov A,#0dh call printchar call delay mov A,#0ah call printchar ret ; Text_welcome: DB ' Welcome To $' Text_Lab: DB ' Computer Laboratory $' ; end
end
BACK
NEXT
|
|
Lesson 1:
T
o o l
1.1. Programmer
1.2. Edsim
51
1.3. MIDE-51
1.4. ATMEL
ISP
Lesson 2:
Input Output
2.1.LED
2.2.Swicht
2.3.7
Segmen
2.4.LCD
Character
2.5.ADC
2.6.DAC
2.7.Motor
Stepper
2.8.Keypad
Lesson 3:
Timer Counter
3.1.Basic
3.2.Mode
0
3.3.Mode
1
3.4.Mode
2
3.5.Mode
3
Lesson 4:
Serial Comm.
4.1.Basic
4.2.LED
4.3.Rotate
LED
4.2 ADC
4.3.LCD
Lesson 5:
Interuption
5.1.Basic
5.2.Timer
5.2.External
|