Cetak Printer Epson tmu-210 dengan Mikrokontroler


Untuk Beli Produk Silahkan Kunjungi WWW.BELJAMOTOMATIS.COM

Nglembur 3 malam untuk dapat program ini sambil hmm, pertama kali saya coba mengikuti cara pemrograman (mode nibble) karena melihat di datasheet printer epson ini tanpa mengetahui fungsinya. ternyata fungi nibble ini untuk mengambil data dari printer ke cpu (host), padahal yang saya perlukan adalah mengirimkan data dari host ke peripheral (printer). akhirnya kembali lagi ke proses pengiriman data 8 bit menggunakan mode kompatibilitas standar IEEE1284.
Kelebihan printer ini terdapat autocutter jadi dapat memotong kertas otomatis menggunakan software.

Gambar Printer

Hasil Cetakan

1. Compatibility Mode
This mode defines the protocol used by most PCs to transfer data to a printer. It is commonly called the “Centronics” mode and is the method utilized with the standard parallel port. In this mode, data is placed on the port’s data lines, the printer status is checked for no errors and that it is not Busy, and then a data Strobe is generated by the software to clock the data to the printer. Figure 1 describes this transfer.

2. Nibble Mode
The Nibble mode is the most common way to get reverse channel data from a printer or peripheral. This mode is usually combined with the Compatibility mode or a proprietary forward channel mode to create a complete bi-directional channel.

All of the standard parallel ports provide 5 lines from the peripheral to the PC to be used for external status indications. Using these lines, a peripheral can send a byte of data (8-bits) by sending 2 nibbles (4-bits) of information to the PC in two data transfer cycles. Unfortunately, since the nACK line is generally used to provide a peripheral interrupt, the bits used to transfer a nibble are not conveniently packed into the byte defined by the Status register. For this reason, the software must read the status byte and then manipulate the bits in order to get a correct byte.


berikut ini contoh skematiknya cetak printer dengan mikrokontroler


Gambar Printer

Listing Programnya
;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
; EPSON TMU_210
;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!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

PRINT_DATA: clr A
movc A,@A+DPTR
cjne A,#’$’,Print1
sjmp Out1
Print1: call MASUKAN
inc dptr
sjmp PRINT_DATA
Out1: ret

PRINT_SATUAN: PUSH ACC
mov A,#’2′
CALL MASUKAN
mov A,#’5′
CALL MASUKAN
mov A,#’5′
CALL MASUKAN
POP ACC
RET

MASUKAN: MOV PORTDATA,A
WAIT: JB BUSY,WAIT ;JIKA BUSY MAKA LOMPAT WAIT (TUNGGU)
CLR STROBE
NOP ;1
NOP ;2
NOP ;3
NOP ;4
SETB STROBE
CALL DELAY
RET

ENTER: PUSH ACC
MOV A,#0AH
ACALL MASUKAN
POP ACC
RET

Potong_kertas: PUSH ACC
mov A,#29
CALL MASUKAN
mov A,#86
CALL MASUKAN
mov A,#48
CALL MASUKAN
POP ACC
ret
RET

;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
; INISIALISASI PRINTER !!!
;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
INISIALISASI_TMU210:
PUSH ACC
SETB INIT
SETB AUTO ;SET: INIT=HI, SEL INP=LOW, AUTOFEED=HI, STROBE=HI
SETB STROBE
MOV A,#1BH ;1B=ESC (DATA PERINTAH)
ACALL MASUKAN
MOV A,#40H ;40=@ (DATA INISIALISASI)
ACALL MASUKAN
POP ACC

;xxxxxxxxx POSISI PRINTxxxxxxxx

PUSH ACC
MOV A,#27 ;1B=ESC (DATA PERINTAH)
ACALL MASUKAN
MOV A,#97
ACALL MASUKAN
MOV A,#49
ACALL MASUKAN
POP ACC

;xxxxxxx FONT LEBAR xxxx

PUSH ACC
MOV A,#27
ACALL MASUKAN
MOV A,#33
ACALL MASUKAN
MOV A,#32
ACALL MASUKAN
POP ACC
;zzzzzzzzzzzzzzzzzzzzzzzzzzzz
;zzzzzzzz FONT Jenis zzzzzzzzz
;zzzzzzzzzzzzzzzzzzzzzzzzzzzz
PUSH ACC
MOV A,#27
ACALL MASUKAN
MOV A,#77
ACALL MASUKAN
MOV A,#49
POP ACC

;WWWW AMBIL KERTAS WWWW
CALL ENTER
ret

delay: mov R7,#0
del1: mov R6,#200
DJNZ R6,$
DJNZ R7,del1
ret

DATA_1: DB ‘ BANK SINDHU $’
DATA_2: DB ‘NOMOR ANTRIAN $’

end

4 thoughts on “Cetak Printer Epson tmu-210 dengan Mikrokontroler

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s