Application Notes

Freescale Semiconductor, Inc.
Application Note
Document Number: AN5095
Rev. 0, 03/2015
Multiplexing Pins Between SDRAM and
FLEXBUS on K65/K66
1. Introduction
This application note introduces the key features on
K65/K66, where pins can be multiplexed between the
SDRAM and FLEXBUS port. This helps save many
pins in the application and is useful in applications that
require many function pins.
© 2015 Freescale Semiconductor, Inc. All rights reserved.
Contents
1.
2.
3.
4.
5.
6.
7.
8.
Introduction
Pins multiplexed between SDRAM and FLEXBUS
Example for hardware connection
Demo to show this feature
Code for the demo
Conclusion
References
Revision History
1
2
3
4
5
6
6
7
Pins multiplexed between SDRAM and FLEXBUS
2. Pins multiplexed between SDRAM and FLEXBUS
Table 1 shows the list of pins that can be multiplexed. When the SDRAM and FLEX BUS are both
working, the multiplexed pins switch automatically. No other configuration is required when it is
running.
Table 1.
Multiplexed pins between SDRAM and FLEX BUS
SDRAM
FLEX BUS
D15 – D0
D31 – D16
A23 – A9
DQM3
DQM1
DQM0
A15 – A0
AD31 – AD16
AD15 – AD1
BE31-24/CS4
BE15-8/CS2
BE7-0/CS3
The FLEX BUS BE function is configured in FB_CSPMCR.
Multiplexing Pins Between SDRAM and FLEXBUS on K65/K66, Application Note, Rev. 0, 03/2015
2
Freescale Semiconductor, Inc.
Example for hardware connection
3. Example for hardware connection
In this application, the following design connects to both SDRAM and 16-bit FLEX BUS-based LCD
with multiplexed pins. The multiplexed pins are identified with green rectangles.
Figure 1. Multiplexed pins on SDRAM
Multiplexing Pins Between SDRAM and FLEXBUS on K65/K66, Application Note, Rev. 0, 03/2015
Freescale Semiconductor, Inc.
3
Demo to show this feature
Figure 2. Multiplexed pins on FLEX BUS
For the full schematic document, refer to the TWR-K65/K66 Freescale Tower System development
board link.
As shown in the images, if these pins are not multiplexed, multiple additional pins are required.
4. Demo to show this feature
The picture is loaded from on-chip to SDRAM after powering on. The picture is then loaded from
SDRAQMA to the FLEX BUS based LCD screen. Figure 3 shows this feature.
Figure 3. Demo to show this feature
Multiplexing Pins Between SDRAM and FLEXBUS on K65/K66, Application Note, Rev. 0, 03/2015
4
Freescale Semiconductor, Inc.
Code for the demo
The running result:
Figure 4. Running result of the demo
The two pictures are loaded from SDRAM to LCD alternatively in this demo.
5. Code for the demo
The main code is shown below.
Initialize the SDRAM and FLEX BUS, then initialize LCD and copy picture data from on-chip flash to
SDRAM. Show the two pictures alternatively from SDRAM to LCD.
The full software package is also attached with this application note.
void lcd_show(void)
{
// point to SDRAM
short * p1 = (short*)0x70000000;
short * p2 = (short*)0x70100000;
int i;
// initiate SDRAM, flex bus and LCD
sdramc_init(120*1000);
flex_bus_init();
lcdc_init();
// load image from on-chip flash to SDRAM
for(i=0; i<320*240; i++)
Multiplexing Pins Between SDRAM and FLEXBUS on K65/K66, Application Note, Rev. 0, 03/2015
Freescale Semiconductor, Inc.
5
References
{
p1[i] = pic1[i];
p2[i] = pic2[i];
}
// show image from SDRAM to LCD which is connected by flex bus
while(1)
{
lcdc_fill_window_pic(0,0,319, 239, (unsigned short *)p1);
for(i=0; i<1000*1000*10; i++);
lcdc_fill_window_pic(0,0,319, 239, (unsigned short *)p2);
for(i=0; i<1000*1000*10; i++);
}
}
6. Conclusion
This application note discusses how to share pins between SDRAM and FLEX BUS, which is an
important feature of K65/K66. This feature is useful in using applications that require many pins. A
demo also shows how to make hardware connection and how to make code to implement this feature.
7. References
The following reference documents are available on www.freescale.com.

K65 Sub-Family Reference Manual (document K65P169M180SF5RMV2)

K66 Sub-Family Reference Manual (document K66P144M180SF5RMV2)
Multiplexing Pins Between SDRAM and FLEXBUS on K65/K66, Application Note, Rev. 0, 03/2015
6
Freescale Semiconductor, Inc.
Revision History
8. Revision History
Table 2.
Revision history
Revision Number
Date
Substantive changes
0
03/2015
Initial Release
Multiplexing Pins Between SDRAM and FLEXBUS on K65/K66, Application Note, Rev. 0, 03/2015
Freescale Semiconductor, Inc.
7
How to Reach Us:
Home Page:
freescale.com
Web Support:
freescale.com/support
Information in this document is provided solely to enable system and software implementers to
use Freescale products. There are no express or implied copyright licenses granted hereunder to
design or fabricate any integrated circuits based on the information in this document.
Freescale reserves the right to make changes without further notice to any products herein.
Freescale makes no warranty, representation, or guarantee regarding the suitability of its
products for any particular purpose, nor does Freescale assume any liability arising out of the
application or use of any product or circuit, and specifically disclaims any and all liability,
including without limitation consequential or incidental damages. “Typical” parameters that may
be provided in Freescale data sheets and/or specifications can and do vary in different
applications, and actual performance may vary over time. All operating parameters, including
“typicals,” must be validated for each customer application by customer's technical experts.
Freescale does not convey any license under its patent rights nor the rights of others. Freescale
sells products pursuant to standard terms and conditions of sale, which can be found at the
following address: freescale.com/SalesTermsandConditions.
Freescale, the Freescale logo, and Kinetis are trademarks of Freescale Semiconductor, Inc., Reg.
U.S. Pat. & Tm. Off. All other product or service names are the property of their respective
owners. ARM, ARM Powered, and Cortex are registered trademarks of ARM Limited (or its
subsidiaries) in the EU and/or elsewhere. All rights reserved.
© 2015 Freescale Semiconductor, Inc.
Document Number: AN5095
Rev. 0
03/2015