Using the External Bus Interface on S12X?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using the External Bus Interface on S12X?

3,320 Views
ThomasG
Contributor I
Hi,
 
I am working on a project that is using an MC9S12XDT256 and we want to use the External Bus Interface (EBI) to control an off-chip communications controller.
 
Are there any things that must be done in software to operate the S12X in normal expanded mode?  In the datasheet, I can only find that the hardware must be set up properly on pins MODC, MODB, MODA, and ROMCTL (Section 1.4).
 
If there is an app. note that is more applicable to how to do the software setup to use the EBI, can you please point me to it.  I have only been able to find one mainly dealing with the timing of all the signal.  I am just wondering if I need to make linker file or hw register changes to use the EBI on the S12X.
 
Thank you,
 
Thomas
Labels (1)
0 Kudos
Reply
6 Replies

1,268 Views
Steve
NXP Employee
NXP Employee
Thomas, here's a quick outline of steps :
1/ Choose your reset mode
You can start in single-chip mode and then go to expanded mode or go directly into expanded mode using the MOD pins.
2/ Choose the appropriate chip select(s) if needed. The chip selects apply to different addresses in memory so you should choose this in advance of designing the hardware
3/ Design the hardware
4/ In software configure the bus as needed
Size of address and data bus (EBICTL0)
EWAIT and external stretch requirements (EBICTL1)
Decide if the internal flash is enabled (MMCCTL1)
 
So there really isn't much software configuration required. Have a look at these points and come back if you have any more questions.
0 Kudos
Reply

1,268 Views
ThomasG
Contributor I
Steve,
 
Thanks for the reply.  I do have one question.  How do you go to expanded mode after you start in single-chip mode.  That would be the preferred method but I guess I am not understanding what registers need to be changed.  Is it registers in the MMC because the EBI seems to only have the 2 registers you mentioned?  This is preferred because the board I am working on is currently set for single-chip mode but the resistors can be changed on the MOD pins to start in expanded mode.
 
Thanks.
0 Kudos
Reply

1,268 Views
Steve
NXP Employee
NXP Employee
Thomas,
  The mode of the device is controlled in the MODE register which is in the Memory Mapping Control Module . The description of the register also contains a state machine that shows the allowed changes of mode.
 In general the expanded bus and memory mapping modules work closely together. The best way to think about it is that the EBI is concerned with the signals going out of the chip while the memory mapping control is concerned with how that memory appears in the map of the CPU (internal and external memory)
0 Kudos
Reply

1,268 Views
Alban
Senior Contributor II
Hello,

I overheard that an Application Note was in preparation for S12X.
I don't know when this AN3148 will be ready, but it will be downloadable from: AN3148.

To receive information as soon as it comes out, subscribe to the Freescale Design News and add S12X as your interest.

Cheers,
Alban.

0 Kudos
Reply

1,268 Views
ThomasG
Contributor I
Thank you for all the replies.
 
One final question:
 
I went ahead and just did the transition from Normal single mode to Normal expanded mode using a write to the MODE register during startup.  This looked like it worked because the MODE register accepted and stored the setting.
 
After the external bus interface registers are setup, is using this feature as simple as putting a data variable in the memory spaces that are controlled by the chip selects and writng a value to this variable.  If this is the case, do I just allocate a segment in the linker file using a global memory address specifier and put the data variables for the EBI in this segment.
 
Thanks,
 
Thomas
0 Kudos
Reply

1,268 Views
Alban
Senior Contributor II
Hello Thomas,

Never say a Final question :smileyhappy:

Yes, you can write in the MODx registers to change the mode of the MCU.
After you have configured the EBI properly, accessing the external peripherals are as easy as the internal ones.
They will be in the map like the rest and transparent for the software.

You can declare a segment and use #pragma and you can also declare your variable from the external bus directly @0xXX.XXXX.

Cheers,
Alban.
 
0 Kudos
Reply