Go Down

Topic: Problem using ST7920 at MKR1000 (Read 218 times) previous topic - next topic

ginanjar_fm

Hi all,

Currently I'm using ST7920 128x64 display on MKR1000 with SPI communication and facing problem my display didn't show anything. Does anyone have solution?



Here is my schematic:



Pin connection:
MKR1000ST7920
Pin 9 SCKPin E
Pin 8 MOSIPin R/W
Pin 10Pin RS


Sketch using u8g2 library:

Code: [Select]


#include <Arduino.h>
#include <U8g2lib.h>

#ifdef U8X8_HAVE_HW_SPI
#include <SPI.h>
#endif
#ifdef U8X8_HAVE_HW_I2C
#include <Wire.h>
#endif

#define MKR_EC 9
#define MKR_RW 8
#define MKR_RS 10

U8G2_ST7920_128X64_F_SW_SPI u8g2(U8G2_R0, /* clock=*/ MKR_EC /* A4 */ , /* data=*/ MKR_RW /* A2 */, /* CS=*/ MKR_RS /* A3 */, /* reset=*/ U8X8_PIN_NONE);
//U8G2_ST7920_128X64_F_HW_SPI u8g2(U8G2_R0, /* CS=*/ MKR_RS, /* reset=*/ U8X8_PIN_NONE);

void setup(void) {
  u8g2.begin();
}

void loop(void) {
  u8g2.clearBuffer();         // clear the internal memory
  u8g2.setFont(u8g2_font_ncenB08_tr); // choose a suitable font
  u8g2.drawStr(0,10,"Hello World!");  // write something to the internal memory
  u8g2.sendBuffer();          // transfer internal memory to the display
  delay(1000); 
}



Thanks

Go Up