I just bought a LK204-25 Rev. 2.0 and I'm trying to control it with a HC908JL3E Motorola microcontroller using i2c, but the only thing I get on the screen is the Matrix Orbital screen on the display. I removed the 0 Ohms resistors from 232 jumpers and soldered them in the i2c jumpers. I'm using 4.7K resistors as pull ups.
My program so far is very simple I just wanted to clear the screen, and write a letter but I can't do even that.
I don't know if soldering the resistor to the I2C jumper can damage the display.
problems with communicating LK204-25 with JL3 Motorola micro
I've already soldered the 0Ohm ressitor onto the I2C jumpers, my concern is that I may have damaged the board, and I want to know if that is possible. Because I've trying to send commands to the screen and it just displays Matrix Orbital logo.
Here is the code of my program for a Motorola HC908JL3E microcontroller. I The program itself it's very simple, it's goal it's to clear the screen but it's not working.
Hope someone can help me
;********************************************
FLASHSTART equ $EC00 ;
PORTA equ $00 ;
DDRA equ $04 ;
;********************************************
; I2C Emulate lines on Port A pins
; We need a clock (SCL) and a data lines (SDA)
;********************************************
SCL equ 1 ;PTA1 as a clock
SDA equ 2 ;PTA2 as data
LCDADDR equ $50 ; LCD Address
;********************************************
; Variables de la RAM
;********************************************
BitCounter equ $80 ;Counts Tx bits
Value equ $81 ;Store data value
;********************************************
; Program code start
;********************************************
org FLASHSTART
Inicio
;Set variables
clr Value
clr BitCounter
;Config SCL and SDA lines
lda #$06 ;PTA1 y PTA2 as out
sta PORTA ;PA1 y PTA2 high on start
sta DDRA
;*******************************************
; Maing program
;
;*******************************************
Loop
lda #$58
sta Value
jsr SendIt
bra Loop
;*******************************************
; Send data includint start, address, data and stop
;*******************************************
SendIt ;
jsr I2CStartBit
;LCD Address
lda #LCDADDR ;
jsr I2CTxByte ;
;Bytes de datos
lda #$FE ;$FE command instruction
jsr I2CTxByte ;
lda Value ;
jsr I2CTxByte ;
;Stop condition
jsr I2CStopbit
jsr I2CBitDelay
rts
;******************************************
; I2CTxByte
; Tx Accumulator data
;******************************************
I2CTxByte
;
ldx #$08
stx BitCounter
I2CNextBit
rola ;Send MSB to carry
bcc SendLow ;high or low?
SendHigh
bset SDA,PORTA ;
jsr I2CSetupDelay ;Wait until line restores
bset SCL,PORTA ;Clock
jsr I2CBitDelay ;bit delay
bra I2CTxCount ;
SendLow bclr SDA,PORTA
jsr I2CSetupDelay
bset SCL,PORTA
jsr I2CBitDelay
I2CTxCount bclr SCL,PORTA ;clock back to low
dec BitCounter ;
beq I2CAckPoll ;Last bit?
bra I2CNextBit
I2CAckPoll
bset SDA,PORTA
bclr SDA,DDRA ;SDA as input
jsr I2CSetupDelay
bset SCL,PORTA ;clock high
jsr I2CBitDelay
brset SDA,PORTA,I2CNoAck ;wait ACK
bclr SCL,PORTA ; clock back to zero
bset SDA,DDRA ;SDA as output
rts
;If there is no answer just restablish bus
I2CNoAck
bclr SCL,PORTA
bset SDA,DDRA
rts
;**************************************************************
; I2CStartBit
;
;**************************************************************
I2CStartBit
bclr SDA,PORTA
jsr I2CBitDelay
bclr SCL,PORTA
rts
;*************************************************************
; I2CStopBit
;
;*************************************************************
I2CStopBit
bclr SDA,PORTA
bset SCL,PORTA
bset SDA,PORTA
jsr I2CBitDelay
rts
;**************************************************************
; I2CBitDelay
;
;**************************************************************
I2CSetupDelay
nop
nop
nop
nop
nop
nop
rts
;**************************************************************
; I2CBitDelay
;
;**************************************************************
I2CBitDelay
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
rts
;**************************************************************
; Vector definition
;**************************************************************
org $FFFE ;reset vector
dw Inicio
Here is the code of my program for a Motorola HC908JL3E microcontroller. I The program itself it's very simple, it's goal it's to clear the screen but it's not working.
Hope someone can help me
;********************************************
FLASHSTART equ $EC00 ;
PORTA equ $00 ;
DDRA equ $04 ;
;********************************************
; I2C Emulate lines on Port A pins
; We need a clock (SCL) and a data lines (SDA)
;********************************************
SCL equ 1 ;PTA1 as a clock
SDA equ 2 ;PTA2 as data
LCDADDR equ $50 ; LCD Address
;********************************************
; Variables de la RAM
;********************************************
BitCounter equ $80 ;Counts Tx bits
Value equ $81 ;Store data value
;********************************************
; Program code start
;********************************************
org FLASHSTART
Inicio
;Set variables
clr Value
clr BitCounter
;Config SCL and SDA lines
lda #$06 ;PTA1 y PTA2 as out
sta PORTA ;PA1 y PTA2 high on start
sta DDRA
;*******************************************
; Maing program
;
;*******************************************
Loop
lda #$58
sta Value
jsr SendIt
bra Loop
;*******************************************
; Send data includint start, address, data and stop
;*******************************************
SendIt ;
jsr I2CStartBit
;LCD Address
lda #LCDADDR ;
jsr I2CTxByte ;
;Bytes de datos
lda #$FE ;$FE command instruction
jsr I2CTxByte ;
lda Value ;
jsr I2CTxByte ;
;Stop condition
jsr I2CStopbit
jsr I2CBitDelay
rts
;******************************************
; I2CTxByte
; Tx Accumulator data
;******************************************
I2CTxByte
;
ldx #$08
stx BitCounter
I2CNextBit
rola ;Send MSB to carry
bcc SendLow ;high or low?
SendHigh
bset SDA,PORTA ;
jsr I2CSetupDelay ;Wait until line restores
bset SCL,PORTA ;Clock
jsr I2CBitDelay ;bit delay
bra I2CTxCount ;
SendLow bclr SDA,PORTA
jsr I2CSetupDelay
bset SCL,PORTA
jsr I2CBitDelay
I2CTxCount bclr SCL,PORTA ;clock back to low
dec BitCounter ;
beq I2CAckPoll ;Last bit?
bra I2CNextBit
I2CAckPoll
bset SDA,PORTA
bclr SDA,DDRA ;SDA as input
jsr I2CSetupDelay
bset SCL,PORTA ;clock high
jsr I2CBitDelay
brset SDA,PORTA,I2CNoAck ;wait ACK
bclr SCL,PORTA ; clock back to zero
bset SDA,DDRA ;SDA as output
rts
;If there is no answer just restablish bus
I2CNoAck
bclr SCL,PORTA
bset SDA,DDRA
rts
;**************************************************************
; I2CStartBit
;
;**************************************************************
I2CStartBit
bclr SDA,PORTA
jsr I2CBitDelay
bclr SCL,PORTA
rts
;*************************************************************
; I2CStopBit
;
;*************************************************************
I2CStopBit
bclr SDA,PORTA
bset SCL,PORTA
bset SDA,PORTA
jsr I2CBitDelay
rts
;**************************************************************
; I2CBitDelay
;
;**************************************************************
I2CSetupDelay
nop
nop
nop
nop
nop
nop
rts
;**************************************************************
; I2CBitDelay
;
;**************************************************************
I2CBitDelay
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
rts
;**************************************************************
; Vector definition
;**************************************************************
org $FFFE ;reset vector
dw Inicio
Rodrigo