cancel
Showing results for 
Search instead for 
Did you mean: 

T6963C or SAP1024B Driver for Graphic Lcd controller (240*64) on STM32F4

Anaelle Q
Associate II
Posted on April 12, 2018 at 13:40

Hi everyone,

I try to find a driver for control a graphic LCD withT6963C or SAP1024B controller.

I find some Arduino project but nothing with STM

If someone can help me !

Thank ,

Anaelle

I use this LCD : MC240064A6W-FPTLW-V2

With STM32F4 discovery board.

#lcd-driver #stm32f4-discovery #t6963 #sap1024b #graphic-lcd

Note: this post was migrated and contained many threaded conversations, some content may be missing.
8 REPLIES 8
Posted on April 12, 2018 at 23:53

Not STM32-specific, but these

http://en.radzio.dxp.pl/t6963/

 

http://en.radzio.dxp.pl/t6963/arm/at91.htm

  are very cleanly written - the 'graphic' part is not mcu-specific, and in the 't6963c' part, the mcu-specific routines are all located at the top, and they are relatively easy to follow - they implement the variants of write command/write data/read data/read status.

JW

Posted on April 13, 2018 at 10:47

Hi , 

Thank you, 

It's helpfull  

I have one problem with traduction atmel lib to stm32 lib : 

__inline void outByte(unsigned char byte) { AT91F_PIO_CfgOutput(AT91C_BASE_PIOA,(0xFF << T6963_D0)); AT91F_PIO_ForceOutput(AT91C_BASE_PIOA, (unsigned int)(byte << T6963_D0)); }  __inline unsigned char inByte(void) { AT91F_PIO_CfgInput(AT91C_BASE_PIOA,(0xFF << T6963_D0)); return ((AT91F_PIO_GetInput(AT91C_BASE_PIOA) >> T6963_D0) & 0xFF); }

I don't know how to put this in stm32 'mode'.

I try this but it's doesn't work ...

__inline void outByte(unsigned char byte)

{

HAL_GPIO_WritePin(GPIOE,CE_LCD_Pin, (unsigned int)(byte<< T6963_D0));

//AT91F_PIO_ForceOutput(GPIOE, (unsigned int)(byte << T6963_D0));

}

__inline unsigned char inByte(void)

{

return ((HAL_GPIO_ReadPin(GPIOE, GPIO_PIN_7) >> T6963_D0) & 0xFF);

}

Thank for your help ! 

Posted on April 13, 2018 at 13:32

What's your hardware connection?

JW

Posted on April 13, 2018 at 13:42

This is the discovery board stm32F411 . 

Posted on April 14, 2018 at 08:39

OK but how did you connect the display to that board?

JW

Posted on April 16, 2018 at 08:39

Hi , Sorry , i forgot the pin-map ! 

As you can see , on the left , there is all LCD connection. 

0690X0000060AbGQAU.png
Posted on April 17, 2018 at 10:22

So you have them in a proper order on a single port. That makes things easier.

As the bus is bi-directional, you have to change the direction of the pins between GPIO Input and GPIO Output, according to whether you are going input or output data. This is done by setting the respective bits in GPIOE_MODER - for each pin, Input is when the respective two bits are set to 0b00, and Output is when they are set to 0b01; so

GPIOE->MODER &= ~(0b0101010101010101 << 7);

GPIOE->MODER |= (0b0101010101010101 << 7);

The data output is best to be done through the BSRR register. You take your input byte, and then set (by writing 1 to the lower 16-bits of BSRR) those bits in it which are 1; and clear (by writing 1 to the upper 16-bits of BSRR) those bits which are 0; so it's something like:

GPIOE->BSRR = (byte << 7) + (((~byte & 0xFF) << 7) << 16);

I don't know the Cube incantations for these, I don't Cube.

JW

Posted on April 19, 2018 at 15:01

Thank JW for your help, i understand a little bit

I try to use your method into my code but i have one problem when i want to recover the values of my data.

The method that i use doesn't works ..

I attach my code :

My problem is in LCD.c

When i use thisGPIOE =command;

Thank for your help

Anaelle

________________

Attachments :

graphic.c.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hxg6&d=%2Fa%2F0X0000000b0p%2FWemxdC9m8oOT2N_VWrRape2xRVrofPGpnFDaUYL9qDA&asPdf=false

graphic.h.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hxfm&d=%2Fa%2F0X0000000b0r%2FE6i6HhXvGtTOInj6DCiJ_Rcuqam.b_cHCEslVl8wlYg&asPdf=false

LCD.c.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HxXS&d=%2Fa%2F0X0000000b0w%2FcNbGPc3YAq_anoyRfsTvGRKJAIdxEpKkLG1qYHoyOR8&asPdf=false

LCD.h.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hxg1&d=%2Fa%2F0X0000000b0o%2FG2gQ5gzeK6BjIY773O6_REy2ktkeWh5huKcr3inYRdo&asPdf=false

main.c.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HxgG&d=%2Fa%2F0X0000000b0s%2FnppmOMztDhe2B66W_O8BtIsepjF3XkdepD2Sqb4mdbE&asPdf=false

main.h.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hxfr&d=%2Fa%2F0X0000000b0q%2FZh_8BpCdL5Qr_.T8ZbQeEy6npehtrwHSsVSsqi14BhQ&asPdf=false