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[1].CSAR = 0x80000000;
FB->CS[1].CSCR = FB_CSCR_PS(2) | FB_CSCR_AA_MASK | FB_CSCR_BLS_MASK | FB_CSCR_ASET(1) | FB_CSCR_WS(0);
FB->CS[1].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?
Best regards,
Kevin
Solved! Go to Solution.
Hi Kevin,
Are you initializing CS0 in your code? You only listed the setting for CS1 above.
If you are not initializing CS0, then that might be causing your problem. The FlexBus was originally designed to go on some of our MPU products that don't have internal flash, because of this there is a global boot chip select feature. This feature causes the FlexBus to come up in a mode where CS0 will hit for all FlexBus accesses until the CSMR0[V] bit is set.
So if you aren't initializing CS0 in your current code because you haven't gotten around to bringing up the SRAM yet, then that is probably interfering with the chip select for your LCD panel. Try putting in some values for CS0 (make sure the address range for CS0 and CS1 do not overlap and make sure to set CSMR0[V]) and that might solve your problem.
Hope this helps,
Melissa
Hi Kevin,
Are you initializing CS0 in your code? You only listed the setting for CS1 above.
If you are not initializing CS0, then that might be causing your problem. The FlexBus was originally designed to go on some of our MPU products that don't have internal flash, because of this there is a global boot chip select feature. This feature causes the FlexBus to come up in a mode where CS0 will hit for all FlexBus accesses until the CSMR0[V] bit is set.
So if you aren't initializing CS0 in your current code because you haven't gotten around to bringing up the SRAM yet, then that is probably interfering with the chip select for your LCD panel. Try putting in some values for CS0 (make sure the address range for CS0 and CS1 do not overlap and make sure to set CSMR0[V]) and that might solve your problem.
Hope this helps,
Melissa
Hi Melissa,
Thanks for your reply.
No, I've not initialised CS0 as of yet as I just wanted to get the LCD display working first.
When I look on an oscilloscope for FlexBus CS activity, I see absolutely nothing at all which seems to indicate that the FlexBus isn't working at all. Or it could be like you suggest, I need to initialise CS0 too.
I'm certain that I've mapped the FB correctly as per a working system I had set up with the K60 tower and my own custom LCD PCB using CS2.
Best regards,
Kevin
Just as an update, this now works perfectly.
Thanks for your help Melissa.