AnsweredAssumed Answered

Codewarrior + MC9S12XEP100 + External Bus Interface (EBI)

Question asked by Leandro Maia on Feb 9, 2017
Latest reply on Feb 10, 2017 by Alice_Yang

I'm designing a system with these main components:

  • CodeWarrior latest version
  • MC9S12XEP100 microcontroller
  • Memory Cypress CY7C1041GN (256K x 16b)

 

I've a lot of information about hardware interface and registers but few about CodeWarrior Project settings.

A simple schematic was attached in order to illustrate what I'm trying to do.

The chosen memory can be easily controlled by uC signals but I don't know how to make my code address correctly using FAR key word.

 

Following uC datasheet, AN2708 and AN2992, I got these registers values:

 

EBICTL0 : 0x33
--------
||||||||
|||+++++- ASize: 10011 - External Address Bus Size (19 lines)
||+------ HBDE : 1 - High Data Byte Enabled
|+------- 0    : 0 - Always 0
+-------- ITHRS: 0 - Reduced Input Threshold disabled (Standard Level on all pins)

EBICTL1 : 0x00
--------
||||||||
|||||+++- EXSTR0: 000 - External Access Stretch Option 0
||||+---- 0     : 0 - Always 0
|+++----- EXSTR1: 000 - External Access Stretch Option 1
+-------- 0     : 0 - Always 0

MMCCTL0 : 0x0C
--------
||||||++- CS0 : 0x00 - Chip Select 0 Disabled
||||++--- CS1 : 0x11 - Chip Select 1 Enabled
||++----- CS2 : 0x00 - Chip Select 0 Disabled
++------- CS3 : 0x00 - Chip Select 0 Disabled

MODE : 0xA0;
--------
|||+++++- 0 : 00000 - Sempre 0
+++------ MOD[C:A] : 101 - Normal Expanded Mode

 

Suppose I have a program segment that needs to be completely fitted inside 200000h–3FFFFFh.

I know I can use absolute address and set a variable at that address.

But how can I do it automatically for variables and code?

 

Today I have a project using EBI with HCS12DP512.

In this project, I set PRM file and everything was ok because my External Memory is only 16KB.

PPage was not necessary and my code was treated like an internal firmware.

However, in this new project, I need that every single access use the correct PPage.

 

Thanks.

Attachments

Outcomes