Giter Club home page Giter Club logo

Comments (19)

olikraus avatar olikraus commented on June 27, 2024

Maybe a complete different solution could be to use stm32duino project.

from u8g2.

AndreAhmed avatar AndreAhmed commented on June 27, 2024

Can you link it please?

from u8g2.

AndreAhmed avatar AndreAhmed commented on June 27, 2024

Here is the link for the
Lcd
https://www.buydisplay.com/graphic-lcd-240x64-module-display-ra6963-fully-compatible-with-t6963

from u8g2.

olikraus avatar olikraus commented on June 27, 2024

Can you link it please?

For stm32duino? It is here: https://github.com/stm32duino

STM32Duino is a extension to the Arduino IDE. It will make almost any STM32 compatible with Arduino. U8g2 will then work out of the box.

from u8g2.

AndreAhmed avatar AndreAhmed commented on June 27, 2024

@olikraus
Can you check the display please if it needs any special pin configuration, for example negative CS,WR?

from u8g2.

olikraus avatar olikraus commented on June 27, 2024

there seems to be a copy & paste error in your code:

    case U8X8_MSG_GPIO_D1:				// D1 or SPI data pin: Output level in arg_int
		HAL_GPIO_WritePin(DATA_PORT, D0_Pin, arg_int);

D0_Pin probably should be D1_Pin. Same issues for the other pins also...

from u8g2.

AndreAhmed avatar AndreAhmed commented on June 27, 2024

@olikraus
Sorry I fixed that already in my code, but I still don't get any display, any other things needed for logic to work ? I mean PIN configuration or PIN Logic state ?

from u8g2.

olikraus avatar olikraus commented on June 27, 2024

it looks like a standard T6963 display, which should work out of the box with u8g2.
Did you add a proper var-pot like show here: https://www.buydisplay.com/download/interfacing/ERM24064-1_Interfacing.pdf ?

from u8g2.

AndreAhmed avatar AndreAhmed commented on June 27, 2024

@olikraus
Yes I added it, no display is showing

from u8g2.

olikraus avatar olikraus commented on June 27, 2024

Then... I assume a wiring error...

from u8g2.

AndreAhmed avatar AndreAhmed commented on June 27, 2024

@olikraus
After MX_GPIO Init, I get horizontal line in the display, before u8g2 init, after its init, it goes out. that's very weird ? any idea?
I have doubled checked the connection, its correct

from u8g2.

AndreAhmed avatar AndreAhmed commented on June 27, 2024

@olikraus
I negated the reset pin in code, and I have two lines now... I'm drawing a string and a picture

from u8g2.

AndreAhmed avatar AndreAhmed commented on June 27, 2024
 /* USER CODE BEGIN 2 */
  u8g2_Setup_t6963_240x64_f(&u8g2, U8G2_R0,u8x8_byte_8bit_8080mode, u8x8_stm32_gpio_and_delay);

  u8g2_InitDisplay(&u8g2);
  u8g2_SetPowerSave(&u8g2, 0);
	// clear VRAM
	for (int y=0;y<LCD_ys;y++)
		for (int x=0;x<LCD_xs>>3;x++)
			VRAM[y][x]=col0;

  /* USER CODE END 2 */

  /* Infinite loop */
  /* USER CODE BEGIN WHILE */
	while (1)
	{
		u8g2_ClearBuffer(&u8g2);

		u8g2_SetDrawColor(&u8g2,1);
		u8g2_DrawCircle(&u8g2, 20, 20, 20, U8G2_DRAW_ALL);
		u8g2_SetFont(&u8g2, u8g2_font_ncenB14_tr);
		u8g2_DrawStr(&u8g2, 0, 15, "Tarkan");

		for(int i = 0; i < 200; i++)
		{
			u8g2_DrawPixel(&u8g2, i, i);
		}
		u8g2_SendBuffer(&u8g2);

from u8g2.

AndreAhmed avatar AndreAhmed commented on June 27, 2024

Running this, I get a line
Without even Initializing the display

  __HAL_RCC_GPIOE_CLK_ENABLE();
   GPIO_InitStruct.Pin = GPIO_PIN_2|GPIO_PIN_3|GPIO_PIN_4|GPIO_PIN_5
                          |GPIO_PIN_6|GPIO_PIN_7|GPIO_PIN_8|GPIO_PIN_9
                          |GPIO_PIN_10|GPIO_PIN_11|GPIO_PIN_12|GPIO_PIN_0
                          |GPIO_PIN_1;

  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
  GPIO_InitStruct.Pull = GPIO_NOPULL;
  GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_MEDIUM;
  HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);

from u8g2.

AndreAhmed avatar AndreAhmed commented on June 27, 2024

I also noticed something very weird, when I remove pin 3 VDD which is 5V, and at power the MCU, I see the LCD is working(light on), how come ?!

that's their sample app
image

from u8g2.

AndreAhmed avatar AndreAhmed commented on June 27, 2024
uint8_t u8x8_stm32_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)
{
	switch(msg)
	{
	case U8X8_MSG_GPIO_AND_DELAY_INIT:
		/* Insert codes for initialization */
		break;
	case U8X8_MSG_DELAY_10MICRO:
		for (uint16_t n = 0; n < 320; n++)
		{
			__NOP();
		}
		break;
	case U8X8_MSG_DELAY_NANO:
		delay_ns(arg_int);

		break;
	case U8X8_MSG_DELAY_100NANO:
		for(int i = 0; i < 100; i++)
		{
			delay_ns(1);
		}
		break;
	case U8X8_MSG_DELAY_MILLI:
		/* ms Delay */
		HAL_Delay(arg_int);
		break;
	case U8X8_MSG_GPIO_E:
		/* Insert codes for SS pin control */
		HAL_GPIO_WritePin(GPIOE, WR_Pin, arg_int);
		break;
	case U8X8_MSG_GPIO_CS:
		/* Insert codes for SS pin control */
		HAL_GPIO_WritePin(GPIOE, CE_Pin, arg_int);
		break;
	case U8X8_MSG_GPIO_DC:
		/* Insert codes for DC pin control */
		HAL_GPIO_WritePin(GPIOE, CD_Pin, arg_int);
		break;
	case U8X8_MSG_GPIO_RESET:
		/* Insert codes for RST pin control */
		HAL_GPIO_WritePin(GPIOE, GPIO_PIN_4, arg_int);
		break;

	case U8X8_MSG_GPIO_D0:				// D0 or SPI clock pin: Output level in arg_int
		HAL_GPIO_WritePin(GPIOE, D0_Pin, arg_int);
		break;
	case U8X8_MSG_GPIO_D1:				// D1 or SPI data pin: Output level in arg_int
		HAL_GPIO_WritePin(GPIOE, D1_Pin, arg_int);
		break;
	case U8X8_MSG_GPIO_D2:				// D2 pin: Output level in arg_int
		HAL_GPIO_WritePin(GPIOE, D2_Pin, arg_int);

		break;
	case U8X8_MSG_GPIO_D3:				// D3 pin: Output level in arg_int
		HAL_GPIO_WritePin(GPIOE, D3_Pin, arg_int);

		break;
	case U8X8_MSG_GPIO_D4:				// D4 pin: Output level in arg_int
		HAL_GPIO_WritePin(GPIOE, D4_Pin, arg_int);

		break;
	case U8X8_MSG_GPIO_D5:				// D5 pin: Output level in arg_int
		HAL_GPIO_WritePin(GPIOE, D5_Pin, arg_int);

		break;
	case U8X8_MSG_GPIO_D6:				// D6 pin: Output level in arg_int
		HAL_GPIO_WritePin(GPIOE, D6_Pin, arg_int);

		break;
	case U8X8_MSG_GPIO_D7:				// D7 pin: Output level in arg_int
		HAL_GPIO_WritePin(GPIOE, D7_Pin, arg_int);
		break;

	default:
		u8x8_SetGPIOResult(u8x8, 1);			// default return value
		break;
	}

	return 1;
}``

from u8g2.

AndreAhmed avatar AndreAhmed commented on June 27, 2024

WhatsApp Image 2024-05-01 at 03 10 38_57989046

from u8g2.

AndreAhmed avatar AndreAhmed commented on June 27, 2024

@olikraus
I have followed your advice and used stm32arduino, and still no output to the display
I used graphics test as example
image
WhatsApp Image 2024-05-01 at 16 44 27_bcf71afc
WhatsApp Image 2024-05-01 at 16 44 27_4f5bc05c
WhatsApp Image 2024-05-01 at 16 44 27_8e4ce065

from u8g2.

olikraus avatar olikraus commented on June 27, 2024

I am a little bit confused by the purple ERM2 graphics LCD connector. What exactly is the purpose of this device. What is the schematic for this purple add on board?

from u8g2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.