LCM12232F based on SED1520 half of LCD does not work on stm32
LCD dot JR12232.pdf Based on the datasheet, It include two SED1520 with two different Enable trigger. library should load half of data in one and the other in the other. of library. Here is the code:
uint8_t u8x8_d_sbn1661_122x32(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)
{
.
.
.
case U8X8_MSG_DISPLAY_DRAW_TILE:
ptr = ((u8x8_tile_t *)arg_ptr)->tile_ptr;
// x and c are ignored (u8g2 only)
//x = ((u8x8_tile_t *)arg_ptr)->x_pos;
//c = ((u8x8_tile_t *)arg_ptr)->cnt;
u8x8->cad_cb(u8x8, U8X8_MSG_CAD_START_TRANSFER, 0, NULL);
u8x8_cad_SendCmd(u8x8, 0x000 | 0); // column 0
u8x8_cad_SendCmd(u8x8, 0x0b8 | (((u8x8_tile_t *)arg_ptr)->y_pos));
u8x8_cad_SendData(u8x8, 61, ptr); /* note: SendData can not handle more than 255 bytes */
u8x8->cad_cb(u8x8, U8X8_MSG_CAD_END_TRANSFER, 0, NULL);
ptr += 61;
u8x8->cad_cb(u8x8, U8X8_MSG_CAD_START_TRANSFER, 1, NULL);
u8x8_cad_SendCmd(u8x8, 0x000 | 0); // column 0
u8x8_cad_SendCmd(u8x8, 0x0b8 | (((u8x8_tile_t *)arg_ptr)->y_pos));
u8x8_cad_SendData(u8x8, 61, ptr); /* note: SendData can not handle more than 255 bytes */
u8x8->cad_cb(u8x8, U8X8_MSG_CAD_END_TRANSFER, 1, NULL);
break;Yes here we have two part with two cad_cb call with 0 and the other with 1. But this does no thing in codes. The consequence is it draw first half side of buffer in first half byte of LCD. Also again it place secound half side of buffer in fisrt half side of LCD. Finally only the secound half side of buffer will be placed on the first half side of LCD.
My messy solution was to add global variable and make if statement in GPIO E pin for selecting Wether E1 or E2. The var is assigned a value by placing its code in the functiones like the mentioned in u8x8_d_sbn1661.c.
case U8X8_MSG_GPIO_E: // E/WR pin: Output level in arg_int
if (eFlag==Enable1) {
HAL_GPIO_WritePin(E1_GPIO_Port, E1_Pin, arg_int);
}
else {
HAL_GPIO_WritePin(E2_GPIO_Port, E2_Pin, arg_int);
}
break;
And it worked.
Source: olikraus/u8g2