Jump to content

4 bit lcd - how to change mios


Niijaooh
 Share

Recommended Posts

Hey people

I have problems with some missing/wrong characters on my 4*20 lcd (only using 2 lines) on my Midibox Sid. It's a lcd i took from a ISDN phone and it has two hd44780 controllers. I've resoldered the connections a couple of times but it's the same. I've seen others with the same problems in this forum but no solutions.

I therefore want to try out a 4 bit ks0066 20*2 LCD that I have and it is now I need your help.

I've looked a bit on how to change the source of mios so that it works in 4 bit but I can't figure it out and I don't know how to recompile it. I have absolutely no experience with programming, compiling and that.

If anyone would do this for me and send me the .syx or give me precise walkthrough and/or links on how it is done, I would be very grateful.

Thanks in advance.

Best regards,

Niijaooh

Link to comment
Share on other sites

Hi,

Modification is done to the main.asm of the application - MIOS already supports 4bit lcd interface.

Pick one:

http://www.midibox.org/cgi-bin/yabb/YaBB.cgi?board=troubleshooting;action=display;num=1097827380

http://www.midibox.org/cgi-bin/yabb/YaBB.cgi?board=parts_q;action=display;num=1074447664

for reference, how to do this.

Bye, Moebius

Link to comment
Share on other sites

Hi,

Err.. actually USER_Init is located in sid_init.inc in sid application. My fault.. :-/

But still, this shouldn't be too complicated to understand: Search for text USER_Init, in sid_init.inc and add:

       ;; Initialize 4bit LCD mode

     movlw   0x37 | 0x80     ; E1: D.7, 4bit interface

     movwf   MIOS_PARAMETER1

     movlw   0x24 | 0x80     ; E2: C.4, 4bit interface

     movwf   MIOS_PARAMETER2

     movlw   0x00  ; LCD type 0

     call    MIOS_LCD_TypeSet

Directly under that line.. Don't replace or delete anything, just add. This can be done with your favourite text editor.. err, like Notepad ;) (Or in MPLAB IDE, but don't ask about it, as I don't have it)

There are compiling instructions in HOWTOs section at http://www.ucapps.de.. Just pick that verision of a sid app (*.asm) that you'll be using. Also conversion to .syx is pretty straight forward.. like clicking convert.bat, and then choosing right .syx to upload.

If these instructions aren't enough - Do you prefer pre-compiled version?

Bye, Moebius

Link to comment
Share on other sites

hello

I've tried what you said and i've made a new main.syx (of the sid app) and uploaded but it is still in 8 bit because there are only 0's and some black boxes.

By the way will the placement af the characters be the same when using a 4 bit lcd in 8 bit mode because there a only symbols in the last 5 boxes on each line?

Still i've would like if mios was changed aswell so that it would show the startup message.

Will u send me or link to some precompiled versions? It would be a great help. maybe I did something wrong.

Best regards,

Niijaooh

Link to comment
Share on other sites

Hi,

By the way will the placement af the characters be the same when using a 4 bit lcd in 8 bit mode because there a only symbols in the last 5 boxes on each line?

Nothing else changes, but data bytes are split to two nibbles which are then transferred in two cycles.

Still i've would like if mios was changed aswell so that it would show the startup message.

Err.. should be possible, but I haven't examined MIOS that much yet.

Will u send me or link to some precompiled versions? It would be a great help. maybe I did something wrong.

I made precompiled versions - only changed to use 4bit mode.

Bye, Moebius

p.s. I don't know that much about LCD problems - but are you sure you have connection right..

Link to comment
Share on other sites

Hi......

mmmmm I also had this exact same problem with a 4x40.

It was really easy to  solve no need to switch to 4 bits or anything like that. Make sure you have the 2nd enable line (unused) tied to ground and all should be fine.

Hope that solves your problems?

pEaCe

LO

edit; thanks to TK for helping me to troubleshoot that one!

Link to comment
Share on other sites

Hello again.

The 4 bit lcd is working sort of. It was a connection problem  :-[ and my own compiled . syx worked aswell but thank you so much Moebius for helping! I knew your .syx was right so i looked at the wire on the lcd (actually a very thin data cable with very small solder points) and two small copperwire threads were tuching another wire even though i had separated all the bigger wires. Makes sense? Well i hope you get the idea ;) My setup is quite a mess  ::) because im only testing and dont have a box or cs yet.

Now i just have one problem! It only uses the first line. Like

P  1Inte 1al1----ch

I think it must be the connection. Dont you?I will look in to soon and give you some feedback if i get it to work.

Best regards,

Niijaooh

edit: spelling

Link to comment
Share on other sites

Hi,

I knew your .syx was right
You're more confident about my skills than I am ;)

..so i looked at the wire on the lcd (actually a were thin data cable with were small solder points) and two small copperwire threads were tuching another wire even though i had separated all the bigger wires. Makes sense? Well i hope you get the idea ;)

Yes, "The Flat Ribbon Cable From HELL"!! ;D

I think the connection is to blame... (Second line has the same address in every HD44780 (compatible) display, which has under 80 characters).

You have a multimeter?

I recommend you to try putting core and LCD on steady position.. With power off (!! Sorry ;)) - Try measuring if there are connection problems by between LCD and the PIC, by checking resistances between corresponding PIC pins and  LCD PCBs solder taps.. and then measure for shorts between the control lines..

Bye, Moebius

Link to comment
Share on other sites

moebius wrote:

Yes, "The Flat Ribbon Cable From HELL"!!   ;D

Why do people insist on torturing themselves soldering ribbon cable

to the LCD?  I find it much easier to solder a 14 pin single row header

onto the LCD and then terminate the ribbon cable with single row

connectors with insertable pins.  I used 3 4-pin connectors and 1

2-pin connector because that is what I have on hand.  I find it much

easier to make good crimp connections on the connector pins (they

can be reinforced with solder if desired) than solder the ribbon cable

directly to the LCD.  I suppose I should take some pictures and write

this up...  The only drawback I see is that the whole assembly becomes

slightly deeper.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...