This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Manipulate registers on C6713?

Part Number: TMS320C6713B

Tool/software: TI C/C++ Compiler

Hello,
I have a project that implements the CAVLC entropy coding on C6713, I want to know how to manipulate the registers to store the results and the variables?
Is it from file c6713.cmd? and if so, how to proceed?
Regards,
Manel.

  • Hi Manel,

    Registers are read from or written to from within a .c file. If you have a look at the CSL code in Processor SDK RTOS you'll how it is usually done. For example here is how you put the I2C module in reset (for C6678, but the procedure for writing to registers is the same for all processors):
    void I2CMasterDisable(uint32_t baseAdd)
    {
    CSL_I2cRegsOvly i2cRegs = (CSL_I2cRegsOvly)baseAdd;

    i2cRegs->ICMDR &= ~CSL_I2C_ICMDR_IRS_MASK;
    }


    You get a pointer to the volatile register address: i2cRegs->ICMDR and just write a value in it (in this case through bitwise operators). To put this procedure in a simpler form you can do the following:

    #define REGISTER_ADDRESS 0x02320008 //this is just an example register address
    volatile uint32 *ptr_to_reg_address;
    ptr_to_reg_address = REGISTER_ADDRESS;
    //this is the actual write
    ptr_to_reg_address |= VALUE_YOU_WANT_TO_WRITE;

    Just one clarification. Processor registers are manipulated so that you can configure the corresponding interface to work according to your use case... they are NOT used to store codec results or variables. You should use the external memory (i.e. RAM) for this. For example in the CMD file you define your DDR start address and length as follows:
    MEMORY
    {
    ........
    /*other definitions here*/
    ........
    DDR3 (RWX) : org = 0x80000000,len = 0x10000000 // start address 0x80000000,len = 0x10000000
    }

    Then in your C code you can store the results in memory buffers in DDR.

    Best Regards,
    Yordan
  • Hi Yordan,

    thank you for the explanation,

    so when i configure DDR start adresse and the length in the cmd file, how to store the results (in the C code), i mean the right syntax?

    regards,

    Manel

  • Hi Manel,

    You create a pointer to that memory location (just as the example with the registers) and just write the value in it (same code applies to ddr addresses as well).

    Best Regards,
    Yordan