UncleRus/esp-idf-lib

hd44780 lib issue

microgenios opened this issue · 1 comments

The issue

In Wokwi simulator your LCD library was not working properly. I changed the Enable pin's Clock time and now everything is OK. Following the modified code (Parallel bus access)

static esp_err_t write_nibble(const hd44780_t *lcd, uint8_t b, bool rs)
{
if (lcd->write_cb)
{
(...)
}
else
{
CHECK(gpio_set_level(lcd->pins.rs, rs));
ets_delay_us(1); // Address Setup time >= 60ns.

    CHECK(gpio_set_level(lcd->pins.d7, (b >> 3)  & 0x01));  
    CHECK(gpio_set_level(lcd->pins.d6, (b >> 2)  & 0x01));  
    CHECK(gpio_set_level(lcd->pins.d5, (b >> 1)  & 0x01));  
    CHECK(gpio_set_level(lcd->pins.d4, (b >> 0)  & 0x01));  
    
   //Enable clock
    CHECK(gpio_set_level(lcd->pins.e, 0));   ets_delay_us(1);
    CHECK(gpio_set_level(lcd->pins.e, true));ets_delay_us(1);
    CHECK(gpio_set_level(lcd->pins.e, 0));   ets_delay_us(100);
    
}

return ESP_OK;

}

Which SDK are you using?

esp-idf

Which version of SDK are you using?

master

Which build target have you used?

  • esp32
  • esp32s2
  • esp32s3
  • esp32c2
  • esp8266
  • other

Component causing the issue

hd44780

Anything in the logs that might be useful for us?

No response

Additional information or context

No response

Confirmation

  • This report is not a question nor a request for drivers.

does it work on a real hardware without the fix?