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.

gel file for TMS320C6722B FLOATING POINT DSP

Other Parts Discussed in Thread: TMS320C6722B

can anyone help me by posting gel file of TM320C6722B and linker,command and library file for the same i am using CCS 3.3 with XDS510 USB EMULATOR

  • Nikhil,

    See attached.  Note that the linker file is for an app that does not use DSPBios.

    Steve

    C672x_gel_and_libs.zip
  •  

    Hi Mr Steven Tuttle ,

    thanks for the reply canyou post any examle code for this dsp

    i am new to dsp's so can you please help me

  • please anyone post the code in 'c'

    basics how to access a regester

    read and writes toa regester

  • Nikhil,

    There are different ways to set up the DSP registers, depending on how you plan to use the chip.

    Some people use DSPBios and its drivers to run the chip.  I don't use that, but I do use the CSL library, and sometimes I use direct access to the registers.  See the CSL library test programs for examples of that.

    To access registers directly, you just need to know the physical address of the register.  For example, to write to the McASP0 register on the C6722B chip, to set/clear a GPIO pin, use the following C code:

        // set a GPIO signal high for timing marker
        *((volatile Int32 *) 0x4400001c) = 1;  // set AXR0(0)

        // set a GPIO signal low for timing marker
        *((volatile Int32 *) 0x44000020) = 1;  // clear AXR0(0)

    You can use this technique along with a Timing Analyzer to watch the GPIO pin, and measure the time spent doing a particular set of tasks in the DSP code.  Note that you must have also set up the McASP0 configuration registers, to determine which pins are GPIO and which are serial audio pins, for this technique to work.

    To read the value of a register using direct access, you can use:

        // Read the McASP0 Global Control (GBLCTL) register
        x = *((volatile Int32 *) 0x44000044);

    Basically, this code is just 'type-casting' the register's physical address to be a pointer to a 32-bit integer (or a 16-bit Int, if you prefer), and then de-referencing that pointer to access the memory that the pointer is pointing to.  Hopefully, you have a good grasp of pointers in C.

    See the 'Memory Map Summary' in the C6722B data sheet for the base address of the registers for a given peripheral.  See the peripheral's Reference Guide for the offset of a particular register, relative to that peripheral's base address.

    If you have opened a CSL handle to use a particular peripheral, you can use the handle variable to access individual registers:

            /* Ensure that the I2C module starts from a clean state, by     */
            /* asserting the I2C module reset signal.  This reset will be   */
            /* released by the state machine, after an I/O transfer request */
            /* has been received.                                           */
            hI2cm->regs->ICMDR = 0;

    Here, the 'hI2Cm' variable is the handle obtained from opening the I2C device using the CSL library functions.  The 'regs' member is a pointer to a struct that models the peripheral's physical registers, and the 'ICMDR' is the name of the register being accessed.  Don't be afraid to browse through the CSL library header files to see how it all works - its just C code, and it is fairly simple code (for most peripherals).

    Steve

  • hi steve

    thanks for the reply

    i am configuring SPI1 at address 0x48000000 in 3 pin master mode

    in the following way

    #include<stdio.h>


    typedef  volatile unsigned * volatile spi;


     
    #define SPIGCR0         0x48000000
    #define SPIGCR1         0x48000004
    #define SPIINT0         0x48000008
    #define SPILVL          0x4800000C
    #define SPIFLG          0x48000010
    #define SPIPC0          0x48000014
    #define SPIPC1          0x48000018
    #define SPIPC2          0x4800001C
    #define SPIPC3          0x48000020
    #define SPIPC4          0x48000024
    #define SPIPC5          0x48000028
    #define SPIRES1         0x4800002C
    #define SPIRES2         0x48000030
    #define SPIRES3         0x48000034
    #define SPIDAT0         0x48000038
    #define SPIDAT1         0x4800003C
    #define SPIBUF          0x48000040
    #define SPIEMU          0x48000044
    #define SPIDELAY        0x48000048
    #define SPIDEF          0x4800004C
    #define SPIFMT0         0x48000050
    #define SPIFMT1         0x48000054
    #define SPIFMT2         0x48000058
    #define SPIFMT3         0x4800005C
    #define VECT0           0x48000060
    #define VECT1           0x48000064

     

    void main()
    {

    int i=0;
    int j,x;
    PLL_init();
         i=0;

     *(spi)SPIGCR0   = 0x00000001;   /* Removing SPI1 from RESET */


     *(spi)SPIGCR1   = 0x00000003;   /* Configuring the SPI1 in MASTER mode in Disabled State */

     *(spi)SPIPC0    = 0x00000E00;   /* Configuring SPI1 in 3 pin mode */

     *(spi)SPIDAT1   = 0x01000000;   /* Selecting FORMAT1 for Data Transfers */
     
     *(spi)SPIFMT1   = 0x00001F10;   /* Configuring the Data transfer format eith clk of 3.9MHz and * bit Character length*/
     
     *(spi)SPIDELAY  = 0x00000000;
     
     *(spi)SPIINT0   = 0x00010150;

     *(spi)SPILVL    = 0x00000000;

     *(spi)SPIGCR1   = 0x01000003;   /* Enabling the SPi1 in Master mode */

     *(spi)SPIINT0   = 0x00010150;   /* Enabling the DMA requests */

     

     

     

    while(i==0)
     {


        *(spi)SPIDAT1   = 0x01004ABc;

        
          x = *(spi)SPIBUF;

        *(spi)SPIDAT1   = 0x01007301;

     x = *(spi)SPIBUF;

     

       
       
     }


    }

     

     

    now my problem is when i try to send the data greater than 8 bits i could not transmit the data and even the data is not xactly written into the SPIDAT register

     

    when the same data greater 8 bits when i tranfer in loop back mode iam able to see it in the SPIBUF regester

     

     

    can you help mee

  • Nikhil,

    When you type-cast the pointer to (unsigned *), you are telling the compiler that 'the object the pointer is pointing to is a 32-bit unsigned integer'.

    When you want to write 8 bits only, you must type-cast the pointer to (unsigned char *) or (Uint8 *).

    Then when the pointer is de-referenced, the write to memory will be an 8-bit write operation.

    Steve

  • hi steven,

     got trough the SPI  issue

    is there any library function or procedure for implementing DTMF tones detection in tms320c6722b through mcasp port

     

    regards

    nikhil  

  • hi steven,

    can even post me the initialization sequence for I2C port

  • Nikhil,

    I don't have an answer to that question.  I am not aware of any DTMF decode libraries.

    Steve

  • Nikhil,

    > hi steven,

    > can even post me the initialization sequence for I2C port

    I2C init code depends on whether the I2C port will be a master or a slave port.  Which are you using?

    Steve

  • hi steven,

    i am using i2c in master mode

     

    regards

    nikhil

  • Nikhil,

    See the thread in this 'C6000 Single Core DSP' forum, titled 'Simple Transmit/Receive Program for C6713 I2C'.

    I submitted a code sample there for a master I2C implementation, for the C6713 chip.  The I2C module on the C6722 chip is virtually the same (as far as I know, anyway).

    You can find the information on setting up the I2C module clock and SCL clock registers in the TI reference guide on the C672x I2C module (spru877e).  See Section 3.8, on Clock Generation.

    I hope this helps.

    Steve