I'm in need of some assistance getting the FlexBus to work with both my SRAM and LCD devices connected to a MK60F15 device.
The SRAM is hooked up to the FlexBus as follows...
FB_AD[0..15] -> MEM_A[0..15]
FB_A[16..19] -> MEM_A[16..19]
FB_AD[20..31] -> MEM_D[0..15]
FB_OE -> MEM_OE
FB_RW -> MEM_WE
FB_LB -> MEM_LB
FB_HB -> MEM_HB
FB_CS0 -> MEM_CS
The LCD display (in 6800 mode) is hooked up to the FlexBus as follows...
FB_AD[0..15] -> LCD_D[0..15]
FB_AD16 -> LCD_DC
FB_RW -> LCD_RW
FB_CS1 -> LCD_CS
I believe that the above signal connections are correct to allow me to make use of the 20 address bits of the SRAM. Primarily, I'm trying to get the LCD interface working first. My core clock source is a 20MHz crystal and I'm running at 150MHz. The FlexBus should be running at 50MHz (div 3 in SIM_CLKDIV1).
The code I have for the FlexBus set up is as follows...
FB->CS.CSAR = 0x80000000;
FB->CS.CSCR = FB_CSCR_PS(2) | FB_CSCR_AA_MASK | FB_CSCR_BLS_MASK | FB_CSCR_ASET(1) | FB_CSCR_WS(0);
FB->CS.CSMR = FB_CSMR_BAM(1) | FB_CSMR_V_MASK;
// Enable #FB_CS1 mux
FB->CSPMCR = 0x10000000;
When I want to send a command to the LCD display, I just do...
// Bit 16 represents the LCD DC signal = LOW
*((uint16*)0x80000000) = cmd;
And for data...
// Bit 16 represents the LCD DC signal = HIGH
*((uint16*)0x80010000) = dat;
For sanity, please can someone confirm whether the above looks correct for my described set up?