Welcome! Log In Create A New Profile

Advanced

Arduino Mega2560, Ramps 1.4 and Reprap Smart Discount Controller

Posted by Downunder35m 
Arduino Mega2560, Ramps 1.4 and Reprap Smart Discount Controller
March 20, 2016 06:30AM
The Reprap Smart Discount Controller in the full graphics version is quite a nice thing.
It gives you SD support, a little encoder knob and of course a nice, big display.
But if you are in the same boat as I was than something does not work as it was meant to.

Common problems...
A ) The display seems to be blank, black or simply with nothing in it while the backlight is on.
B ) Despite the nice potentiometer on the front there is no effect on anything when turning it.
C ) The SD reader seems to be faulty or unresponsive.
D ) No changes in the firmware change the contrast of the display.
E ) The encoder works patchy or with wrong pulses.

Some explanations on the inner workings in regards to the above problems and general layout - and a working solution...
I had to take the display off the controller to get access to the potentiometer on the back of actual display.
This was suggested in several places on the net and it seemed to work although the contrast was medium at best.
As it turned out I could have saved me the troubles and let everything on the factory default.
The actual culprit here is the combo of Mega and Ramps, as my machine runs on 24V the diodes on the ramps board have been removed.
Side effect of this was that the Mega was not powered correctly causing only around 3.6V to reach the Display Controller.
After adding a 12 regulator between the 24V line and the Mega's power supply connection the display had the correct contrast levels - well sort of, I adjusted a little bit back and forth on the back pot.
The brightness on most of these display controllers is fixed - but it is possible to add a potentiometer for this.
The communication of data to and from the display is serial!
This explains why this controller only needs two small connectors for everything.
But the problem here is in the detail.
Since both the SD and the display communicate over a serial connection it forms a little bottleneck.
Most of us decided on this controller as everything is included - everything but a complete guide on how to get it going LOL
In the case of the RAMPS / Mega combo there is an additional problem but it might affect other combinations with this display controller as well: The SD library!
Although Marlin has full Ramps support and even all the DEFINES for the Smart Display Controller a lot of users will not get any access to the SD when inserted.
Although the display states you put a SD in the menu says "NO SD".
This had me stubled for quite a while and olny after the 5V problem was fixed I noticed the 3.3V regulator for the SD support could not have worked properly before.
Anyways, this still did not help to get the SD working as it should.
At this stage I used the example sketch "CardInfo" from the SD library to do some further testing.
Here I noticed that in many cases the system did not recognise that a SD was inserted and if it was then there was no access.
Since the display itself was not used here the issue must be in a different place - the actual SD library.
I used one that was spefically recommended for the Mega Ramps Combo.
For good reason I reverted back to the original included in the 1.05 IDE release.
Still I was only able to access the SD info but no files on the card.
A posting by mcash in the Arduino forum brought the solution.
I copy it here for ease of use.

In pins.h replace
boolean begin(uint8_t csPin = SD_CHIP_SELECT_PIN);
with
boolean begin(uint8_t csPin = SD_CHIP_SELECT_PIN, uint8_t spiSpeed = SPI_HALF_SPEED);

In sd.cpp replace
boolean SDClass::begin(uint8_t csPin) {
 /*

   Performs the initialisation required by the sdfatlib library.

   Return true if initialization succeeds, false otherwise.

  */
 return card.init(SPI_HALF_SPEED, csPin) &&
        volume.init(card) &&
        root.openRoot(volume);
}

with
boolean SDClass::begin(uint8_t csPin, uint8_t spiSpeed) {
 /*

   Performs the initialisation required by the sdfatlib library.

   Return true if initialization succeeds, false otherwise.

  */
 return card.init(spiSpeed, csPin) &&
        volume.init(card) &&
        root.openRoot(volume);
}

With these mods it is possible to use SPI_QUARTER_SPEED to read the SD.
The final thing was to find a working SD card that is supported by the controller, my trusty old 2GB card that works in all old devices is a no go but the 32GB Snadisk SDHC card works just fine LOL
If your SD still struggles check if in pins.h you have the digital pin 53 set for SDSS.
Some configurations use 49 or even 25 here but with the L shaped connector for the RAMPS board 53 is to be used as all SD stuff goes over the ICSP connection.

So who is to blame that it is not working in all cases?
Well, blame the chinese winking smiley
There are quite a few different layouts on the market.
On some the front pot works for the contrast, others don't even have this pot or the encoder is in a different position.
Then there is the often used problem child, the cable.
Some people claim you need these two cables 10cm long or shorter so it works - bogus...
The Mega is quite fast and has enough digital pins available to handle everything on a hardware basis.
Smaller Arduinos have a slower CPU, less memory, buffer and of course available digital pins.
At some stage on the way things got messed up for the Mega and the SD library as similar SD problems with other controllers happen as well.
There is also a little serial chip on the display controller to handle the SD communication.
Knowing chinese precision I guess some controllers are shipped with different serial chips.

Troubleshooting....
You just got your Smart Discount Controller?
Check with a multimeter if you have 5V at the Display controller, if it is around 3.2-3.6V it means your Arduino is supply 5V on all 5V rails.
You have 5V but still nothing to see on the display?
Just in case check the pot and see if it helps.
Is the backlight on?
If not switch the cables! Only if they are in the right connector the backlight will be on and the display can show something.
If you press the encoder and there is no beep than you can be sure the cables need to be switched over.
Now it really should work and if not you have to look at the display closely at different angles - if you can see a faint image or text you might have to adjust the pot on the back of the actual display.
Unless you want to solder the display off it is a tricky task as the pot is fragile and you only need a very minute adjustment.

SD inserted shows on the display but "NO SD" in the menu?
Make sure the SD is formatted with the format tool from SDCARD.ORG.
Try different cards of different sizes, I got 32GB cards to work so maybe the old cards below 4GB are obsolete now.
Check that the correct pins are used for the data transfer and SD detect - where some of the smaller Arduinos use pins 4, 8 or 10 the Mega / Ramps combo uses 53 to detect the SD!
If nothing else helps to get the SD working try the above code changes.

Just realised that just because I use this combo for Laser stuff that it still might not be the right place to post this info.
So if there is a proper place then please move it - thanks!

Edited 1 time(s). Last edit at 03/20/2016 06:32AM by Downunder35m.
Re: Arduino Mega2560, Ramps 1.4 and Reprap Smart Discount Controller
April 20, 2016 04:28PM
Hi, nice guide, but i still can't get it to work, the backlight turns on but nothing is showing ... i installed different libraries, different marlin, everything, still nothing....
Where should i check for the 5V ? This is driving me crazy ...
Re: Arduino Mega2560, Ramps 1.4 and Reprap Smart Discount Controller
April 20, 2016 08:26PM
You can check if the 3.3V for SD are present and the 5V connection should be on pin1 and two of the first cable.
I guess you already tried switching the cables as some manuals give wrong info on this.
If you have the 5V to the controller check the display in different angles against the light, in most cases you can make something out if the text or graphic made it up there.
In that case you could be stuffed like me and need to adjust the potentiometer on the back of the actual display but do this as a last resort as it is very hard to do without unsoldering it.
Sorry, only registered users may post in this forum.

Click here to login