External memory on a XC16x Board

Hi Everybody,

I'm still experimenting with Infineon's XC161 Starter Kit using the Keil C166 compiler, v4.27 (linker version 4.28). Almost everything I need works OK now, except the external bus controller. Below I'll describe my situation:

Hardware
========

I've connected the RAM to the processor by setting switch S101.8. This is the configuration for the multiplexed mode, so I also switched S103.1 and S103.2 off for 16 bits multiplexed mode.

The CS-lines are enabled by off-switching S102.6 and S102.7. I use 4-bit address lines by setting S102.4 and S102.5.

S102.8 is switched on to use /WR and /BHE as /WRL and /WRH.


Software
========

In the startup file (START_V2.A66) I configured the EBC as follows:


$SET (CONFIG_EBC = 1)
_SAPEN      EQU    4
_CSPEN      EQU    5
_ARBEN      EQU    0
_SLAVE      EQU    0
_EBCDIS     EQU    0
_WRCFG      EQU    1
_BYTDIS     EQU    0
_ALEDIS     EQU    0
_RDYDIS     EQU    0
_RDYPOL     EQU    0
_APDIS      EQU    0
_DHPDIS     EQU    0


CS1 as follows:


$SET (CONFIG_CS1 = 1)
_ADDR1      EQU    0x400000
_SIZE1      EQU    256*KB
_ENCS1      EQU    1
_RDYEN1     EQU    0
_RDYMOD1    EQU    0
_BTYP1      EQU    3
_PHA1       EQU    3
_PHB1       EQU    1
_PHC1       EQU    3
_PHD1       EQU    1
_PHE1       EQU    25
_RDPHF1     EQU    3
_WRPHF1     EQU    3


Maximum bus times to control the RAM, so it isn't a timing problem. In the target options (under 'External Memory") I set the following values for #1:

Start: 0x400000
Size : 0x40000

In my C-code I also set the P6 pins to output.

I've looked over my problem several times but couldn't trace the things going wrong. I also tried other memory configurations (8 bit mux, 8 bit demux and 16 bit demux) but all of them with no success.

Final thing to tell about are the contents of my .M66-file. All data is located in valid areas (I can see vars in the 0x400000 area), but one line is very strange:


  VALUE       PUBLIC SYMBOL NAME               REP   TGR  CLASS   SECTION
=======================================================================
-- cut --
  3F8000H     ?C_NDATABASE                     CONST ---  ---     ---
-- cut --


I don't know if 0x3F8000 should be an address, that is used somewhere else, but IF so, then it's not valid. I didn't configure this value anywhere; it's generated by Keil's Linker.

Well, phiew, that was a lot of writing, so I hope somebody can help me? :)

Kind Regards,
Dennis Ebben

Parents
  • Hi again,

    Replying to my own message to get it on top of the thread list. ;)

    Yesterday I succeeded in controlling the RAM by using CS0 (in 16 bit demux mode). Off course this works, because CS0 is the default Chip Select and will always be used by the controller when I write to/read from an undefined memory area. Don't know if the other CS's work.

    On /CS2 I connected an LCD. Didn't get it working already, but that could be a software problem. (I can see a toggling signal on /CS2, as well as on /WR and /RD).

    Doesn't really anybody know what the weird NDATA-value stands for, I mentioned in my previous post? (see bottom).

    Kind Regards,
    Dennis Ebben

Reply
  • Hi again,

    Replying to my own message to get it on top of the thread list. ;)

    Yesterday I succeeded in controlling the RAM by using CS0 (in 16 bit demux mode). Off course this works, because CS0 is the default Chip Select and will always be used by the controller when I write to/read from an undefined memory area. Don't know if the other CS's work.

    On /CS2 I connected an LCD. Didn't get it working already, but that could be a software problem. (I can see a toggling signal on /CS2, as well as on /WR and /RD).

    Doesn't really anybody know what the weird NDATA-value stands for, I mentioned in my previous post? (see bottom).

    Kind Regards,
    Dennis Ebben

Children
More questions in this forum