Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

gLCD 192x64 with KS0108B (HD6/202/3)

Status
Not open for further replies.

Bazi13

Newbie level 3
Joined
Feb 9, 2007
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,311
ks0108b

Hi, here r many posts about gLCD and KS0108B, but I didn't found many about 192x64 gLCD. I'm trying to writte somenthing on that gLCD using ATmega32 in asm. I'have never use any gLCD and I feel litle confused. I wrote a short programm and i think I can't controle it:/. Could You tell me what is wrong in this :

.include "m32def.inc"
;*********************** *************************
.equ DANA = PORTD ;D
.equ STER = PORTB ;B
.equ RS = 2
.equ RW = 3
.equ E = 4
.equ CS1 = 5
.equ CS2 = 6
.equ CS3 = 7
.equ SYS_FREQ = 16

;*********************** PROG***************************

.cseg
;

ldi R16, high(RAMEND)
out SPH, R16
ldi R16, low(RAMEND)
out SPL, R16


ldi R16, 0xFF
out DDRD, R16
out DDRB, R16
cbi DDRB, DDB1
cbi DDRB, DDB0
ldi R16, 0x00
out DDRA, R16
out DDRC, R16
ldi R16, 0x00
out PORTA, R16
out PORTC, R16

LCD_ON:
sbi STER, E
nop
cbi STER, E
rcall wait_450ns
cbi STER, RW
cbi STER, RS
cbi STER, CS1
cbi STER, CS2
cbi STER, CS3
sbi STER, E
rcall wait_450ns
ldi R20, 0x3F ;DISPLAY ON
out DANA, R20
rcall wait_450ns
cbi STER, E
nop
rjmp stan

ldi R20, 0x50 ;set Y address
rjmp instr
rjmp stan

ldi R20, 0xBB ;set X address
rjmp instr
rjmp stan

ldi R20, 0xC3 ;set Z address
rjmp instr
rjmp stan

ldi R20, 0xE7
rjmp data
rjmp stan

kon:
rjmp kon

instr:
sbi STER, E
nop
cbi STER, E
rcall wait_450ns
cbi STER, RW
sbi STER, RS
cbi STER, CS1
cbi STER, CS2
cbi STER, CS3
sbi STER, E
rcall wait_450ns
out DANA, R20
rcall wait_450ns
cbi STER, E
nop
ret

data:
sbi STER, E
nop
cbi STER, E
rcall wait_450ns
cbi STER, RW
cbi STER, RS
cbi STER, CS1
sbi STER, CS2
sbi STER, CS3
sbi STER, E
rcall wait_450ns
out DANA, R20
rcall wait_450ns
cbi STER, E
nop
ret

stan:
ldi R16, 0x00
out DDRD, R16
petla_stan:
sbi STER, E
nop
cbi STER, E
rcall wait_450ns
sbi STER, RW
cbi STER, RS
sbi STER, E
rcall wait_450ns
in R20, PIND
cbi STER, E
nop
nop
sbrc R20, 7
rjmp wait_450ns

ldi R16, 0xFF
out DDRD, R16
ret

function instr - instruction, function stan- checks bussy flag of gLCD

plizz help me, i don't know why tah doesn't work.... gLCD "draw" some pixels, but I doesn't controlle which ones
 

ks0108b

Hi,

I used that type of display, it has 3 controllers, so you have to initialize all of them. Practical you have 3 screens 64x64 pixels... I've never used asm on AVR, I've wrote in C for PIC's...
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top