Jump to content

possible CLCD driver bug in MIOS32 ?


norbim1
 Share

Recommended Posts

Hi all,

I tried to use a 2*20 LCD (type JHD202C with standard HD44780 like chip) with LPC core, but it was unsuccesful. After I checked all the connections and soldering, I compared the universal LCD driver with the datasheet. I found in the LCD init part of the universal LCD driver code :

// initialize LCD

MIOS32_BOARD_J15_DataSet(0x38);

MIOS32_BOARD_J15_RS_Set(0);

MIOS32_BOARD_J15_E_Set(mios32_lcd_device, 1);

MIOS32_BOARD_J15_E_Set(mios32_lcd_device, 0);

MIOS32_BOARD_J15_RW_Set(0);

MIOS32_DELAY_Wait_uS(50000);

In the first init command the RW set to zero after the E line trigger, but I think it should be before. As I haven't install the toolchain jet. could anybody please check that my founding was correct or not?

Thanks a lot for Your kind help

Link to comment
Share on other sites

Hi,

could you please provide a link to the datasheet?

RW is set to 0 by MIOS32_BOARD_J15_PortInit()

The HD44780U datasheet clearly states that the E input should be deactivated before a change (*) on the RW line.

(*) change means, that it doesn't matter if there is a rising or falling edge on the RW line.

see attachment:

post-3436-0-46498000-1316213877.png

I understand this the following way: the RW state is captured with the rising edge of the enable input, and RW should stay stable for at least t_AH

It can't be excluded that the vendor of your LCD hasn't implemented the HD44780 spec correctly, but it's more likely a connection error.

Did you stuff the J15_S jumper for 5V operation?

Best Regards, Thorsten.

post-3436-0-46498000-1316213877_thumb.pn

Link to comment
Share on other sites

Hi Torsten,

Thanks for the fast response, first of all, let me say a big thanks for this amazing project. I totally agree with the timing issue, but I'm thinking about the initialization process of the LCD. According the data sheet:

post-9695-0-45820700-1316240433_thumb.pn

It states, that in the first 3 init instruction the RW line should be at zero, but in the code, the RW line set to zero after the first instruction (after the E line pulse). I checked the MIOS8 LCD code, and there the sequence is according the data sheet. So I suggest the following code for the first init command:

// initialize LCD

MIOS32_BOARD_J15_DataSet(0x38);

MIOS32_BOARD_J15_RS_Set(0);

MIOS32_BOARD_J15_RW_Set(0);

MIOS32_BOARD_J15_E_Set(mios32_lcd_device, 1);

MIOS32_BOARD_J15_E_Set(mios32_lcd_device, 0);

MIOS32_DELAY_Wait_uS(50000);

BR, Norbert

Link to comment
Share on other sites

As mentioned earlier, the MIOS32_BOARD_J15_PortInit() function will already set RW to 0

It's a typo that RW will be set to 0 again after E has been pulsed, but it doesn't make a difference because RW was already 0

However, I moved the function call before the E pulse now (especially for documentation purposes) and recompiled the bootloader:

http://www.ucapps.de/mios32/mios32_bootloader_v1_005_2.zip

I don't think that this will solve the problem, but just created this binary to prove at your side (since you haven't installed the toolchain yet...)

Best Regards, Thorsten.

Link to comment
Share on other sites

Thanks a lot Thorsten,

You are right, it doesn't make sense, where the RW set to zero is. I double checked all the connections, also the 5V jumper is OK. I have a 4*20 LCD on my MIOS8, which is working OK, sothe next step will be creating a cross connect cable, I'll try this LCD width my MIOS8 core and the 4*20 width the LPC core. I hope it will show where the problem is.

I'll report the result here.

Best regards, Norbert

Link to comment
Share on other sites

Hi Torsten,

I found the solution, but it's a litle bit strange: I changed the IC2 from HCT595 to HC595. Even that the schematic suggest HCT595 for 5V LCD-s, my LCDs didn't work with it, but both work perfect with the HC595. I don't know wether others have same experience?

Best regards, Norbert

Link to comment
Share on other sites

Thank you for this information. I'm a bit surprised, but removed the reference to the 74HCT595 from the schematic before trying to understand the reason. ;)

Background: other users probably never noticed issues, since the 74HC595 is recommended in the part list, simply because the 74HCT595 can't be ordered from Reichelt.

Even I only own 74HC595 devices and was never able to test this with a 74HCT595.

On the other hand I was reading somewhere that 74HCT is more suitable for conversion to TTL level (5V)... I also checked input level requirements, and output level ranges, it looked plausible.

Apparently I overlooked something...

However, in the last months it has been proven with the STM32 module, that the 74HC595 works fine for 3.3V -> 5V level conversion. Therefore it's now the only recommended solution.

Best Regards, Thorsten.

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...