Tap on the LCD does not respond

Status
Not open for further replies.
We're going to need a lot more info than that!

So! the sketch worked on the Arduino but not on the STM32? Same sketch? Was it compiled for the STM32?

Have you installed the JSON for the STM32?
 
We're going to need a lot more info than that!

So! the sketch worked on the Arduino but not on the STM32? Same sketch? Was it compiled for the STM32?

Have you installed the JSON for the STM32?
No, I don't have JSON installed on the STM32.
The STM32 and Arduino are basically connected to the display in the same way, via 8pin lines to DIN DOUT GND, and VIN.
Here is the connection diagram of the display and Arduino:

Here is the connection diagram of the display and STM32:
 
One thing I noticed... On the arduino the display is externally powered.. On the STM32 its powered by the STM32... Check the voltage to the display to see if its stable...
 
My LCD is 12v power supply, Arduino through USB is 5v power supply, stm32 because there is a DCDC chip can be 12v power supply.
 
You need to check as the STM32 definately says 'vin' and not vout..
 
I know what the reason is, it's because when I use Arduino I solder the interface to the TTL interface, but STM32 is using the RS232 interface.
 
So are you good to go?? You'll need a RS232 adapter on the screen side
 
My Arduino is fine because I changed the interface on the LCD to TTL when I used the Arduino. when I use the same LCD to connect to the , the interface of the LCD is still TTL at this time, then I need to change it by initialization.
Calls the hal library, which is a structure for Uart advanced initialization and corresponds to assigning values to each of the structure's members.
The following is part of the code that defines the Uart
Code:
void
MX_USART1_UART_Init(void)
{
UART1_Handler.Instance = USART1;
UART1_Handler.Init.BaudRate = 115200;
UART1_Handler.Init.WordLength = UART_WORDLENGTH_8B;
UART1_Handler.Init.StopBits = UART_STOPBITS_1;
UART1_Handler.Init.Parity = UART_PARITY_NONE;
UART1_Handler.Init.Mode = UART_MODE_TX_RX;
UART1_Handler.Init.HwFlowCtl = UART_HWCONTROL_NONE;
UART1_Handler.Init.OverSampling = UART_OVERSAMPLING_16;
UART1_Handler.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE;
// Advanced initialization options for the serial port, the mask is off by default
// UART1_Handler.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_TXINVERT_INIT|UART_ADVFEATURE_RXINVERT_INIT
// |UART_ADVFEATURE_DATAINVERT_INIT|UART_ADVFEATURE_SWAP_INIT;
// UART1_Handler.AdvancedInit.TxPinLevelInvert = UART_ADVFEATURE_TXINV_ENABLE;
// UART1_Handler.AdvancedInit.RxPinLevelInvert = UART_ADVFEATURE_RXINV_ENABLE;
// UART1_Handler.AdvancedInit.DataInvert = UART_ADVFEATURE_DATAINV_DISABLE;
//// UART1_Handler.AdvancedInit.Swap = UART_ADVFEATURE_SWAP_ENABLE;
HAL_UART_Init(&UART1_Handler);
}
void
MX_USART1_UART_Init2(void)
{
UART1_Handler.Instance = USART1;
UART1_Handler.Init.BaudRate = 115200;
UART1_Handler.Init.WordLength = UART_WORDLENGTH_8B;
UART1_Handler.Init.StopBits = UART_STOPBITS_1;
UART1_Handler.Init.Parity = UART_PARITY_NONE;
UART1_Handler.Init.Mode = UART_MODE_TX_RX;
UART1_Handler.Init.HwFlowCtl = UART_HWCONTROL_NONE;
UART1_Handler.Init.OverSampling = UART_OVERSAMPLING_16;
UART1_Handler.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE;
// Advanced initialization options for the serial port, the mask is off by default
UART1_Handler.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_TXINVERT_INIT|UART_ADVFEATURE_RXINVERT_INIT
|UART_ADVFEATURE_DATAINVERT_INIT|UART_ADVFEATURE_SWAP_INIT;
UART1_Handler.AdvancedInit.TxPinLevelInvert = UART_ADVFEATURE_TXINV_ENABLE;
UART1_Handler.AdvancedInit.RxPinLevelInvert = UART_ADVFEATURE_RXINV_ENABLE;
UART1_Handler.AdvancedInit.DataInvert = UART_ADVFEATURE_DATAINV_DISABLE;
//UART1_Handler.AdvancedInit.Swap = UART_ADVFEATURE_SWAP_ENABLE;
HAL_UART_Init(&UART1_Handler);
}

Here is the part code to be called in the main function

Code:
int main(void)
{
uint8_t color_buf = 0;
//Function Selection
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* Configure the system clock */
SystemClock_Config();
/* Initialize all configured peripherals */
MX_GPIO_Init();
TX_Mode = HAL_GPIO_ReadPin(GPIOA,GPIO_PIN_4);
if(TX_Mode)
MX_USART1_UART_Init();
//232 Initialization
else
MX_USART1_UART_Init2();
//TTl Initialization
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…