tom321
April 5, 2023, 2:25am
1
After downloading the program the screen is blank, I have to turn power OFF and ON to see texts ?
#include "ST7565.h"
//ST7565 glcd(SDA, SCL, DC, RST, CS5)
ST7565 glcd(PB7, PB6, PB5, PB4, PB3);
void setup() {
//glcd.begin(0);// glcd.begin(10);, glcd.begin(brightness);
glcd.begin(0);
delay(10);
}
void loop()
{
glcd.clear();
glcd.drawstring(0, 1, "TEST 23434 45675");
glcd.display();
}
Can you post a schematic of your setup please?
Are all grounds connected together?
What LCD do you have, can you post a link to that please?
It sounds to me like something like a reset connection you have missed connecting up on the LCD.
tom321
April 5, 2023, 9:13am
3
ST7565 [https://www.aliexpress.com/item/1005004706328499.html ?
stm32f103 , SDA= PB7, SCL = PB6
stm32f103 reset button is not working
So I will take the answer to this as no.
If you want help then please post a schematic. The bit of a picture you posted isn't even a schematic.
I know with a lot of these screens you have to turn on the backlight to get the screen to work.
you should try,
#define BACKLIGHT_LED 4
Setup()
pinMode(BACKLIGHT_LED, OUTPUT);
digitalWrite(BACKLIGHT_LED, LOW);
tom321
April 6, 2023, 2:44am
9
ribbonman:
backlight
Thanks it is working. Now I am trying to use PB10 and PB11 instead of PB6 and PB7 , but it is not working.
#include "ST7565.h"
/////////////////
#include <Wire.h>
TwoWire Wire2(PB11, PB10);
/////////////////
//ST7565 glcd(SDA, SCL, DC, RST, CS5)
ST7565 glcd(PB7, PB6, PB5, PB4, PB3);
void setup() {
Wire2.begin();
Wire2.setClock(400000);
glcd.begin(0);
delay(10);
}
void loop()
{
glcd.clear();
glcd.drawstring(0, 1, "TEST 23434 45675 6");
glcd.display();
}
tom321:
stm32f103
Don't you have a conflict with your pin assignments?
You have TwoWire Wire2 seems to be using those 2 pins(PB10,PB11)
tom321
April 7, 2023, 12:11am
11
Yes I have, even if I change this line
ST7565 glcd(PB7, PB6, PB5, PB4, PB3);
to
ST7565 glcd(PB11, PB10, PB5, PB4, PB3);
#include "ST7565.h"
/////////////////
#include <Wire.h>
TwoWire Wire2(PB11, PB10);
/////////////////
//ST7565 glcd(SDA, SCL, DC, RST, CS5)
ST7565 glcd(PB11, PB10, PB5, PB4, PB3);
void setup() {
Wire2.begin();
Wire2.setClock(400000);
glcd.begin(0);
delay(10);
}
void loop()
{
glcd.clear();
glcd.drawstring(0, 1, "TEST 23434 45675 6");
glcd.display();
}
You lost me here.
You're using an SPI screen and doing something with I2C?
Maybe you should explain what you are trying to accomplish with your project and then maybe it will make more sense.
tom321
April 8, 2023, 1:40am
13
In stm32f103 there are 3 I2C, the LCD is working on default pins PB6 and PB7, I am trying to remap them to PB10 and PB11
tom321:
TwoWire Wire2(PB11, PB10); // GM comment this is correct
/////////////////
//ST7565 glcd(SDA, SCL, DC, RST, CS5)
ST7565 glcd(PB11, PB10, PB5, PB4, PB3); // GM comment this is wrong
You can't use the same pins for both I2C and the SPI lines, they are not the same thing.
Pins marked SCL1 SDA1, and SCL2, SDA2, and SCL3, SDA3 in the pale grey colour are I2C lines.
The purple colored labels marked SCK1 and SCK 2 are the clock lines for the SPI interface, along with the MOSI, MISO, data lines and the NSS ( the device select that needs to be driven low to select the device)
system
Closed
October 5, 2023, 2:52am
15
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.