Which points to possibly not a long enough wait at power up. These displays require quite a long time to initialize.I have experienced problems in the past with 4-bit mode. There was nothing wrong with the code. The procedure that worked was to call the initialization routine twice.
I would take that as evidence of a code problem.I have experienced problems in the past with 4-bit mode. There was nothing wrong with the code. The procedure that worked was to call the initialization routine twice.
Can you still read the display when using I2C?I use the 4 bit mode, but with the I2C interface all the time now.
View attachment 193442
View attachment 193441
So you only need 2 pins, plus 5V and gnd.
And a number of displays, or other I2C devices can be run on the same pair of pins too as long as the addresses are different.
That may be worth a look.
I do not think so. But I have never had a need to read the displays as yet.Can you still read the display when using I2C?
Or, as a (superior) alternative, don't use blocking routines that wait for input.Any program action that waits for an input, should have a 'time out' escape route, this could be a simple loop counter or a Interrupt/Timer.
Is that really practical with synchronous routines such as SPI? It seems a timeout, such as WDT is reliable and has a place.Or, as a (superior) alternative, don't use blocking routines that wait for input.
SPI can be configured for buffers and interrupts (and/or DMA on some devices) so blocking waits for word transfers should be the last option for efficient high speed operation. Most of my small embedded devices use SPI mode displays in an FSM that never waits for individual I/O(s).Is that really practical with synchronous routines such as SPI? It seems a timeout, such as WDT is reliable and has a place.
Correct. There is no solution to the 'Halting Problem' in a Turing machine but that's really a separate issue IRT blocking I/O functionality.hi,
Never seen a program written yet that can guarantee when 'glitched' by noise or a component tolerance failure,that will not get into a 'forever loop' which is outside the main programs software time out loops.
In a critical MCU project I would always add a hardware device time out reset, in addition to any software time out resets.
E
I've got tens of thousands of product in use in the field running with no WDT for up to 30 years.hi,
Never seen a program written yet that can guarantee when 'glitched' by noise or a component tolerance failure,that will not get into a 'forever loop' which is outside the main programs software time out loops.
In a critical MCU project I would always add a hardware device time out reset, in addition to any software time out resets.
E