SPI LCD 12864 and SD module problem

when I run lcd and sd module separately, it works well.

When I run this circuit I get this on the display:

#include <SPI.h>
#include <SD.h>
#include "U8glib.h"

U8GLIB_ST7920_128X64 u8g(13,11,10, 6); //SPI

const int chipSelect = 7;
int val = 0;
int pos = 10;

void setup() {
  Serial.begin(9600);
  while (!Serial) { ; }
  SD.begin(chipSelect);

  if ( u8g.getMode() == U8G_MODE_R3G3B2 ) {
    u8g.setColorIndex(255);     // white
  }
  else if ( u8g.getMode() == U8G_MODE_GRAY2BIT ) {
    u8g.setColorIndex(3);         // max intensity
  }
  else if ( u8g.getMode() == U8G_MODE_BW ) {
    u8g.setColorIndex(1);         // pixel on
  }
  else if ( u8g.getMode() == U8G_MODE_HICOLOR ) {
    u8g.setHiColorByRGB(255,255,255);
  }
}

void loop() {
  File dataFile = SD.open("datalog.txt", FILE_WRITE);
  if (dataFile) {
    dataFile.println(val);
    dataFile.close();
  }
  val++;

    u8g.firstPage();  
  do {
    //u8g.setFont(u8g_font_unifont);
    u8g.setFont(u8g_font_osb21);
    u8g.drawStr( pos, 22, "Yersey");
  } while( u8g.nextPage() );

  if(pos >= 100)
    pos -= 90;
  else pos++;

  delay(500);
}

What am I doing wrong?

You need to connect pin 10 on the Arduino board to the CS pin on the LCD

pert:
You need to connect pin 10 on the Arduino board to the CS pin on the LCD

I did it and changed the fifth line to: U8GLIB_ST7920_128X64 u8g (13, 11, 10, U8G_PIN_NONE); but it still does not work.

Solution: I connected lcd to random pins, including mosi to pwm pin. According to the pins, I changed the U8G constructor. Now everything works fine.

Yersey2k:
Solution: I connected lcd to random pins, including mosi to pwm pin. According to the pins, I changed the U8G constructor. Now everything works fine.

not a good one. the U8glib library uses bit-banged SPI now. and it was using it before too, but on SPI pins, which was in conflict with SPI library for SD card. try the U8glib constructor for hardware SPI