GLK12232 & I2C... :p

LK/ELK/VK/PK/OK/MX/GLK/EGLK/GVK/GLT Series

Moderators: Henry, Mods

Post Reply
Dexter
LCD Geek
Posts: 49
Joined: Wed Aug 15, 2001 6:00 pm
Location: Chicago
Contact:

GLK12232 & I2C... :p

Post by Dexter »

hello
i moved the GLK from the PIC serial port to the I2C bus. Only problem is that there is high error (characters are lost, garbled, skipped). I have the bus speed set for 100kBps (10khz) operation.

I infact CAN connect to the GLK. my host unit ignores ACK.

i have tried various delay times in between sends, and nothing seems to work. are there any specific timing considerations i should be aware of?

(btw, display works great on PIC serial port:
Image)
:D :D

this is a snippet of my write code:

Code: Select all

call i2c_start
movlw h'50' ;LCD write address
call i2c_write
movlw 'H' 
call i2c_write
movlw 'e' 
call i2c_write
movlw 'l' 
call i2c_write
movlw 'l' 
call i2c_write
movlw 'o' 
call i2c_write
call i2c_stop
that should work fine, right? the PIC16F877 I2C master controller should take care of timing etc.

Henry
OMNIPRESENT
OMNIPRESENT
Posts: 3014
Joined: Tue Aug 14, 2001 6:00 pm
Contact:

Post by Henry »

Have you tried going slower then 100kBps? how much text are you sending? how much of a delay have you tried between characters?

ps. Looking good :D
Henry J.
President
Matrix Orbital

Dexter
LCD Geek
Posts: 49
Joined: Wed Aug 15, 2001 6:00 pm
Location: Chicago
Contact:

Post by Dexter »

okay, i found my problem. once again..ugh..lets just say im stupid. ;)

my send macro routine would call an i2c_start, and then send the address, and then character, and then call an i2c_stop. for EACH character. this obviously but too much strain onthe bus with all the starts and stops.

now the code just calls for a start, writes address, writes all characters, and then calls stop.

so it works nice. i just am wondering about fonts now. i am using the Clean font, and id like to add a degree sign to the font, instead of making a custom bitmap. could you tell me how to do this? i went to MOGD, made a new font, called it Clean_Extended, set it to end on 253. then i went to character map to see what the code for

Henry
OMNIPRESENT
OMNIPRESENT
Posts: 3014
Joined: Tue Aug 14, 2001 6:00 pm
Contact:

Post by Henry »

with the font bitmaps, you will have to make your degree symbol as the next available font... so if clean is 165 last character, then 166. Also, make sure you change the mgf file if you are using it MOGD to upload.
Henry J.
President
Matrix Orbital

Dexter
LCD Geek
Posts: 49
Joined: Wed Aug 15, 2001 6:00 pm
Location: Chicago
Contact:

Post by Dexter »

the last font in Clean is 126. so i change the last one to 127, and draw the bitmap, upload the font. but how to get the the LCD to display the character. do i use ALT 0127 then, to display the sign in MOGD? what would i use in my code to display the character? decimal 127?

edit: okay cool, it works. :p :D thanks

Henry
OMNIPRESENT
OMNIPRESENT
Posts: 3014
Joined: Tue Aug 14, 2001 6:00 pm
Contact:

Post by Henry »

good good :)
Henry J.
President
Matrix Orbital

Dexter
LCD Geek
Posts: 49
Joined: Wed Aug 15, 2001 6:00 pm
Location: Chicago
Contact:

problem

Post by Dexter »

slight problem...

i can talk on I2C to the LCD fine, if i do it BEFORE i talk to the temp sensors. if i talk to the temp sensors first, get the data and then try to talk to the LCD, it doesnt work. i think i can work around this but i find it a little bit odd.
any ideas why this might happen?

Henry
OMNIPRESENT
OMNIPRESENT
Posts: 3014
Joined: Tue Aug 14, 2001 6:00 pm
Contact:

Post by Henry »

The only thing I can think of is that your not sending the stop properly...
Henry J.
President
Matrix Orbital

Post Reply