I am modifying a library to print in the fastest ammount of time possible. So far I can fill a 16x2 HD44780 lcd in about 2ms, but i would like to go further.
I have this loop in the code
for ( i = 0; i < 4; i++ )
{
pinMode ( _data_pins[i], OUTPUT );
}
pinMode(_rs_pin, OUTPUT);
pinMode(_enable_pin, OUTPUT);
// Initialise displaymode functions to defaults: LCD_1LINE and LCD_5x8DOTS
// -------------------------------------------------------------------------
_displayfunction = LCD_4BITMODE | LCD_1LINE | LCD_5x8DOTS;
for (uint8_t i = 0; i < numBits; i++)
{
//data = (_data_pins[i], (value >> i) & 0x01);
//digitalWrite(_data_pins[i], (value >> i) & 0x01);
digitalWrite(_enable_pin, HIGH);
digitalWrite(_data_pins[i], (value >> i) & 0x01);
//digitalWrite((_data_pins0, (value 0) & 0x01);
//digitalWrite((_data_pins1, (value 1) & 0x01);
//digitalWrite((_data_pins2, (value 2) & 0x01);
// digitalWrite((_data_pins3, (value 3) & 0x01);
//delay(200);
Which basically prints one out of 4 bits at a time. When I designed the hardware I made sure these pins were all toguether, so i should be able to write them in a single instruction.
The pinouts is as follows
D4 - PD4 - Arduino Pin4
D5 - PD5 - Arduino Pin5
D6 - PD6 - Arduino Pin6
D7 - PD7 - Arduino Pin7
Can I have any examples on how to archieve this?