norbim1 Posted September 16, 2011 Report Share Posted September 16, 2011 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 Quote Link to comment Share on other sites More sharing options...
TK. Posted September 16, 2011 Report Share Posted September 16, 2011 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: 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. Quote Link to comment Share on other sites More sharing options...
norbim1 Posted September 17, 2011 Author Report Share Posted September 17, 2011 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: 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 Quote Link to comment Share on other sites More sharing options...
TK. Posted September 17, 2011 Report Share Posted September 17, 2011 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. Quote Link to comment Share on other sites More sharing options...
norbim1 Posted September 18, 2011 Author Report Share Posted September 18, 2011 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 Quote Link to comment Share on other sites More sharing options...
norbim1 Posted September 19, 2011 Author Report Share Posted September 19, 2011 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 Quote Link to comment Share on other sites More sharing options...
TK. Posted September 20, 2011 Report Share Posted September 20, 2011 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.