Welcome! Log In Create A New Profile

Advanced

sanguinololu 1.3b and the 12864 LCD

Posted by thucar 
sanguinololu 1.3b and the 12864 LCD
April 18, 2015 12:13AM
I bought the Full graphic display to go with my new Sanguinololu. Unfortunately it came with the RAMPS smart adapter only. I've been staring at both, the 1.3b and Graphics displays schematics on the reprap wiki, but I can not work out which pin needs to connect to what, on the GPIO.

Does anyone know of a schematic for the actual smart adapter for the Sanguinololu 1.3b?
Re: sanguinololu 1.3b and the 12864 LCD
April 18, 2015 04:33AM
Have you checked this thread? Note that the non-graphic 2004 and the full graphic display use the same cabling. But watch out if you buy an adapter, some have connectors that are mounted reverse - on mine I had to rotate the black plastic frames of the 10-pin sockets the by 180 degrees..
Re: sanguinololu 1.3b and the 12864 LCD
May 09, 2015 11:19PM
Thanks for the link enif, it definitely get me on the right tracks.

I created my own adapter using the PCB layout shown there, but I must still be missing something.

When I connect the LCD to my Sanguinololu, I'm not getting any graphics to show up. I've tried swapping the EXP1 and EXP2 which result in slightly different output, but neither setup really works.

What I have done so far:
  • uncommented #define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
  • added U8glib to Arduino
  • compiled and uploaded Marlin to Sanguinololu

When I power up the sanguinololu, depending on which way I have the EXP headers connected I get either a clear screen with only the backlight on (the backlight comes on when Marlin has finished initializing. Stop button on the LCD has no effect) Or if I swap the EXP cables, I get the backlight with a visible grid. (the panel comes on as soon as I power up the Sanguinololu and the Stop button resets the main controller when pressed.)
Re: sanguinololu 1.3b and the 12864 LCD
May 10, 2015 12:04PM
Could your problem be related to a bad contrast setting? A lot of full graphic display adapters have this type of problem - mine had this as well.
See [forums.reprap.org] regarding this.
Re: sanguinololu 1.3b and the 12864 LCD
May 13, 2015 11:47PM
I got a problem about a pin error during upload process on the u8glib or something, someone can help me in this?
Re: sanguinololu 1.3b and the 12864 LCD
May 16, 2015 11:39AM
Quote
sarf2k4
I got a problem about a pin error during upload process on the u8glib or something, someone can help me in this?

I think I had that issue with the latest Arduino IDE. After downgrading to 1.0.6 everything worked like a charm
Re: sanguinololu 1.3b and the 12864 LCD
May 17, 2015 02:54AM
I am using v1.0.5rc2, because version above than 1.0.6 will have trouble adding custom board especially sangui board, I got u8glib pins error not declared or something
Re: sanguinololu 1.3b and the 12864 LCD
June 29, 2015 09:03AM
Welp, I'm not out of the woods just yet.

The reason I have not given any feedback here is that I was waiting for my adapter to arrive. I gave up on trying to make my own and ordered one off ebay. So today it arrived and I immediately hooked it up. And lo and behold.... nothing changed. I'm still getting either a blank blue screen or the background grid, depending on which way I connect the EXP1<->EXP2

Also, going on a hunch I tried Marlin 1.0.2 (Been using the Dev release) and I immediately got the same compile errors sarf2k4 was talking about.

I tried initializing the SD card in Octoprint to see if it could just be a backlight thing, but that fails as well.

I'm at a loss here. If I was not seeing this error pop up for others out there, I'd figure I have a faulty LCD
Attachments:
open | download - IMG_0040.JPG (426.5 KB)
open | download - IMG_0041.JPG (405.8 KB)
Re: sanguinololu 1.3b and the 12864 LCD
June 30, 2015 03:58AM
Did you properly connect the controller board to the psu? Sangui will throw you errors due to not enough memory I guess and the pictures you show most likely due to not enough power to display (from 5v usb)
Re: sanguinololu 1.3b and the 12864 LCD
June 30, 2015 06:44AM
For the time being I'm all done with testing. I turned on the printer this morning, all fine and dandy. Did couple tests with different Marlin configurations and all of a sudden I was not able to upload new firmware anymore. It looks as if the bootloader got mangled somehow.

So I won't be able to do any more tests until I get that sorted. Need to find a programmer to burn the bootloader again...
Re: sanguinololu 1.3b and the 12864 LCD
June 30, 2015 09:23PM
I'm unsure how to get the lcd working in this board, I saw some other thread saying you need to modify the pins.h but that's what they say only

Too bad the chip somewhat bricked i guess, you could try use arduino/avrisp with the icsp port on the sangui board
Re: sanguinololu 1.3b and the 12864 LCD
June 30, 2015 11:44PM
I'm back in business smiling smiley I accidentally discovered that avrdude supports PICKit2, which I happened to have from the old robotics days. So my sanguinololu is up and running with spiffy new bootloader once again.
I've sent the reprap.me (that's where I got it from) support an e-mail asking about the LCD. Their tech savvy person is on vacation right now but they promised to get back to me as soon as he is back.
Re: sanguinololu 1.3b and the 12864 LCD
July 01, 2015 03:12AM
Ahh~~, that would be nice, I will be waiting for the results then, hopefully can be used with sangui 1.3a
Re: sanguinololu 1.3b and the 12864 LCD
July 19, 2015 12:42AM
Finally some progress!

The reprap.me tech was sadly unable to help, as they sell the LCD as a RAMPS panel, so they offer no support for setting it up with other controllers. He did however suggest that the image where I have the grid displaying, is the correct way to hook it up and that there's probably just a problem with pins declaration, so the display data never reaches the panel.

So what I did was I hooked the panel up to Sanguinololu, opened up the PDF with Marlin LCD menu layout and tried to use it "blind"

And what do you know! It actually works grinning smiley I just can't see anything.

If anyone out there could advise which pin(s) I should double check, it would make my life a lot easier smiling smiley
Re: sanguinololu 1.3b and the 12864 LCD
July 19, 2015 08:51PM
hmm, so basically, you modded the default marlin 12864 lcd pins, no display but the controllers still worked?
Re: sanguinololu 1.3b and the 12864 LCD
July 19, 2015 11:02PM
Nope, I did not mod the default Marlin pins. I just hooked the EXT1 EXT2 cables up so that I was seeing the grid shown on image IMG_0040.JPG And then started trying to navigate the menus blindly with the encoder wheel.
So I know for sure that the following pins are correct:
BTN_EN1
BTN_EN2
BTN_ENC
Re: sanguinololu 1.3b and the 12864 LCD
July 20, 2015 09:31AM
err... so I guess still not really work, navigating the control panel blindly not a good practice though smiling smiley
Re: sanguinololu 1.3b and the 12864 LCD
July 22, 2015 07:19AM
SOLVED IT!!!

Check for the solution here: [github.com]
Re: sanguinololu 1.3b and the 12864 LCD
July 22, 2015 07:58PM
So the solution was this?

#ifdef U8GLIB_ST7920 //SPI GLCD 12864 ST7920 ( like [www.digole.com] ) For Melzi V2.0
   #if MB(MELZI) // Added check for Melzi boards
     #define LCD_PINS_RS 30 //CS chip select /SS chip slave select
     #define LCD_PINS_ENABLE 29 //SID (MOSI)
     #define LCD_PINS_D4 17 //SCK (CLK) clock
     #define BEEPER 27 // Pin 27 is take by LED_Pin, but Melzi LED do nothing with Marlin and I take this pin for BEEPER.... See here > [github.com] , If you want use this pin with Gcode M42 instead BEEPER
   #else // Added pins for Sanguinololu 1.3
     #define LCD_PINS_RS     4 
     #define LCD_PINS_ENABLE 17 
     #define LCD_PINS_D4     30 
     #define LCD_PINS_D5     29
     #define LCD_PINS_D6     28
     #define LCD_PINS_D7     27
   #endif

What about the graphic? Is it displaying proper graphic now?

Edit:
I managed to put into my marlin version like this. I don't know which version I'm running probably 1.0.0, the marlin still using MOTHERBOARD var name

 //sangui u8glib support
 #ifdef U8GLIB_ST7920 //SPI GLCD 12864 ST7920 ( like [www.digole.com] ) For Melzi V2.0
   #if MOTHERBOARD == 63 // Added check for Melzi boards
     #define LCD_PINS_RS 30 //CS chip select /SS chip slave select
     #define LCD_PINS_ENABLE 29 //SID (MOSI)
     #define LCD_PINS_D4 17 //SCK (CLK) clock
     #define BEEPER 27 // Pin 27 is take by LED_Pin, but Melzi LED do nothing with Marlin and I take this pin for BEEPER.... See here > [github.com] , If you want use this pin with Gcode M42 instead BEEPER
   #else // Added pins for Sanguinololu 1.3
     #define LCD_PINS_RS     4 
     #define LCD_PINS_ENABLE 17 
     #define LCD_PINS_D4     30 
     #define LCD_PINS_D5     29
     #define LCD_PINS_D6     28
     #define LCD_PINS_D7     27
   #endif
  #endif

So far no compile errors and I added #endif because the arduino ide gave me unterminated endif error. Currently I'm unable to test, need to check out later tonight

Edited 1 time(s). Last edit at 07/22/2015 08:30PM by sarf2k4.
Re: sanguinololu 1.3b and the 12864 LCD
July 22, 2015 10:55PM
sarf2k4 - if you are using the Development version of Marlin, you need to make the changes in pins_SANGUINOLOLU_11.h around line 109

If you are using 1.0.2 then you need to make them in pins.h around line 1281

In both cases, search for this comment: (//SPI GLCD 12864 ST7920 ( like [www.digole.com] ) For Melzi V2.0)

Also, if your Sanguinololu is running at 20 MHz, you will need to comment out the line #pragma GCC optimize (3) in file ultralcd_st7920_u8glib_rrd.h or else you will get garbled display

Edited 1 time(s). Last edit at 07/22/2015 10:56PM by thucar.
Re: sanguinololu 1.3b and the 12864 LCD
July 26, 2015 01:58AM
I got an error though, I commented the pragma optimize and tried to upload, below is the error I got

avrdude: verification error, first mismatch at byte 0x1f800
         0x20 != 0x0c
avrdude: verification error; content mismatch
I will try again later tonight with pragma enabled.

Is there a way for me to find out the marllin version in the files?
Re: sanguinololu 1.3b and the 12864 LCD
July 26, 2015 03:07AM
The error
Quote
avrdude: verification error, first mismatch at byte 0x1f800 0x20 != 0x0c avrdude: verification error; content mismatch

Is an upload and verification issue, not related to the code at all.

Edited 1 time(s). Last edit at 07/26/2015 03:08AM by Dust.
Re: sanguinololu 1.3b and the 12864 LCD
July 26, 2015 05:40AM
ahh, that would be weird, what the problem might be?
Re: sanguinololu 1.3b and the 12864 LCD
July 27, 2015 12:08AM
3 main ideas come to mind

bad cabling, use high qualty not overly long cables

bad processor, its just dead. That memory location for what ever reason just doesnt work. Get a new cpu

bad programer, Some ISP's are limited to 64k, if you attempt to program above that location it get errors like this. eg isptiny
Are you even using a programmer or just the boot loader?

Or it was justa once off... does it do it every time. ?

Edited 1 time(s). Last edit at 07/27/2015 12:14AM by Dust.
Re: sanguinololu 1.3b and the 12864 LCD
July 27, 2015 08:36PM
Well, the cable is I think 1 meter length supplied with the printer kit, I turned on the printer to print rod clamp, it got me worried what if the atmega chip were bricked because pronterface unable to connect. I immediately reflashed the working firmware that were working (before I added the code above to make 12864lcd work) and it works like it before.

Mine got 1284p chip, and flashing the firmware using arduino ide, Tried avrasp mk2 and avrisp (I wonder if there's any difference here) both gave me mismatch error that time.
Sorry, only registered users may post in this forum.

Click here to login