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.

Data Transfer between two DSP kits

Hello,

I want to make a an audio transmitter and receiver. I want to know how can I transfer the data from on kit to another by using wire.

I am currently working on GPIO port. But I didn't work. I got output at the pins of GPIO port. But the problem is when I join the two kits using a wire either transmitter side or receiver side get disconnected as I run the code.

Is it a right way to connect two kits using GPIO port by a jumper wire? Or is there any other more sophisticated method to do so?

Regards,

Mukhtar 

  • It is the code for transmitter side:

    I'm using GPIO pin#10 to transfer data and pin#14 to trigger EXTERNAL interrupt to next kit before data is transmitted. 

    #include<dsk6713.h>
    #include<dsk6713_led.h>
    #include<dsk6713_dip.h>
    #include<dsk6713_aic23.h>
    #include<csl.h>
    #include<csl_gpio.h>
    #include<c6x.h>
    #include<csl_irq.h>
    #include<stdio.h>
    #include<stdlib.h>
    #include<math.h>


    Uint32 IN,bit[32];

    void bitform();
    void transmit();

    /* GPIO PORT CONFIGURATION */
    GPIO_Handle gpio_handle;
    GPIO_Config gpio_config = {
    0x00000000, // gpgc = Interruption passthrough mode
    0x0000FFFF, // gpen = All GPIO 0-15 pins enabled
    0x0000FFFF, // gdir = All GPIO pins as outputs
    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
    };

    /* Audio Codec Configuration */
    DSK6713_AIC23_CodecHandle hCodec;
    DSK6713_AIC23_Config config = {
    0x0017, /* 0 - DSK6713_AIC23_LEFTINVOL Left line input channel volume */
    0x0017, /* 1 - DSK6713_AIC23_RIGHTINVOL Right line input channel volume */
    0x01f9, /* 2 - DSK6713_AIC23_LEFTHPVOL Left channel headphone volume */
    0x01f9, /* 3 - DSK6713_AIC23_RIGHTHPVOL Right channel headphone volume */
    0x0011, /* 4 - DSK6713_AIC23_ANAPATH Analog audio path control */
    0x0000, /* 5 - DSK6713_AIC23_DIGPATH Digital audio path control */
    0x0000, /* 6 - DSK6713_AIC23_POWERDOWN Power down control */
    0x0043, /* 7 - DSK6713_AIC23_DIGIF Digital audio interface format */
    0x0081, /* 8 - DSK6713_AIC23_SAMPLERATE Sample rate control */
    0x0001 /* 9 - DSK6713_AIC23_DIGACT Digital interface activation */
    };

    void main(){

    /* Initialize the board and chip support library */
    CSL_init();
    DSK6713_init();
    DSK6713_LED_init();

    /* GPIO Port Setting */
    gpio_handle = GPIO_open(GPIO_DEV0, GPIO_OPEN_RESET);
    GPIO_config(gpio_handle,&gpio_config);

    GPIO_pinEnable(gpio_handle,GPIO_PIN10);
    GPIO_pinEnable(gpio_handle,GPIO_PIN14);

    GPIO_pinDirection(gpio_handle,GPIO_PIN10,GPIO_OUTPUT);
    GPIO_pinDirection(gpio_handle,GPIO_PIN14,GPIO_OUTPUT);

    GPIO_pinWrite(gpio_handle,GPIO_PIN10,0);
    GPIO_pinWrite(gpio_handle,GPIO_PIN14,0);

    /* Start the codec */
    hCodec = DSK6713_AIC23_openCodec(0, &config);
    DSK6713_AIC23_setFreq(hCodec, DSK6713_AIC23_FREQ_16KHZ);

    DSK6713_LED_on(0);

    while(1){
    DSK6713_LED_on(1);
    while (!DSK6713_AIC23_read(hCodec, &IN));
    bitform();
    transmit();
    if(DSK6713_DIP_get(0)==0)
    break;
    }

    DSK6713_AIC23_closeCodec(hCodec);
    DSK6713_LED_off(0);
    DSK6713_LED_off(1);
    DSK6713_LED_off(2);
    DSK6713_LED_off(3);
    }/* MAIN FUNCTION ENDS */


    void bitform(){
    int i;
    Uint32 temp;
    temp=IN;
    for(i=0;i<32;i++)
    bit[i]=0;

    for(i=31;i>=0;i--){
    if(temp<2){
    bit[i]=temp;
    break;
    }
    bit[i]=temp%2;
    temp=temp/2;
    }
    }

    void transmit(){

    int i;
    DSK6713_LED_on(2);
    GPIO_pinWrite(gpio_handle,GPIO_PIN14,1);
    DSK6713_waitusec(0x01);

    for(i=0;i<32;i++){
    GPIO_pinWrite(gpio_handle,GPIO_PIN10,bit[i]);
    DSK6713_waitusec(0x01);
    }

    GPIO_pinWrite(gpio_handle,GPIO_PIN10,0);
    GPIO_pinWrite(gpio_handle,GPIO_PIN14,0);

    }

  • It is the code for Receiver side:

    When EXT-INT4 is triggered, It will start reading data from GPIO pin#10.

    Pin#10 and Pin#14 of transmitter is connected with Pin#10 and Pin#4 of receiver respectively.

    #include<stdio.h>
    #include<string.h>
    #include<stdlib.h>
    #include<time.h>
    #include<csl_gpio.h>
    #include<csl_gpiohal.h>
    #include<csl_irq.h>
    #include<dsk6713.h>
    #include<dsk6713_aic23.h>
    #include<dsk6713_led.h>
    #include<dsk6713_dip.h>

    extern far void vectors();
    Uint32 IN,bit[32];
    Uint16 OUT_L,OUT_R;

    void receive();

    /* GPIO Registers configuration */
    GPIO_Handle gpio_handle; /* Handle for the GPIO */
    GPIO_Config gpio_config = {
    0x00000000, // gpgc = Interruption passtrhrough mode and direct GPIO control mode
    0x0000FFFF, // gpen = All GPIO 0-15 pins enabled
    0x00000000, // gdir = All GPIO pins as inputs
    0x0000FFFF, // gpval = Stores logical level of pins
    0x00000010, // IRQ enable for pin 4
    0x00000010, // Enable Event for pin 4
    0x00000000 // gppol -- default state
    };

    /* Audio Codec Configuration */
    DSK6713_AIC23_CodecHandle hCodec;
    DSK6713_AIC23_Config config = {
    0x0017, /* 0 - DSK6713_AIC23_LEFTINVOL Left line input channel volume */
    0x0017, /* 1 - DSK6713_AIC23_RIGHTINVOL Right line input channel volume */
    0x01f9, /* 2 - DSK6713_AIC23_LEFTHPVOL Left channel headphone volume */
    0x01f9, /* 3 - DSK6713_AIC23_RIGHTHPVOL Right channel headphone volume */
    0x0011, /* 4 DSK6713_AIC23_ANAPATH Analog audio path control */
    0x0000, /* 5 DSK6713_AIC23_DIGPATH Digital audio path control */
    0x0000, /* 6 DSK6713_AIC23_POWERDOWN Power down control */
    0x0043, /* 7 DSK6713_AIC23_DIGIF Digital audio interface format */
    0x0081, /* 8 DSK6713_AIC23_SAMPLERATE Sample rate control */
    0x0001 /* 9 DSK6713_AIC23_DIGACT Digital interface activation */
    };

    /* External Interupt Setting */
    irq_ext_enable(){
    IRQ_setVecs(vectors); /* point to the IRQ vector table */
    IRQ_globalEnable(); /* Globally enable interrupts */
    IRQ_nmiEnable(); /* Enable NMI interrupt */
    IRQ_map(IRQ_EVT_EXTINT4,4); /* Map TIMER events to physical interrupt number */
    IRQ_reset(IRQ_EVT_EXTINT4);
    IRQ_enable(IRQ_EVT_EXTINT4);
    }

    void main(){

    DSK6713_init();
    DSK6713_LED_init();

    gpio_handle = GPIO_open(GPIO_DEV0, GPIO_OPEN_RESET);
    GPIO_config(gpio_handle,&gpio_config);

    GPIO_pinEnable(gpio_handle,GPIO_PIN10);
    GPIO_pinEnable(gpio_handle,GPIO_PIN14);

    GPIO_pinDirection(gpio_handle,GPIO_PIN10,GPIO_INPUT);
    GPIO_pinDirection(gpio_handle,GPIO_PIN4,GPIO_INPUT);

    irq_ext_enable();

    DSK6713_LED_on(0);

    while(1){
    DSK6713_LED_on(1);
    OUT_R = IN;
    OUT_L = IN;
    while (!DSK6713_AIC23_write(hCodec, OUT_L));
    while (!DSK6713_AIC23_write(hCodec, OUT_R));
    if(DSK6713_DIP_get(1)==0)
    break;
    }

    DSK6713_AIC23_closeCodec(hCodec);
    DSK6713_LED_off(0);
    DSK6713_LED_off(1);
    DSK6713_LED_off(2);
    DSK6713_LED_off(3);
    }

    /* Interrupt Service Routine */
    interrupt void c_int04(){
    DSK6713_LED_on(2);
    receive();
    }

    void receive(){

    int i;
    for(i=0;i<32;i++){
    bit[i]=GPIO_pinRead(gpio_handle,GPIO_PIN10);
    DSK6713_waitusec(0x01);
    }
    IN=0;
    for(i=0;i<32;i++)
    IN=IN+bit[i]*pow(2,31-i);
    }

    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<C CODE ENDS>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<ASM FILE>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    * Copyright (C) 2003 Texas Instruments Incorporated
    * All Rights Reserved
    *
    *
    *---------vecs_timer1.asm---------
    *
    * Assembly file to set up interrupt service table (IST)
    *

    *------------------------------------------------------------------------------
    * Global symbols defined here and exported out of this file
    *------------------------------------------------------------------------------
    .global _vectors
    .global _c_int00
    .global _vector1
    .global _vector2
    .global _vector3
    .global _c_int04
    .global _vector5
    .global _vector6
    .global _vector7
    .global _vector8
    .global _vector9
    .global _vector10
    .global _vector11
    .global _vector12
    .global _vector13
    .global _vector14
    .global _vector15

    *------------------------------------------------------------------------------
    * Global symbols referenced in this file but defined somewhere else.
    * Remember that your interrupt service routines need to be referenced here.
    *------------------------------------------------------------------------------
    .ref _c_int00

    *------------------------------------------------------------------------------
    * This is a macro that instantiates one entry in the interrupt service table.
    *------------------------------------------------------------------------------
    VEC_ENTRY .macro addr
    STW B0,*--B15
    MVKL addr,B0
    MVKH addr,B0
    B B0
    LDW *B15++,B0
    NOP 2
    NOP
    NOP
    .endm


    *------------------------------------------------------------------------------
    * This is a dummy interrupt service routine used to initialize the IST.
    *------------------------------------------------------------------------------
    _vec_dummy:
    B B3
    NOP 5

    *------------------------------------------------------------------------------
    * This is the actual interrupt service table (IST). It is properly aligned and
    * is located in the subsection .text:vecs. This means if you don't explicitly
    * specify this section in your linker command file, it will default and link
    * into the .text section. Remember to set the ISTP register to point to this
    * table.
    *------------------------------------------------------------------------------
    .sect ".text:vecs"
    .align 1024

    _vectors:
    _vector0: VEC_ENTRY _c_int00 ;RESET
    _vector1: VEC_ENTRY _vec_dummy ;NMI
    _vector2: VEC_ENTRY _vec_dummy ;RSVD
    _vector3: VEC_ENTRY _vec_dummy
    _vector4: VEC_ENTRY _c_int04
    _vector5: VEC_ENTRY _vec_dummy
    _vector6: VEC_ENTRY _vec_dummy
    _vector7: VEC_ENTRY _vec_dummy
    _vector8: VEC_ENTRY _vec_dummy
    _vector9: VEC_ENTRY _vec_dummy
    _vector10: VEC_ENTRY _vec_dummy
    _vector11: VEC_ENTRY _vec_dummy
    _vector12: VEC_ENTRY _vec_dummy
    _vector13: VEC_ENTRY _vec_dummy
    _vector14: VEC_ENTRY _vec_dummy; 
    _vector15: VEC_ENTRY _vec_dummy

    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<FILE ENDS>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

  • Would anyone please help me in this regard how can I connect two DSP kits? I had shared my logic with codes above but it didn't work. Is any problem in hardware configuration on in C Code? Or is there anyother out to connect two DSP kis?

    I'm using DSK6713 kits...

    Regards,

    Mukhtar

  • Mukhtar,

    Why do you want to connect two DSK6713 boards? Can you accomplish all of your audio processing on one board?

    How much data do you want to transfer between the two boards, both in data size and data rate?

    What other peripherals are available on the expansion connector where you also find the GPIO pins?

    It will help you to go to the Wiki and search for "c6713 training" (no quotes) to find the C6x1x workshop that has been archived there. You can go through the student guide and lab exercises to help you learn about the methods of using the DSK6713. It will also help you understand real-time programming issues.

    Be sure the two DSKs have a common ground voltage level.

    From where did you get your vectors.asm code? This propagates a long-standing code error for the reset vector, although it would not be causing your current problems. Please see the E2E post here.

    With your answers to my questions above, we can continue this discussion.

    Regards,
    RandyP

  • Randy P,

    RandyP said:

    Why do you want to connect two DSK6713 boards? 

    We are working on OFDM as our BS(Telecom Engineering) project. We want to make transmitter and receiver using two DSP kits.

    RandyP said:

    Can you accomplish all of your audio processing on one board?

    Yeah we had done all audio processing on one board and it work. But we had to make transmitter and receiver.

    RandyP said:

    What other peripherals are available on the expansion connector where you also find the GPIO pins?

    I can't get what you want to ask? Please clarify.

    RandyP said:

    How much data do you want to transfer between the two boards, both in data size and data rate?

    Data Rate is 1Mbps.

    RandyP said:

    From where did you get your vectors.asm code? 

    This code come with an example of CCS v3.1.

    How can I set both DSKs on same ground level? Ok I'll go through student guide and C6713 taining.

    Regards,

    Mukhtar

  • Mukhtar,

    You may not get as many answers as you would like here on the forum, but your improving skill at explaining your questions or situations or goals will help this process and will help your final results.

    It is not clear what data you want to move between the two board, RF or baseband OFDM (whatever that would mean) or raw audio. It probably does not matter, but addressing your questions blindly (without knowing the reason or logic behind them) is not as likely to lead to positive results.

    RandyP said:

    What other peripherals are available on the expansion connector where you also find the GPIO pins?

    Mukhtar Hussain said:

    I can't get what you want to ask? Please clarify.

    You are using GPIO pins. Where did you find information about these pins and what are you connecting to on the board. Does the board have other peripherals, like SRIO or UART or EMIF or serial ports (McBSP) or more GPIOs or DAC/ADC? Where would you look to find information on these things and what is made available to your as a board user? Is there a reference guide of some type that applies to the technical aspect of the board, such as listing the features and placement? How can you know which pin on a connector has GPIO4, for example? Look to that documentation, and make a list of all the peripherals that are available to you on connectors and tell me which might be suitable for your use, please.

    Mukhtar Hussain said:

    This code come with an example of CCS v3.1.

    As I explained in my previous post, this is continuing an error that has been discussed on the thread to which I included a link. If I can help to control that spread of this error, I will, but "an example of CCS v3.1" does not give me any hints, other than the fact that you are using a very old version of CCS for your project. It is probably not within your scope to move to a newer version of CCS, but I hope you can offer more information that "an example".

    Mukhtar Hussain said:

    How can I set both DSKs on same ground level?

    In my waveguides lab my Junior year, I was unable to control the ground current and lost points on my lab. You do not want my advice on this, but should be able to mention it around you and get some positive advice. I would say that it is basic electrical engineering, but I did not grasp it well and lost points, so I am not one to talk on this.

    Regards,
    RandyP

  • hi,

    about connecting the ground level, the board vendor must have provided the schematics showing the interconnections between the processor and other devices on board, so go and check on them.

    RandyP said:

     I would say that it is basic electrical engineering

    Mr. RandyP asked a very good question:  ,

    RandyP said:

    What other peripherals are available on the expansion connector where you also find the GPIO pins?

  • RandyP,

    I had come across a forum while searching about the problem we are facing i.e.

    http://e2e.ti.com/support/dsp/tms320c6000_high_performance_dsps/f/115/p/12568/49258.aspx

  • Mukhtar,

    If the other post solves your problem, please click Verify Answer on your post above so we will know you have your answer.

    Regards,
    RandyP

  • RandyP,

    We had come across a forum while searching about the problem we are facing i.e.

    DSK6713 Interrupt configuration questions

    also we studied

    TMS320C6713 DSK Technical Reference

    TMS320C6000 DSP General-Purpose Input/Output (GPIO) Reference Guide

    from there we come to know about the GPIO pins available on J1 HPI expension connector and J3 External Peripheral Connector.

    So far by correcting the vectors.asm file from the link you had share we had varified the external interrupt on EXT_INT4/GPO[4] on External Peripheral Connector.

    We had generated the interrupt signal transition low to high from GPIO Pin#10 and it work.

    Now when we connect two kits using GPIO port it get disconnected as mentioned by David VP in his post "DSK6713 Interrupt configuration questions". But he didnot replied after that how they had solved this problem.

    Regards,

    Mukhtar

  • Alzain,

    I had seen the board schematic given in 

    TMS320C6713 DSK
    Technical Reference
    SPECTRUM DIGITAL,

    But I didn't find it out. Would you please refer me that schematic? The simple method that come to my mind was to short the ground pins of both DSK6713 but it doesnot work.

  • RandyP,

    RandyP said:

    If the other post solves your problem, please click Verify Answer on your post above so we will know you have your answer.

    It didn't solve the problem.

    Regards,
    Mukhtar

  • Mukhtar,

    This is much too confusing for me. I apologize that my questions have not been well received, but I cannot help you without your responses and your insights that those responses will bring to me. I only see what is written in this thread and not the much greater amount of experience your are building around this project.

    1. It is difficult for me to say without more knowledge about your system, but, in general, the use of a GPIO to asynchronously send and receive data is a poor solution for a data rate as high as 1Mbps.

    2. You did well to find the GPIOs in the documents you mentioned. Please continue that good work and address the other questions about peripherals.

    3. How can shorting the ground pins of the boards not work? What does not work? Are the ground levels still different or noisy relative to each other, or does your board still not transfer data correctly?

    4. It does not seem profitable to study someone else's problem (the other forum post) in order to offer you a solution. Your description of your own problem will be more interesting. If some of his words are useful to your description, perhaps they will help describe your situation being written into this thread.

    Regards,
    RandyP