INTERFACE MODUL P10 DENGAN AT89S52


Mempelajari modul p10 ini dengan membaca rangkaian dan ic 2 yang digunakan untuk mengendalikan modul ini.

Ic yang digunakan pada modul p10 ini antara lain adalah:

74245 = Octal bus Transceiver (sebagai penyangga data dari mikrokontroler)

7404 = Hex inverter sebagai pengendali pin OE (meredupkan led atau membuat led menjadi terang menggunakan teknik PWM)

74138 = demultiplexer 3 channel A,B,C, tetapi yang dpakai modul p 10 ini hanya chanel a dan b untuk kendalikan 4 ic 4953 sebagai penunjuk data bars yang mau dinyalakan

4953 = mosfet dual channel sebagai pengendali 16 baris modul p10 16×32 kolom

74595 = pengendali kolom atau 8bit serial in dan paralel output berjumlah 16 untuk kendalikan data 32 kolom

10659310_1502239850047711_392175578051338579_n

 

Video lihat DISINI

Penjelasan singkat diagram blok 1 panel p10

Diagram p10

 

Port yang digunakan untuk mengendalikan panel p10 ini , bebas dikoneksikan dengan pin mikrokontroler :

1. port OE 7404 (output enable) nyala = 1, mati =0

2. port A

3. Port B

4. Port SH 74595

5. Port ST 74595

6. Port DS 74595

 

Berikut ini contoh kode program asmbly menampilkan karakter huruf AA di modul p10 1 panel

;#define Output_Enable PORTD.0 //Output
;#define Data_A PORTD.1 //Data Merah = 0
;#define Data_B PORTD.2 //Data Merah = 0

;#define HC595_SH_CP PORTD.3 //Shift Clock (SH_CP) pin location
;#define HC595_ST_CP PORTD.4 //Store Clock (ST_CP) pin location
;#define HC595_DS PORTD.5 //Data pin (DS)
;#########################################################################;
led bit p0.0
I2C_SDA BIT P0.4
I2C_SCL BIT P0.3

O_E bit p1.0
D_A bit p1.1
D_B bit p1.2

S_H bit p2.5
S_T bit p2.6
D_S bit p2.7
;#########################################################################;
; alamat Ram

DPTR_HIGH equ 1eh
DPTR_LOW equ 1fh

Free_1 equ 2dh
Free_2 equ 2eh
TMP equ 2fh

Led_1a equ 30h
Led_2a equ 31h
Led_3a equ 32h
Led_4a equ 33h

Led_1b equ 34h
Led_2b equ 35h
Led_3b equ 36h
Led_4b equ 37h

Led_1c equ 38h
Led_2c equ 39h
Led_3c equ 3ah
Led_4c equ 3bh

Led_1d equ 3ch
Led_2d equ 3dh
Led_3d equ 3eh
Led_4d equ 3fh
;#########################################################################;
; alamat eeprom
rm01 equ 64
rm02 equ 96
rm03 equ 128
rm04 equ 160
rm05 equ 192
rm06 equ 224
rm07 equ 0
;#########################################################################;
org 0h
;mov Led_1a,#00000000b
;mov Led_2a,#00h
;mov Led_3a,#0ffh
;mov Led_4a,#0ffh

;mov Led_1b,#00h
;mov Led_2b,#0ffh
;mov Led_3b,#0ffh
;mov Led_4b,#0ffh

;mov Led_1c,#00h
; mov Led_2c,#0ffh
;mov Led_3c,#0ffh
;mov Led_4c,#0ffh

;mov Led_1d,#00h
;mov Led_2d,#0ffh
;mov Led_3d,#0ffh
;mov Led_4d,#0ffh

mulai: mov DPTR,#RESTART
call tampil_15_huruf

tunggu: call Konversi_a
call Konversi_b
call tampil_a
;call tampil_b
;call tampil_c
;call tampil_d
jmp tunggu
;##########################################################################
; Tampilan Dotmatrix
;##########################################################################
Konversi_a: mov R0,#rm01
call konvert_b1
mov led_1a,a
inc r0
inc r0
call konvert_b1
mov led_2a,a
inc r0
inc r0
call konvert_b1
mov led_3a,a
inc r0
inc r0
call konvert_b1
mov led_4a,a

mov R0,#rm01
call konvert_b1
mov led_1b,a
inc r0
inc r0
call konvert_b1
mov led_2b,a
inc r0
inc r0
call konvert_b1
mov led_3b,a
inc r0
inc r0
call konvert_b1
mov led_4b,a
ret

Konversi_b: mov R0,#rm01+1
call konvert_b1
mov led_1c,a
inc r0
inc r0
call konvert_b1
mov led_2c,a
inc r0
inc r0
call konvert_b1
mov led_3c,a
inc r0
inc r0
call konvert_b1
mov led_4c,a

mov R0,#rm01+1
call konvert_b1
mov led_1d,a
inc r0
inc r0
call konvert_b1
mov led_2d,a
inc r0
inc r0
call konvert_b1
mov led_3d,a
inc r0
inc r0
call konvert_b1
mov led_4d,a
ret
;#########################################################################;
C_data: CLR S_H
CLR S_H
Clr S_T
CLR S_T

mov A,Led_1d
Call HC595_Shift
mov A,Led_1c
Call HC595_Shift
mov A,Led_1b
Call HC595_Shift
mov A,Led_1a
Call HC595_Shift

mov A,Led_2d
Call HC595_Shift
mov A,Led_2c
Call HC595_Shift
mov A,Led_2b
Call HC595_Shift
mov A,Led_2a
Call HC595_Shift

mov A,Led_3d
Call HC595_Shift
mov A,Led_3c
Call HC595_Shift
mov A,Led_3b
Call HC595_Shift
mov A,Led_3a
Call HC595_Shift

mov A,Led_4d
Call HC595_Shift
mov A,Led_4c
Call HC595_Shift
mov A,Led_4b
Call HC595_Shift
mov A,Led_4a
Call HC595_Shift

Clr S_T
Clr S_T
SetB S_T
SetB S_T
Ret

HC595_Shift:MOV R2,#8
HC595_ShLop:RLC A
MOV D_S,C
SetB S_H
SetB S_H
CLR S_H
CLR S_H
DJNZ R2,HC595_ShLop
Ret

Tampil_a: clr d_a
clr d_b
call C_data
setb o_e
call pwm
ret
Tampil_b: setb d_a
clr d_b
call C_data
setb o_e
call pwm
ret
Tampil_c: clr d_a
setb d_b
call C_data
setb o_e
call pwm
ret
Tampil_d: setb d_a
setb d_b
call C_data
setb o_e
call pwm
ret

pwm: call D_100us
clr o_e
call D_2ms
ret

D_100us: MOV R7,#1
T1D: MOV R6,#100
DJNZ R6,$
DJNZ R7,T1D
Ret

D_2ms: MOV R7,#25
T2D: MOV R6,#100
DJNZ R6,$
DJNZ R7,T2D
Ret

RESTART: DB ‘AA’,0ffh
;##########################################################################
tampil_15_huruf: clr a
movc A,@A+DPTR
call k_m_1
inc dptr
clr a
movc A,@A+DPTR
call k_m_2
ret
;##########################################################################
; KONVERSI 1 ASCII KE DATA DOT MATRIK
;##########################################################################
K_m_1: mov R0,#rm01
call scan_huruf
ret
K_m_2: mov R0,#rm02
call scan_huruf
ret
;##########################################################################
; Konversi Ascii ke Dot Matrix
; Dibuat oleh Sindhu Harimukti
; Jumat 03 agustus 2012
;##########################################################################
Scan_Huruf:
A0: cjne a,#’A’,keluar
mov free_2,#32
mov DPTR_high,dph
mov DPTR_low,dpl
mov DPTR,#data_H_AK
jmp Ambil_data_matrix

keluar: inc r0
mov @r0,#0ffh
ret
;##########################################################################
Ambil_data_matrix:clr a
movc A,@A+DPTR
MOV @R0,A
inc r0
inc dptr
djnz free_2,Ambil_data_matrix
mov Dph,DPTR_high
mov dpl,DPTR_low
ret
;##########################################################################
; Data Font Matrix 16×16
; Dibuat oleh Sindhu Harimukti
; sunday 03 feb 2013
;##########################################################################
data_H_AK: db 0h,00h
db 0h,81h
db 0h,0e1h
db 08h,70h
db 0ch,30h
db 0fh,20h
db 0c3h,20h
db 0e0h,20h
db 0e0h,20h
db 0c3h,20h
db 0fh,20h
db 0ch,30h
db 08h,70h
db 00h,0e1h
db 0h,81h
db 0h,00h
;##########################################################################
konvert_b1: clr a
mov 20h,@r0
jb 20h.0,C00
clr acc.0
jmp c1
c00: setb acc.0

c1: inc r0
inc r0
mov 20h,@r0
jb 20h.0,C11
clr acc.1
jmp c2
c11: setb acc.1

c2: inc r0
inc r0
mov 20h,@r0
jb 20h.0,C22
clr acc.2
jmp c3
c22: setb acc.2

c3: inc r0
inc r0
mov 20h,@r0
jb 20h.0,C33
clr acc.3
jmp c4
c33: setb acc.3

c4: inc r0
inc r0
mov 20h,@r0
jb 20h.0,C44
clr acc.4
jmp c5
c44: setb acc.4

c5: inc r0
inc r0
mov 20h,@r0
jb 20h.0,C55
clr acc.5
jmp c6
c55: setb acc.5

c6: dec r0
dec r0
mov 20h,@r0
jb 20h.0,C66
clr acc.6
jmp c7
c66: setb acc.6

c7: inc r0
inc r0
mov 20h,@r0
jb 20h.0,C77
clr acc.7
jmp c8
c77: setb acc.7

c8: ret
;##########################################################################
konvert_b2: clr a
mov 20h,@r0
jb 20h.1,C00b
clr acc.0
jmp c1b
c00b: setb acc.0

c1b: inc r0
inc r0
mov 20h,@r0
jb 20h.1,C11b
clr acc.1
jmp c2b
c11b: setb acc.1

c2b: inc r0
inc r0
mov 20h,@r0
jb 20h.1,C22b
clr acc.2
jmp c3b
c22b: setb acc.2

c3b: inc r0
inc r0
mov 20h,@r0
jb 20h.1,C33b
clr acc.3
jmp c4b
c33b: setb acc.3

c4b: inc r0
inc r0
mov 20h,@r0
jb 20h.1,C44b
clr acc.4
jmp c5b
c44b: setb acc.4

c5b: inc r0
inc r0
mov 20h,@r0
jb 20h.1,C55b
clr acc.5
jmp c6b
c55b: setb acc.5

c6b: inc r0
inc r0
mov 20h,@r0
jb 20h.1,C66b
clr acc.6
jmp c7b
c66b: setb acc.6

c7b: inc r0
inc r0
mov 20h,@r0
jb 20h.1,C77b
clr acc.7
jmp c8b
c77b: setb acc.7

c8b: ret

;##########################################################################
konvert_b3: clr a
mov 20h,@r0
jb 20h.2,C00c
clr acc.0
jmp c1c
c00c: setb acc.0

c1c: inc r0
inc r0
mov 20h,@r0
jb 20h.2,C11c
clr acc.1
jmp c2c
c11c: setb acc.1

c2c: inc r0
inc r0
mov 20h,@r0
jb 20h.2,C22c
clr acc.2
jmp c3c
c22c: setb acc.2

c3c: inc r0
inc r0
mov 20h,@r0
jb 20h.2,C33c
clr acc.3
jmp c4c
c33c: setb acc.3

c4c: inc r0
inc r0
mov 20h,@r0
jb 20h.2,C44c
clr acc.4
jmp c5c
c44c: setb acc.4

c5c: inc r0
inc r0
mov 20h,@r0
jb 20h.2,C55c
clr acc.5
jmp c6c
c55c: setb acc.5

c6c: inc r0
inc r0
mov 20h,@r0
jb 20h.2,C66c
clr acc.6
jmp c7c
c66c: setb acc.6

c7c: inc r0
inc r0
mov 20h,@r0
jb 20h.2,C77c
clr acc.7
jmp c8c
c77c: setb acc.7

c8c: ret
;##########################################################################
konvert_b4: clr a
mov 20h,@r0
jb 20h.3,C00d
clr acc.0
jmp c1d
c00d: setb acc.0

c1d: inc r0
inc r0
mov 20h,@r0
jb 20h.3,C11d
clr acc.1
jmp c2d
c11d: setb acc.1

c2d: inc r0
inc r0
mov 20h,@r0
jb 20h.3,C22d
clr acc.2
jmp c3d
c22d: setb acc.2

c3d: inc r0
inc r0
mov 20h,@r0
jb 20h.3,C33d
clr acc.3
jmp c4d
c33d: setb acc.3

c4d: inc r0
inc r0
mov 20h,@r0
jb 20h.3,C44d
clr acc.4
jmp c5d
c44d: setb acc.4

c5d: inc r0
inc r0
mov 20h,@r0
jb 20h.3,C55d
clr acc.5
jmp c6d
c55d: setb acc.5

c6d: inc r0
inc r0
mov 20h,@r0
jb 20h.3,C66d
clr acc.6
jmp c7d
c66d: setb acc.6

c7d: inc r0
inc r0
mov 20h,@r0
jb 20h.3,C77d
clr acc.7
jmp c8d
c77d: setb acc.7

c8d: ret
;##########################################################################
konvert_b5: clr a
mov 20h,@r0
jb 20h.4,C00e
clr acc.0
jmp c1e
c00e: setb acc.0

c1e: inc r0
inc r0
mov 20h,@r0
jb 20h.4,C11e
clr acc.1
jmp c2e
c11e: setb acc.1

c2e: inc r0
inc r0
mov 20h,@r0
jb 20h.4,C22e
clr acc.2
jmp c3e
c22e: setb acc.2

c3e: inc r0
inc r0
mov 20h,@r0
jb 20h.4,C33e
clr acc.3
jmp c4e
c33e: setb acc.3

c4e: inc r0
inc r0
mov 20h,@r0
jb 20h.4,C44e
clr acc.4
jmp c5e
c44e: setb acc.4

c5e: inc r0
inc r0
mov 20h,@r0
jb 20h.4,C55e
clr acc.5
jmp c6e
c55e: setb acc.5

c6e: inc r0
inc r0
mov 20h,@r0
jb 20h.4,C66e
clr acc.6
jmp c7e
c66e: setb acc.6

c7e: inc r0
inc r0
mov 20h,@r0
jb 20h.4,C77e
clr acc.7
jmp c8e
c77e: setb acc.7

c8e: ret
;##########################################################################
konvert_b6: clr a
mov 20h,@r0
jb 20h.5,C00f
clr acc.0
jmp c1f
c00f: setb acc.0

c1f: inc r0
inc r0
mov 20h,@r0
jb 20h.5,C11f
clr acc.1
jmp c2f
c11f: setb acc.1

c2f: inc r0
inc r0
mov 20h,@r0
jb 20h.5,C22f
clr acc.2
jmp c3f
c22f: setb acc.2

c3f: inc r0
inc r0
mov 20h,@r0
jb 20h.5,C33f
clr acc.3
jmp c4f
c33f: setb acc.3

c4f: inc r0
inc r0
mov 20h,@r0
jb 20h.5,C44f
clr acc.4
jmp c5f
c44f: setb acc.4

c5f: inc r0
inc r0
mov 20h,@r0
jb 20h.5,C55f
clr acc.5
jmp c6f
c55f: setb acc.5

c6f: inc r0
inc r0
mov 20h,@r0
jb 20h.5,C66f
clr acc.6
jmp c7f
c66f: setb acc.6

c7f: inc r0
inc r0
mov 20h,@r0
jb 20h.5,C77f
clr acc.7
jmp c8f
c77f: setb acc.7

c8f: ret
;##########################################################################
konvert_b7: clr a
mov 20h,@r0
jb 20h.6,C00g
clr acc.0
jmp c1g
c00g: setb acc.0

c1g: inc r0
inc r0
mov 20h,@r0
jb 20h.6,C11g
clr acc.1
jmp c2g
c11g: setb acc.1

c2g: inc r0
inc r0
mov 20h,@r0
jb 20h.6,C22g
clr acc.2
jmp c3g
c22g: setb acc.2

c3g: inc r0
inc r0
mov 20h,@r0
jb 20h.6,C33g
clr acc.3
jmp c4g
c33g: setb acc.3

c4g: inc r0
inc r0
mov 20h,@r0
jb 20h.6,C44g
clr acc.4
jmp c5g
c44g: setb acc.4

c5g: inc r0
inc r0
mov 20h,@r0
jb 20h.6,C55g
clr acc.5
jmp c6g
c55g: setb acc.5

c6g: inc r0
inc r0
mov 20h,@r0
jb 20h.6,C66g
clr acc.6
jmp c7g
c66g: setb acc.6

c7g: inc r0
inc r0
mov 20h,@r0
jb 20h.6,C77g
clr acc.7
jmp c8g
c77g: setb acc.7

c8g: ret
;##########################################################################
konvert_b8: clr a
mov 20h,@r0
jb 20h.7,C00H
clr acc.0
jmp c1H
c00H: setb acc.0

c1H: inc r0
inc r0
mov 20h,@r0
jb 20h.7,C11H
clr acc.1
jmp c2H
c11H: setb acc.1

c2H: inc r0
inc r0
mov 20h,@r0
jb 20h.7,C22H
clr acc.2
jmp c3H
c22H: setb acc.2

c3H: inc r0
inc r0
mov 20h,@r0
jb 20h.7,C33H
clr acc.3
jmp c4H
c33H: setb acc.3

c4H: inc r0
inc r0
mov 20h,@r0
jb 20h.7,C44H
clr acc.4
jmp c5H
c44H: setb acc.4

c5H: inc r0
inc r0
mov 20h,@r0
jb 20h.7,C55H
clr acc.5
jmp c6H
c55H: setb acc.5

c6H: inc r0
inc r0
mov 20h,@r0
jb 20h.7,C66H
clr acc.6
jmp c7H
c66H: setb acc.6

c7H: inc r0
inc r0
mov 20h,@r0
jb 20h.7,C77H
clr acc.7
jmp c8H
c77H: setb acc.7

c8H: ret

end

 

SELAMAT MENCOBA !!!