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.

C6713 digital data

Hi,

I know c6713 has a codec to read analog inputs, is there any way i can work on digital pulses using c6713.

I need to take the digital pulses coming from tac line and convert that digital pulses to a analog signal and send it out through line in. 

  • Navaneeth,

    You cannot send anything out through line in. This will not be possible.

    You can use a GPIO to sample a signal line. Each time you sample it is the equivalent of a pulse or non-pulse. You can use a timer to help with determining the time between samples.

    Regards,
    RandyP
  • Thanks.

    Have a small description about the project, I would be getting a Tac  signal from Tac line  which is a digital pulses, so i have to output a analog signal based on received pulses. 

    Is there any sample example for such type. 

    I am new to dsp , so any help would be appreciated. 

  • Navaneeth,

    "Tac signal from Tac line" does not give enough information to make any greater or more specific recommendation that what I posted above about using a GPIO. Can you do this with a GPIO?

    You can search for an application note that describes creating a UART on a C6000 device. I believe there are descriptions for using GPIOs and using a McBSP port. I do not have the app note reference name for you, but if you try a variety of search terms in TI.com, you should find it. You could search in the E2E forum, too, since it has probably been referenced at least once over the years.

    Regards,
    RandyP
  • Tac line is kind of digital pulses  which has to be used as a input and use it for a mathematical expression and send it out to DAC and produce a analog signal.

    Some thing like below. This tac line tells us what is the Band pass frequency of the fan. Using it we produce the same sound that of fan. 

  • I got a sample code to configure the GPIO, which was executed without any error. Now i am not sure how to read the data from the pin. Have attached the sample code.

    #include <dsk6713.h>
    >
    > #define GPIO_ENABLE_ADDRESS 0x01B00000
    > #define GPIO_DIRECTION_ADDRESS 0x01B00004
    > #define GPIO_VALUE_ADDRESS 0x01B00008
    >
    > void main( void )
    > {
    > int* GPIO_ENABLE_REGISTER,* GPIO_DIRECTION_REGISTER, *
    > GPIO_VALUE_REGISTER ;
    >
    > GPIO_ENABLE_REGISTER = (int*)GPIO_ENABLE_ADDRESS ;
    > GPIO_DIRECTION_REGISTER = (int*)GPIO_DIRECTION_ADDRESS ;
    > GPIO_VALUE_REGISTER = (int*)GPIO_VALUE_ADDRESS ;
    >
    > *GPIO_ENABLE_REGISTER = 255 ;
    > *GPIO_DIRECTION_REGISTER = 255 ;
    >
    > DSK6713_init();
    >
    > while( 1 )
    > {
    > *GPIO_VALUE_REGISTER = 255 ;
    > DSK6713_waitusec(500000);
    > *GPIO_VALUE_REGISTER = 0 ;
    > DSK6713_waitusec(500000);
    > }
    >
    > }

  • Can i have any update on the request.

    I would simply like to take digital data through GPIO ports and send it out to codec, which converts it to analog output. 

  • Navaneeth,

    You have sample code for accessing GPIO registers. You also need to find sample code for accessing codec outputs, which probably means using the McBSP ports.

    Navaneeth Karthikeyan said:
    > while( 1 )
    > {
    > *GPIO_VALUE_REGISTER = 255 ;
    > DSK6713_waitusec(500000);
    > *GPIO_VALUE_REGISTER = 0 ;
    > DSK6713_waitusec(500000);
    > }

    In your GPIO sample code, what is the line below doing?

    Navaneeth Karthikeyan said:
    > *GPIO_VALUE_REGISTER = 255 ;

    Is this reading from or writing to the GPIO register? Is it accessing a single data line or more than 1?

    Can you observe the GPIO pins with a scope or change them with a signal generator (or even with a manual switch)?

    When you read the GPIO register, if there are several pins providing values into that register, how can you pull out or extract the single line that you want to read? Since that will be a simple binary 1 or 0, you will next figure out an algorithm that will convert a series of binary 1 or 0 data into a numeric value to be written to the codec.

    You will:

    • read a series of binary values
    • construct a numeric value from that series using some algorithm of your design
    • possibly collect a series of those numeric values into a buffer
    • possibly run a filtering algorithm on those numeric values in the buffer
    • generate a value to be written out, or a collection of values
    • write that value or values to the codec, probably through a McBSP port

    Regards,
    RandyP

  • Hi,

    I had turn over on my project.
    All i have to do is produce a 610HZ tone when ever i get a digital pulse to my DSP from arduino. So all i need to know is how to input that digital signal to trigger my DSP.

    Thanks & Regards,
    Navaneeth
  • I found this sample code from online. I looked at it, but couldn't figure out what is it doing. Nothing shows up on the watch window.
    I have been looking for sample code to read data through GPIO pins. I couldn't find any.
  • Navaneeth,

    Go to the Wiki at http://processors.wiki.ti.com and search for "C6713 workshop" (no quotes). Go through that training material. We usually have examples that do things based on the state of a switch. Reading the state of a switch is reading from a GPIO.

    Regards,
    RandyP
  • I had a small code written for GPIO. I am able to write a data, but unable to read data from same port. Not sure what is happening.

    #include <stdio.h>
    #include <stdlib.h>
    #include <csl_gpio.h>
    #include <csl_gpiohal.h>
    #include <csl_irq.h>

    // GLOBAL VARIABLES
    volatile int flag = 1;
    volatile int pulse_flag = 1;
    int X;

    // CODE TO DEFINE GPIO HANDLE
    GPIO_Handle gpio_handle;

    // GPIO REGISTER CONFIGURATION
    GPIO_Config gpio_config = {
    0x00000000, // gpgc = Interruption passthrough mode
    0x0000FFFF, // gpen = All GPIO 0-15 pins enabled
    0x00000000, // gdir = All GPIO pins as inputs
    0x00000000, // gpval = Saves the logical states of pins
    0x00000000, // gphm All interrupts disabled for IO pins
    0x00000000, // gplm All interrupts for CPU EDMA disabled
    0x00000000 // gppol -- default state */
    };

    // Function prototypes
    void send_edge();
    void delay();

    // Function definitions
    void delay()
    {
    // Delay function
    int count, count2;
    for(count = 0; count < 200; count++)
    {
    for(count2 = 0; count2 < 50000; count2++);
    }
    }

    void send_edge()
    {
    DSK6713_init();
    // Open and configure the GPIO
    gpio_handle = GPIO_open( GPIO_DEV0, GPIO_OPEN_RESET );
    GPIO_config(gpio_handle,&gpio_config);
    // Send values through the pins

    GPIO_pinRead(gpio_handle,GPIO_PIN2);

    /*delay();

    GPIO_pinWrite(gpio_handle,GPIO_PIN2,1);
    delay();

    GPIO_pinWrite(gpio_handle,GPIO_PIN2,0);*/

    X = GPIO_PIN2;
    }

    main()
    {
    while(1)
    {
    send_edge(); // Configures the pins and sends a rising edge
    DSK6713_LED_toggle(1);
    delay();

    }
    }
  • Navaneeth,

    It is good to hear that you have been able to write to the GPIO port.

    How are you confirming that you wrote to the pin successfully?

    Which instruction line are you using to read from the GPIO port? How are you determining whether or not you have read from the port successfully?

    Regards,
    RandyP
  • I made the led blink each time DSK reads the data.
  • Navaneeth,

    Sounds good, you got your code working.

    Can you share with us what changes you made to make it working, Which instructions you are using to read from a GPIO Port?