Jump to content

Recommended Posts

Posted

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

Posted

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

Posted

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

Posted

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.

Posted

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

Posted

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

Posted

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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...