This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

XC167 and external flash ROM module over EBC

I have an Infineon SK-XC167CI Easy Kit V3 board, soldered with an Infineon XC167CI-32F40F microcontroller. I am using the Keil UVision 3 IDE. The board has been extended to include an external flash ROM module; the AMD AM29F400B unit (512 Kbytes). This external ROM module is wired into the chip select 1 (CS1) signal; port 6, pin 1 (pin 8 on the microcontroller).

I am trying to access the external ROM module, but am not having much success.

I believe that I have the CS1 area mapped onto the XC167s address space starting at 100000h, using the EBCMOD0, EBCMOD1, TCONCS0, FCONCS0, ADDRSEL1, TCONCS1, and FCONCS1 registers.

I am following the instructions given in the AM29F400B data sheet for requesting the manufacturer id and the device id from the flash ROM module.

I think that my problem lies in the way that I have the EBC setup (which I am doing in the start_v2.a66 file) rather than in the way that I am actually forming the address accesses (the flash ROM module interrogation requests), but I could be wrong.

Any direction that you might be able to give me at this point would be extremely gratefully received.

Parents
  • As a result of Chris's project I now have this working.

    The main item which seemed to be affecting how my code was working was that in my start_v2.a66 I had CS7 (the LXBus) enabled. When I disabled this, the code started to work.

    I have not investigated this to try to work out why this should be.

    Having said that, this morning, (Friday) I have the code working whether CS7 is enabled OR disabled.

    At this point I am not sure that I mind which way things are - I am just happy that it is working.

    As I do not see that I will be using the CS7 right now, I will leave it disabled.

    Chris, and Oleg - both, many, many thanks for your help.

    Yours,

    Simon May

Reply
  • As a result of Chris's project I now have this working.

    The main item which seemed to be affecting how my code was working was that in my start_v2.a66 I had CS7 (the LXBus) enabled. When I disabled this, the code started to work.

    I have not investigated this to try to work out why this should be.

    Having said that, this morning, (Friday) I have the code working whether CS7 is enabled OR disabled.

    At this point I am not sure that I mind which way things are - I am just happy that it is working.

    As I do not see that I will be using the CS7 right now, I will leave it disabled.

    Chris, and Oleg - both, many, many thanks for your help.

    Yours,

    Simon May

Children
  • As a result of some problems which I have been having over the last few days, I wanted to post a short explanation of what I have got set up, and items which should be checked to ensure smooth operation !

    Firstly, the hardware :
    I have an XC167CI-32F soldered onto an Infineon starter kit
    the starter kit has an 8 MHz external crystal
    in addition there is an AMD (Spansion) AM29F400B-70 external flash ROM module soldered on to the board
    the external flash ROM is wired into 'word' mode
    the external flash ROM is wired as a 16-bit demultiplexed bus
    the external flash ROM is wired on CS0
    the address lines of the XC167 are mapped to the address lines of the AM29F400B as specified in the AMD data sheet, ie: A1 from the XC167 is connected to A0 of the AMD, and so forth

    Secondly, the start up code. In start_v2.a66 :

    PLLCON
    .PLLODIV EQU 4
    .PLLIDIV EQU 0
    .PLLVB EQU 1
    .PLLMUL EQU 24
    .PLLCTRL EQU 3
    .PLLWRI EQU 0
    /* these values give a system clock of 40 MHz (on an 8 MHz crystal), but check that VCO is within sensible limits */

    EBCMOD0
    .SAPEN EQU 4
    .CSPEN EQU 5
    .ARBEN EQU 0
    .EBCDIS EQU 0
    .WRCFG EQU 0
    .BYTDIS EQU 0
    .ALEDIS EQU 0
    .RDYDIS EQU 1
    .RDYPOL EQU 0

    EBCMOD1
    .APDIS EQU 0
    .A0PDIS EQU 0
    .ALPDIS EQU 0
    .DHPDIS EQU 0
    .WRPDIS EQU 0

    FCONCS0
    .ENCS0 EQU 1
    .RDYEN0 EQU 0
    .RDYMOD0 EQU 0
    .BTYP0 EQU 2

    TCONCS0
    .PHA0 EQU 0
    .PHB0 EQU 1
    .PHC0 EQU 3
    .PHD0 EQU 1
    .PHE0 EQU 8
    .RDPHF0 EQU 3
    .WRPHF0 EQU 3

    Lastly, the actual software.

    The specifics of the writes / reads which need to be issued are detailed in the AMD data sheet, so I will not go into them here other than to say that when composing an address to use from the point of view of the XC167, if the AMD data sheet says that it needs an access to take place at address 0xAAA, then the software must use the base address of the flash ROM module from the point if view of the XC167 (which, if wired to CS0, will be 0x0 ) added to the address that the AM29F400B expects (for instance, 0xAAA) bit shift one position to the left. Thus

    AMD expects to see 0xAAA
    XC167 must access ( base_address + ( 0xAAA << 1 ) )