Welcome! Log In Create A New Profile

Advanced

Adafruit ST7565 LCD and Ramps 1.4

Posted by ElmoC 
Adafruit ST7565 LCD and Ramps 1.4
March 08, 2015 02:38PM
I have an Arduino Mega 2560 with the Ramps 1.4 shield. It came with the 4 line text display and I have been able to get it connected and working just fine. I have played around with some other projects using LCD displays with the Atmel processors, driving them with the U8glib. Seeing that the Marlin firmware uses this same library, I thought it might be an interesting project to see if I could hook up an Adafruit ST7565 (128x64) graphic display. I figured I would just need to find out what pins the other graphic displays are using, add the correct U8glib display and be in business. I have been looking through the Marlin code and been having trouble following everything. I have tried searching for a schematic for the interface board between the display and Ramps and all I could find was just the one used for the text display. But seeing how the LCD interfaces in, it looks like it could easily be used for both display types, if the correct defines are used.

So what I think is happening is the displays are suing the HW SPI interface. On the Mega, the SCK and MOSI are on D51 and D52 and they come across on Exp2 pine 9 and 5. The control lines that are giving me fits are CS and A0. Based on the defines, it seems A0 is being sent on D30 yet this pin is not made available on the Ramps AUX ports. CS looks to use either D29 or D17, depending on the display defined. Both D29 and D17 are available on AUX4 of the Ramps. So what I'm wondering is how these other displays are using D30 when they have no connection to it? Or am I just really confused and off base with the pins? I know I can redefine the pins used in the U8glib constructor for the display, but I would like to try and use the same pins as other displays if possible.

Or maybe I can be lucky enough to find that someone has already done this and got this display working on the Ramps.

Elmo
Re: Adafruit ST7565 LCD and Ramps 1.4
March 08, 2015 06:27PM
The schematics for the 12864 display are right there in the wiki, including the RAMPS connection.
Re: Adafruit ST7565 LCD and Ramps 1.4
March 08, 2015 11:34PM
Could you provide a link to the schematics you are referring to? The ones I have found don't seem to match the pin definitions I have been seeing in the code. I'm probably just reading it wrong, but if I know I have a good starting point, I should be able to work it out.
Re: Adafruit ST7565 LCD and Ramps 1.4
March 09, 2015 01:21AM
[reprap.org]

Also check : [edeca.net]

and [www.lcd-module.de] which is the chip used in the Full Graphics Smart Controller

Edited 1 time(s). Last edit at 03/09/2015 01:26AM by AndrewBCN.
Re: Adafruit ST7565 LCD and Ramps 1.4
March 09, 2015 06:39PM
Yeah. I have looked at that one several times. Seems to be something amiss on it. Look at the LCD Connect Schematics and answer this question. How does VCC get to the LCD through this? VCC is available on AUX-3 and 4 on pin 1, yet the connect schematics show pin 1 on aux-4 as not connected and pin 1 of aux-3 tied to pin 9 of Exp1 which is labeled as ground. Ground is available on pin 2 of aux-4 and pin 7 of aux-3. Pin 2 of aux-4 is shown as a no-connect. Pin 7 of aux-3 is labeled as what looks like D43 but D43 comes in on pin 6 of aux-4.

It's been things like this that have been driving me nuts. Those two schematics are not in sync with each other or the schematics of the Ramps 1.4 board. It could be the LCD connect schematic was for an earlier version of the Ramps, in which case, it doesn't do me much good.

I'm going to go through the Marlin code some more but from what I saw, the A0 line for the LCD looks to be tied to D30, which isn't exposed on the Ramps 1.4 board on either Aux-3 or Aux-4.
Re: Adafruit ST7565 LCD and Ramps 1.4
March 09, 2015 09:31PM
The main point here is that the Adafruit display you mention uses SPI whereas the Full Graphics display uses 4-bit parallel communication. It makes no sense for you to try to use the Full Graphics routines and pin assignment in Marlin for the Adafruit display.
Re: Adafruit ST7565 LCD and Ramps 1.4
March 09, 2015 09:54PM
Interesting that you say the Full Graphics display uses parallel. The link you posted for the schematics is for the RepRapDiscount Full Graphics display yet the schematics for it shows it is using SPI, not parallel. This is the type of issue that I have been fighting with. It doesn't seem there are any current or accurate schematics available. There are some other displays that do use the SPI and I was trying to use that, but it would seem they use a completely different method of connecting to the controller board. So it looks like I got a lot of work ahead of me on this one. Oh well.
Re: Adafruit ST7565 LCD and Ramps 1.4
March 10, 2015 02:34AM
Quote
AndrewBCN
The main point here is that the Adafruit display you mention uses SPI whereas the Full Graphics display uses 4-bit parallel communication. It makes no sense for you to try to use the Full Graphics routines and pin assignment in Marlin for the Adafruit display.

Sorry, my bad: the Full Graphics display can use either 8/4-bit parallel or serial but as configured it uses a serial interface. To answer your previous question VCC and GND are on EXP1.

Edited 2 time(s). Last edit at 03/10/2015 02:38AM by AndrewBCN.
Re: Adafruit ST7565 LCD and Ramps 1.4
March 10, 2015 08:52AM
Yes. VCC and GND are shown on EXP1 in the controller schematics. That's not the issue. It is the connector between the RAMPS and the controller that is the problem. The schematics for the connector is either very wrong or is not the connector for the controller.
Re: Adafruit ST7565 LCD and Ramps 1.4
March 10, 2015 06:11PM
Examining the schematics for the connector, there is a problem with the characters for AUX3 and EXP2 overlapping, but it's actually rather easy to figure out what the pins are and you can refer to the RAMPS 1.4 schematics and board layout. For example, VCC and GND on EXP1 come from AUX3.

I believe the HW SPI interface on AUX3 is used on EXP2 for the SD card reader, the LCD serial data seems to be bit-banged on one of the Arduino's GPIOs.

What is it exactly what you need to know?

Edited 1 time(s). Last edit at 03/10/2015 06:20PM by AndrewBCN.
Re: Adafruit ST7565 LCD and Ramps 1.4
March 10, 2015 06:19PM
It is more than just a problem with the characters overlapping. What I was wanting to find out was what pins each of the signal lines were actually wired to. Given the issues with the connector schematics I have explained above, I don't feel I can rely on tracing things back using it. I have been wading though the code more and think I am getting a better idea of what is required to add a new display.
Re: Adafruit ST7565 LCD and Ramps 1.4
March 10, 2015 10:03PM
Really, it's not that hard to read.

EXP1 is perfectly readable.

For Aux3 and Aux4, you have their pinouts in the RAMPS schematics and also they are clearly annotated in the board layout here: [reprap.org]

And you need not concern yourself with EXP2 since it's only used for the SD Card reader.

In any case, it's a good idea to take a look at the code in Marlin for the pin assignments, you would have to do it sooner or later anyway.

Good luck!

Edited 1 time(s). Last edit at 03/10/2015 10:05PM by AndrewBCN.
Re: Adafruit ST7565 LCD and Ramps 1.4
March 10, 2015 10:19PM
Well, looking at it some more, I think I have found the problem with the connector schematics. AUX3 is labeled backward. What is labeled as pin 1 is actually pin 7 (GND). By switching the pin number around, it matches.except for D43 which is not on AUX3. D49 is.

I have been able to find the information I need from other sources though. So right now I am working on getting the right defines in the code to talk to the display.
Re: Adafruit ST7565 LCD and Ramps 1.4
March 10, 2015 11:30PM
And there it is...



Don't have the rotary encoder hooked up yet so can't pull up the menu. That's next.
Re: Adafruit ST7565 LCD and Ramps 1.4
March 10, 2015 11:43PM
Well done! Btw I have included your remarks about the issues in the connector schematics in the Discussion tab in the page in the wiki for the Full Graphics Display Controller. Hopefully that will help somebody in the future.
Re: Adafruit ST7565 LCD and Ramps 1.4
March 10, 2015 11:46PM
Thanks. Now if I can only get the second extruder configured for the RAMPS, I could test out if the display responds properly.
Re: Adafruit ST7565 LCD and Ramps 1.4
March 22, 2015 07:42AM
Hi ElmoC,
I'm actually planning on getting this same display to both teach myself how these full graphic LCD's run and if possible (which after finding this, apparently it is) connect it to my RAMPS board. Would you be willing to share the changes you had to make to Marlin and the pin connections from the LCD pins to the RAMPS board pins?
Re: Adafruit ST7565 LCD and Ramps 1.4
March 22, 2015 08:54AM
Quote
NarimaanV
Hi ElmoC,
I'm actually planning on getting this same display to both teach myself how these full graphic LCD's run and if possible (which after finding this, apparently it is) connect it to my RAMPS board. Would you be willing to share the changes you had to make to Marlin and the pin connections from the LCD pins to the RAMPS board pins?

Yeah, I can share what I have. Right now it is all on a breadboard and I need to get it written up first. The changes so far to the RAMPS code is minimal. I haven't finished with my tweaking so haven't done a pull request yet. I can send you copies of the files I have changed though.

As for getting the display working, I use the U8glib library and U8GLIB_LM6059 to drive it.
Re: Adafruit ST7565 LCD and Ramps 1.4
March 22, 2015 09:24AM
Yeah please, I'd be grateful for the copies, and worst case scenario, I can stop using them once you make the pull request. smiling bouncing smiley

Edited 1 time(s). Last edit at 03/22/2015 09:38AM by NarimaanV.
Sorry, only registered users may post in this forum.

Click here to login