Go Down

Topic: Full Graphic Smart Controller to Mega 2560 (Read 438 times) previous topic - next topic

Fabricator10

Does anyone have to pin to pin schematic to use the Smart Controller on the Mega?. I eventually want use the Mega with bluetooth and relays.

groundFungus

#1
Mar 14, 2019, 07:34 am Last Edit: Mar 14, 2019, 07:54 am by groundFungus
This is how mine is wired.

EXP1                        Mega pin

1   beeper                   37
2   encoder switch        35
3   LCD en                   39
4   LCD rs                    38
5   LCD data 4              23
6   LCD data 5              25
7   LCD data 6              27
8   LCD data 7              29
9   ground
10 +5V

EXP2

1   SD MISO                 50
2   SD SCK                   52
3   encoder B               31
4   SD CS                    53
5   encoder A               33
6   SD MOSI                 51
7   SD card detect        49
8   Stop button            41
9   No connect
10  No connect

And this construcor for the LCD using the U8g2lib library.
Code: [Select]
U8G2_ST7920_128X64_F_SW_SPI u8g2(U8G2_R0, 23, 38, 39, U8X8_PIN_NONE);

Showing pin 1 of the EXP connectors.


Fabricator10

ok I got it all hooked up and install the latest u8g2 libray. the screen shows power but nothing showing on it, Where Do I put that code you showed? Also the yelllow light AREF is on, is that supposed to be on?
Thx for any help, this is the furthrest I have ever gotten with this board.

groundFungus

#3
Mar 15, 2019, 02:50 am Last Edit: Mar 15, 2019, 02:53 am by groundFungus
Here is code to check your display (only).  The code was tested using my clone Mega and the display wired as above.  The code will print "millis() =" and the current value of millis() in the middle of the screen.   If this does not work as described, try adjusting the contrast pot and check your wiring. .

Code: [Select]
#include <U8g2lib.h>

U8G2_ST7920_128X64_F_SW_SPI lcd(U8G2_R0, 23, 38, 39, U8X8_PIN_NONE);

void setup()
{
   Serial.begin(115200);
   lcd.begin();
   lcd.setFont(u8g2_font_5x7_tf);     
}

void loop()
{
   updateTime();
}

void updateTime()
{
   static unsigned long timer = 0;
   unsigned long interval = 1000;
   if (millis() - timer >= interval)
   {
      timer = millis();
      lcd.clearBuffer();
      lcd.setCursor(10, 32);
      lcd.print("millis() = ");     
      lcd.print(millis());
      lcd.sendBuffer();
   }
}

Fabricator10

uploaded that, the tx and rx lights flashed, nothing on the screen

groundFungus

Does the backlight come on?  Does tha contrast pot have any effect?

I know that the code works.  I am sitting here watching it count millis. 

Can you post a photo of your wiring?

Fabricator10

Back light does come on. I have turned and press the black knob on the board, I have turned the little white one, no changes. I retried to upload a u8g2 with ST7920 in it, It errored,

I checked voltage, im getting 4.95V

Go Up