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

check the input & ouput of Triscend E5 I/O pin

Hi, can anyone tell me how to
set the input and check the output
of Triscend E5 I/O pins when debugging
in uvision 2? Thanks.

Parents Reply Children
  • thx for the reply. sorry i am new
    in using the tools. can u explain
    how i should use the address? i implemented
    I2C bus in the CSL on E5, then associated
    the SDA and SCL to two E5 PIO pins.
    can u tell me how to map them into addresses
    or export them into SFRs? thx a lot.

  • The Triscend tools allow you to create devices in the programmable logic. The tools allow you to define registers that may be accessed by the processor as either xdata addresses or SFR addresses.

    In the case of SFRs, addresses will be allocated to the registers that are not currently used by any existing SFR.

    In the case of xdata, addresses will be allocated to the registers from the high end addresses not currently used by the E5.

    Generally speaking it is better to choose SFR addresses for quick access. The only compelling reason to choose xdata addresses is where you want to be able to point to the registers. For example, several identical UARTs are constructed in the programmable logic and you wish to handle them all with the same driver software. With the UART registers defined in xdata, the driver software may be invoked with a different pointer to access each UART.

    In any case, xdata or SFR, the Triscend tools will place the the addresses of the registers in the file triscend.h. This file can be included into any C module that requires to access the programmable logic.

  • "Triscend tools will place the the addresses of the registers in the file triscend.h."

    Actually, that file will be called <project>.h, where <project> is the name of your FastChip Project.

    You will also need to add the corresponding <project>.c to your uVision Project.

    Note that FastChip v2.3.0 will truncate this to 8.3 characters

  • Reserved XDATA addresses and non CSL implemented stuff are placed in a TE5_CSOC.H file.

    TE5_CSOC.H
    
    * $Id: //depot/software/FC220/include/TE5_CSOC.h#5 $ */
    /***************************************************************************
     * Triscend E5 CSoC Device Common Register Definition File
     *
     * This file applies to all members of the Triscend E5 device family.
     *
     * Copyright (c) 2000, 2001 Triscend Corporation. All rights reserved.
     ***************************************************************************
     */
    
    #ifndef _TE5_CSOC_H
    #define _TE5_CSOC_H
    
    /***************************************************************************
     * E5 SFR defintions
     ***************************************************************************
     */
    
    /***************************************************************************
     * BYTE Registers
     ***************************************************************************
     */
    /* Unused SFR locations [0x80,0xff] are available for use by a soft module. */
    //sfr P0    =   0x80;   /* to be exported and implemented in CSL */
    sfr SP      =   0x81;
    sfr DPL     =   0x82;
    sfr DPH     =   0x83;
    sfr DPL1    =   0x84;
    sfr DPH1    =   0x85;
    sfr DPS     =   0x86;
    sfr PCON    =   0x87;
    sfr TCON    =   0x88;
    sfr TMOD    =   0x89;
    sfr TL0     =   0x8a;
    sfr TL1     =   0x8b;
    sfr TH0     =   0x8c;
    sfr TH1     =   0x8d;
    sfr CKCON   =   0x8e;
    /* unused: 0x8f */
    //sfr P1    =   0x90;   /* to be exported and implemented in CSL */
    /* unused: [0x91,0x97] */
    sfr SCON    =   0x98;
    
    ...
    
    ***************************************************************************
     * E5 Configuration Register Unit (CRU) defintions
     ***************************************************************************
     */
    
    /* All addresses in the range [0xff00,0xffff] are reserved */
    #define CMAP0_TAR	(*((unsigned char volatile xdata*) 0xff00))
    #define CMAP0_ALT	(*((unsigned char volatile xdata*) 0xff01))
    #define CMAP1_TAR_0	(*((unsigned char volatile xdata*) 0xff02))
    #define CMAP1_TAR_1	(*((unsigned char volatile xdata*) 0xff03))
    ...

    All your module register declarations will be placed in the <yourprojname>.c file, right after some macro definition.

    #ifdef TASKING_TOOLS
    #   define SFR_BIT(name,location) _sfrbit name _at( location );
    #   define SFR_BYTE(name,location) _sfrbyte name _at( location );
    #   define CHAR_XDATA(name,location) volatile unsigned char _xdat name _at( location );
    #   define CHAR_ARRAY_XDATA(name,location,size) volatile unsigned char _xdat name[size] _at( location );
    #else
    #   define SFR_BIT(name,location) sbit name = location;
    #   define SFR_BYTE(name,location) sfr name = location;
    #   define CHAR_XDATA(name,location) volatile unsigned char xdata name _at_ location;
    #   define CHAR_ARRAY_XDATA(name,location,size) volatile unsigned char xdata name[size] _at_ location;
    #endif
    #define USE_PROJECT_FILE_MACRO
    
    /* add <FastChip install directory>\include to the compiler include path */
    #include <TE5_CSOC.h>
    
    
    // ========= BEGIN SOFT MODULE REGISTER DECLARATIONS ======
        SFR_BYTE (P1,0x90)
    // 
    //     SELECTOR WITH USER ASSIGNED ADDRESS   
    // 
    
    // ========== END SOFT MODULE REGISTER DECLARATIONS =======
    

    FastChip Version 2.3.0 Build 011129-0916

    - Alex

  • Thx all for your inputs.I really
    appreciate it. Again, sincere thanks
    to all.