I have a Mega 2560 set up to use a parallel Address Data Bus on some old hardware. Among other things, there is an SRAM and an LCD on the bus. I can talk to the SRAM fine, and I thought I was talking to the LCD as well (commands appear to work), until I tried to write a character to it. The cursor moves, but it outputs a blank. I've since figured out that this is due to timing on the enable line of the LCD. the LCD is mapped to 0x3000 for the control register and 0x3001 for data. On the old hardware, this is done by connecting the RS pin to AD0 and the enable pin to logic that equates to
Enable = (A15')&(A14')&(A13)&(A12)&E
Where E is the E-clock, which runs in sync with the A/D bus at 1/4 the main clock frequency.
The reason my commands to the LCD worked (I think) is because address lines A15-A12 changed, creating a falling edge on the enable signal which clocked the command into the LCD. I'm not sure why this didn't happen with the data, but regardless I should be clocking it with the E line.
Is there any way to alter the way the external Address/Data bus operates to add a blip to an output to create a pulse on the E line? Writing the line low after writing to external memory won't work because the WR' line is no longer active. The only other solutions I can think of are writing my own parallel bus functions (slower, messier), or adding some hardware logic to drive the enable line based on the status of the WR and RD lines.
I've also considered driving the E signal with a PWM pin initialized as a fast mode high frequency square wave, since it should sync with the clock, but I don't know how well this would work.
suggestions?