Having had several LCD displays working successfully in 6800 mode, I've now working with a display which only has an 8080 interface. I know that the flexbus is more sympathetic towards 6800 mode but would this be considered the correct mapping for 8080:
LCD_CS# = GPIO
LCD_RST# = GPIO
LCD_D[0..15] = FLEXBUS_AD[0..15]
LCD_DC# = FLEXBUS_AD16
LCD_WR# = FLEXBUS_CS0#
LCD_RD# = FLEXBUS_CS1#
// Configure flexbus CS0 for writing
FLEXBUS[0].CSAR = 0x60000000;
// Configure for 16bit multiplexed mode where the 16bit data is driven on lower 16 bits and address is on upper 16 bits
FLEXBUS[0].CSCR = 16bit port size | auto-ack | byte-shift;
// Base address mask allows up to 0x60001FFFF so that we can present the DC# on bit 16
FLEXBUS[0].CSMR = BAM(1) | VALID;
// Configure flexbus CS1 for reading
FLEXBUS[1].CSAR = 0x70000000;
// Configure for 16bit multiplexed mode where the 16bit data is driven on lower 16 bits and address is on upper 16 bits
FLEXBUS[1].CSCR = 16bit port size | auto-ack | byte-shift;
// Base address mask allows up to 0x70001FFFF so that we can present the DC# on bit 16
FLEXBUS[1].CSMR = BAM(1) | VALID;
The reason behind mapping the LCD_RS to the FLEXBUS_AD16 signal is quite simple:
// Write data to the LCD display
void writeData(uint8_t data) {
LCD_CS = LOW;
*(uint16_t *)(0x60010000) = data;
LCD_CS = HIGH;
}
// Write command to the LCD
void writeCommand(uint8_t command) {
LCD_CS = LOW;
*(uint16_t *)(0x60000000) = command;
LCD_CS = HIGH;
}
Where the 16th bit is driven as an an address rather than data (because of the multiplexed mode) and thus is either clear during a command transaction or set during a data transaction.
Does this make sense to anyone? Could anyone offer any advice as to whether this is the correct mapping?
Thanks in advance