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.

Interfacing the TMS320C6713DSK and the ADS8364EVM Converter Daughter Card

Other Parts Discussed in Thread: ADS8364, SN74HC125, 5-6KINTERFACE

Hello,

 

I am very new to DSP hardware. I am trying to sample an analogue signal and store it on a computer. I am using the ADS8364EVM to do Analog-2-Digital conversion and the C6713DSK to process the signal and store it on the PC.

I have been reading on the two boards and trying to get a hang of how the the EVM can be controlled in software but it gives me a headache. Does anyone have a piece of code which controlls the ADC. I mean just setting the McBSP, configuring the ADC, sending conversion commands, and reading the results off the ADC.

  • Bendous,

    You might want to download the Data Converter Support Tool from http://www.ti.com/dcplug-in and generate the interface code with that. As an alternative, you could use the attached file, which is an example project for the C6713 DSK and the ADS8364 using CCS 3.1. If you are using a different version of CCS, you might need to migrate that project (see the help file in CCS for that).

    Regards,

    Richard

    ADS8364-DSK6713-CCS3v1.zip
  • Richard,

    Thanks for the help. However, the example you gave me is for the ADS8364/65 EVM which seems to have one input channel only.

    The ADS8364EVM has 6 channels. The configuration register seems to be different from the one I am using.

    Kind regards.

  • Bendous,

    The software supports all six channels on the EVM. How many channels you get depends on how many you trigger using the HOLDx signals.

    Here is a more elaborate explanation:

    Each HOLDx negative edge triggers a conversion and, thus, causes an EOC# pulse. If more than one HOLDx is triggered at the same time, the same amount of EOC# pulses are generated.

    Since the FIFO register is read only in this software the samples appear on the parallel bus as the HOLDx pins were triggered (if they were triggered simultaneously the sequence is A, B, C). The software uses the timer to trigger those pins and which pins are used is decided by the jumpers on the EVM.

    The software assumes that you know the sequence the HOLDx pins are driven. In your case, as you want to read 6 channels, you would connect the timer to all three HOLD pins and all are sampled at the same time.

    Doing so makes the software very flexible since every combination is covered. If you don't want to rely on the samples you can read additional information by asserting the ADD pin.

    Example:

    • You trigger alternating HOLDA and HOLDB (starting with HOLDA).
    • If you issue a readblock() with 1024 samples and w/o ADD pin you will get the following data:
    • (Please note that you get only half of the samples if you use the ADD pin...)
    • CH A0
    • CH A1
    • CH B0
    • CH B1
    • CH A0
    • CH A1
    • CH B0
    • CH B1
    • ....

    Its you responsibility to sort the data later on - if required. However, since you know the sequence you can let the EDMA sort the data by hardware. This is beyond the scope of the provided software.

    Regards,

    Richard

  • Thanks for the help. This is great.

     

    One more question: I generated all the driver files using the plug-in and wrote a simple main program to test it. I source stepped into the program and found out that there is a problem opening the timer0 because according to the cdb file, it is already being used by the clock! when the TIMER_open function returns an invalid pointer, the status is set to TIDC_ERR_NOCHIPRES (-4) leading to the ADC being closed.

    I was not really sure how to solve this. I used timer1 instead of timer0, which allowed the program to configure the ADC. However, the buffer remains all zeros which means it is not reading. After debugging I found that whenever the program tries to read a block it finds the ADC busy, so it returns with a status of TIDC_ERR_XFERPROG.

    I don't know what to do next...

    Code:

     

    #include "t8364_fn.h"

    #include "tidc_api.h"

     

    #include <csl.h>

    #include <csl_irq.h>

     

    #define BUFF_SZ (2048)

     

    unsigned short Buffer[BUFF_SZ];

    TTIDCSTATUS stat;

     

    void main()

    {

    // Configure DSP resources and ADS8364:

    //stat = dc_configure(&Ads8364_1);

     

    /* connect McBSP1 to daughter board connector                */

        *(unsigned char*)0x90080006 |= 0x02;

     

    /* this line sets CECTL0 to default (turns off SDRAM)        */

    /* see notes in the interface software for more about this   */

        *(unsigned int*)0x01800008 = 0xFFFF3F23;

     

    /* clear data buffers                                        */

    memset(Buffer, 0, sizeof(Buffer));

     

    /* open the driver                                           */

    stat = dc_configure(&Ads8364_1);

    if (stat != TIDC_NO_ERR)

    abort();

     

    // Enable interrupts:

    IRQ_globalEnable();

     

    // Issue a new block transfer:

    dc_readblock(&Ads8364_1, Buffer, BUFF_SZ, 0);

    asm(" nop");

     

    // Read data repeatedly forever:

    while(1)

    {

    dc_readblock(&Ads8364_1, Buffer, BUFF_SZ, 0);

    asm(" nop");

    }

    }

     

  • Well, as the transfers are not blocking, you have to wait for the previous transfer to be completed before submitting a new one. This can be accomplished by inserting a while loop before the dc_readblock() statement:

    #define ADS8364_STAT_NOTINIT (-1)
    #define ADS8364_STAT_READY   ( 0)
    #define ADS8364_STAT_RUN     ( 1)
    #define ADS8364_STAT_BUSY    ( 2)

    while(1)
    {
         while (Ads8364_1.iDriverStatus != ADS8364_STAT_READY);
         dc_readblock(&Ads8364_1, Buffer, BUFF_SZ, 0);
         asm(" nop");
    }

    This waits until there is no transfer ongoing. The interface software also allows to chain two transfers (so that you can acquire contiguous blocks of data). In this case you would check for the iDriverStatus variable to contain ADS8364_STAT_RUN or ADS8364_STAT_READY.

    Regards,

    Richard

  • Thanks Richard. This makes a lot of sense.

     

    Another question: Do I have to use an external clock? because according to some document I read, pin 45 on the peripheral connector is supposed to supply a clock generated using Timer0 in the C6713. However, when I choose timer0 as the source of my clock, the Timer_INIT function returns an INV (invalid) pointer because for some reason Timer0 is already in use!!!!

     

    Regards,

    Samir.

  • Hi Samir,

    By the sound of it, you are using the original ADS8364EVM with the 80-pin daughtercard interface connectors on it.  The ADS8364 definately needs an external conversion clock.  Your options are to use the timer function or to use an external signal generator.  Since your Timer0 is tied up, you can simply apply a conversion clock on J9 (the BNC connector on the right hand side of the board) and ensure the shunt jumper on W15 is to the right, covering pins 2-3.

    Regards,

    Tom

  • Ok, thanks for the help.

     

    Any ideas on why timer0 is tied up in the C6713 DSK?

  • The timer0 is used by DSP/BIOS as the time base for the RTOS, but this can be changed:

    In the project tree, there should be a *.cdb file under DSP/BIOS configuration. Open that and select the CLK - Clock Manager under Scheduling. Right-click on it and select Properties. This opens a new window, where you can select Timer 1 from the drop down list. This will advice DSP/BIOS to use timer 1 instead of timer 0. Save the file and re-compile. Timer 0 is now available for the application.

     

     

    Hope this helps!

    Richard

  • Ok, very good. Done that and now the Timer_INIT works fins. However, when I probe the CLOCK on the EVM I get a signal that is always high (no edges) !!!

     

    I tried reading the timer 0 registers, and they seem fine to me except that the count register is always zero!:

    Timer0_Control_Reg = *(unsigned int*)0x01940000;

    Timer0_Period_Reg = *(unsigned int*)0x01940004;

    Timer0_Count_Reg = *(unsigned int*)0x01940008;

     

    The output is:

     

    Any ideas?

  • You will only see pulses on the timer 0 while a data acquisition is ongoing. The timer is suspended while no readblock() is submitted and will be activated by the dc_readblock() function. As Tom pointed out, you will have ti use an external clock for the converter. The timer is only used for the HOLDx pins.

    Best regards,

    Richard

  • I wrote the following code after initialising the ADC:

     

    // See Timer 0 characteristics:

    *(unsigned int*) Timer0_CTL_Address = 0x03D3;

    *(unsigned int*) Timer0_PRD_Address = 0x0007;

    // Read PCR register and update its value:

    Temp = *(unsigned char*) McBSP1_PCR_Address;

    Temp = Temp | PCR_MASK;

    *(unsigned char*) McBSP1_PCR_Address = Temp;

     

    This allowed me to use TOUT0 from Timer 0 as the ADC clock with jumper W15 at pins 1 and 2.

    The resulting clock has a frequency of 4Mhz.

    I checked the rest of the ADC pins. The WR signal goes active simultaneously with the CS whenever a command is written. RESET remains inactive. The HOLDx hardware pins are all set to 0 (active), when they should be high, but this should not be a problem since they are logic ANDed with their software couterparts.

    I connected A0+ and A0_GND to the positive and negative outputs of a hand held sine generator. When I scoped the input, The sine wave ranges from -1.3V to 2V.

    The EOC output line of the ADC never goes active, which means the conversion is never carried out!!!

    Am I doing anything wrong?

  • Could you let me know the settings for the address pins A[2:0]? I assume that you are going to use the "cycle mode" (software control). pls also note that in this mode, the HOLDx pins need to be high all the time (not low).

    If you are not using the software control mode, you will have to toggle the HOLDx pins address the channel to be read with the address lines.

    Regards,

    Richard

  • Bellow is all my code. This is what I am getting now:

    Output:


    Channel 1: WR signal.

    Channel 2: EOC signal.

  • OK, I am finally able to read from the ADC. However, for a sinusoid in the input this is what I m getting.

    The red and black outputs of my oscillator are connected to the positive (B0+) and negative (B0-) inputs of channel B0, respectively. This is what a get when I probe the CHB0+ input to the ADC (with the ground clipper connected to input (CHB0-):

    The RefIN pin of the ADC sits at 2.6V, which means that the input is well within range.

    WHAT is wrong with the output???

  • Hello,

    I had downloaded the source code as you mention. I had also having document for this program for ADS8364. I had all the necessary thing required at see the output. 

    But i had one problem instead of giving external Clock on J9 connector(BNC connector on the right handside of the board), I am using the internal clock (Tout) by shorting W8's 2-3 pin. Still i am not getting the output in Graph window of CCS.

    Kindly let me know the how to proceed 

    Below is the procedure to run the sample code 

    Guidelines for the ADS8364 Example Project for

    the TMS320C6000 DSP family

    Table of Contents

    1. Legal Notes

    2. Hardware Settings

    3. Software

    3.1 Development Environment

    3.2 Project Directory

    3.3 DCP Settings

    3.4 Application Settings

    3.5 Code Composer Studio Settings

    3.6 Exposed Functions

    3.7 Additional Notes

    1. Legal Notes

    By using this program you agree to the terms of the Legal notes

    2. Hardware Settings

    Converter Board

    General Information

    Jumper Settings

    Name : ADS8364/65M Evaluation Module

    Partnumber : ADS8364M-EVM

    Revision : A

    Literature Number : SLAU198

    Vendor : Texas Instruments

    Designator Position

    W3 2-3

    W5 2-3

    W6 closed

    W7 closed

    Guidelines for the Example Project Page 1 of 7

    External Signal Connections

    This section shows all external signals mandatory to successfully run the example project.

    Apply a Analog Signal with the following parameters:

    Apply a Clock Signal with the following parameters:

    Other Board Modifications

    This section shows special hardware modification.

    Shifting Single-Ended Input to Common Mode Voltage

    This example uses a single-ended Signal as analog input signal. To feed the signal with the

    parameter given above do the following hardware changes: --- 1.) Wire W3.2 to J3.12 (shift

    ground of signal C0 to Vref (2.5V)) --- 2.) Wire W3.2 to J3.16 (shift ground of signal C1 to

    Vref (2.5V)) --- 3.) Wire J3.10 to J3.14 (connect C0 to C1)

    Hardware Fix

    W8 1-2

    W10A Channel A Used: 1-2 (Timer is trigger); Unused: 2-3

    W10B Channel B Used: 1-2 (Timer is trigger); Unused: 2-3

    W10C Channel C Used: 1-2 (Timer is trigger); Unused: 2-3

    Other don't care

    - type : Sine

    - frequency : 1kHz

    - voff : 0V

    - vpp : 4.9V

    - connector : Signal:J3.14(C1+); GND:J3.16(C1-)

    - r : HI-Z

    - type : Square

    - frequency : 5MHz

    - voff : 1.65V

    - vpp : 4.4V

    - connector : J7

    - r : 50 Ohm

    Guidelines for the Example Project Page 2 of 7

    With the original ADS8364/65 EVM the CS line of the ADS8364/65 stays low always. This

    leads to problems if other devices are connected to the EMIF. Fix: Solder an 1kOhm pulldown

    resistor to pin 8 of U7 (Output 3Y of SN74HC125).

    Interface Board

    General Information

    Jumper Settings

    Power Connections

    This section shows all external power connection needed to run the example project.

    Apply a voltage for the Analog Section with the following parameters:

    Name : 5-6K Interface EVM

    Partnumber : 5-6KINTERFACE

    Revision : B

    Literature Number : SLAU104B

    Vendor : Texas Instruments

    Designator Position

    W1 open

    W2 2-3

    W3 2-3

    W4 2-3

    W5 2-3

    W6 1-2

    W7 1-2

    J13 1-2 (b)

    J14 1-2 (TOUTa)

    Other don't care

    - voltage : +5V

    - signal : +5VA

    - connector : J2

    Guidelines for the Example Project Page 3 of 7

    Apply a voltage for the Analog Section with the following parameters:

    DSP Board

    General Information

    Switch Settings

    Power Connections

    This section shows all external power connection needed to run the example project.

    Apply a voltage for the DSP Section with the following parameters:

    Additional Hardware Notes

    None.

    3. Software

    - voltage : -/+12V

    - signal : -/+VA

    - connector : J1

    Name : TMS320C6713 DSK

    Partnumber : N/A

    Revision : A

    Literature Number : N/A

    Vendor : Spectrum Digital

    Designator Position

    SW3.1 off

    SW3.2 off

    SW3.3 off

    SW3.4 off

    - voltage : +5V

    - signal : +5V

    - connector : J5

    Guidelines for the Example Project Page 4 of 7

    file://H:\Important\DSP6713\6713 Interfacing WB eg\ADS8364-DSK6713-CCS3v1\AD... 07/08/2009

    3.1 Development Environment

    3.2 Project Directory

    Project Directory Name: ADS8364-DSK6713-CCS3v1

    3.3 DCP Settings

    This section describes the graphical user interface configuration of both the DSP and the ADS8364

    tabulator in the Data Converter Support Tool.

    The interface software for this example project was generated using these settings.

    DSP Tab Settings

    Converter Tab Settings

    Code Composer Studio version : 3.10

    Project Name : ADS8364-DSK6713-CCS3v1

    - [Debug]

    - ADS8364-DSK6713-

    CCS3v1.map

    - ADS8364-DSK6713-

    CCS3v1.out

    - [Release]

    - ADS8364-DSK6713-

    CCS3v1.map

    - ADS8364-DSK6713-

    CCS3v1.out

    - dc_conf.h

    - Link.cmd

    - main.c

    - t8364_fn.h

    - t8364_ob.c

    - ADS8364.cdb

    - ADS8364cfg.cmd

    - ADS8364cfg.h

    - ADS8364cfg.h62

    - ADS8364cfg.s62

    - ADS8364cfg_c.c

    - ADS8364-DSK6713-

    CCS3v1.pjt

    - tidc_api.c

    - tidc_api.h

    Map file of the .out file (debug version)

    Downloadable .out file (debug version)

    Map file of the .out file (release version)

    Downloadable .out file (release version)

    Header file including defines for the converter and

    DSP based on GUI settings

    Custom linker command file to be able to specify a

    memory section

    Application layer file of the project

    Header file of the generated interface software

    Source file of the generated interface software

    Configuration database (CDB) file of the project

    Linker command file generated from the CDB

    Header file generated from the CDB (you may include

    this in you source code)

    Internal header file generated from the CDB

    Internal source file generated from the CDB

    Source file for initializing resources

    Project file

    Source file of translation layer for the DCP

    interface software

    Header file of translation layer for the DCP

    interface software

    - DSP Type : TMS320C6713

    - DSP Clock : 225

    - Dispatcher in DSP/BIOS Used : unchecked

    Guidelines for the Example Project Page 5 of 7

    3.4 Application Settings

    Sample Buffer

    The Sample Buffer is a data field within the C source code where the samples read from the converter

    are stored in.

    This data field is declared in the application file (main.c).

    In this example project the Sample Buffer has/have the following parameter:

    3.5 Code Composer Studio Settings

    How To Display Data Samples

    This section describes how to graphically watch samples collected from the data converter and, thus,

    verify the proper work of the converter.

    Parameter for the Graph Window(s):

    Graph Window 1:

    - ADS8364/65M EVM in use : checked

    - ADC Base Address (hex) [gray] : 0xA003C000

    - DSP Interrupt [gray] : Ext Int 5

    - Timer (for Sampling) : Timer 0

    - Timer Frequency (kHz) : 248.894

    - Minimum System Clock (kHz) [gray] : 4977.88

    - Optimize EMIF Access : checked

    - Additional Channel Info Enabled (ADD) : unchecked

    - Name : Buffer1

    - Size : 2048

    - DataType : ADS8364_DATATYPE

    - Name : Buffer2

    - Size : 2048

    - DataType : ADS8364_DATATYPE

    1. Start Code Composer Studio

    2. Open the Project

    3. Download the $PrjDir\Debug\ADS8364-DSK6713-CCS3v1.out file to the DSP (DO NOT

    recompile)

    4. Open two Graph Window (parameters are listed below)

    5. Set a probepoint at a 'asm( "nop");' line in main.c

    6. Run the Program

    7. You should see the collected data samples in the graph window.

    - Buffer Name : Buffer1

    Guidelines for the Example Project Page 6 of 7

    Graph Window 2:

    Since no compiling took place by now (software is binary the same as during the creation of this

    example project) the user can check the hardware.

    In case the system does not work as expected the problem lies most probably in the hardware.

    3.6 Exposed Functions

    ADS8364_getFinishedBufferParams()

    Description:

    - Returns the base address and number of elements of the last finished buffer.

    Return Value:

    - TTIDCSTATUS: Status of function. Can be TIDC_ERR_NOXFER or TIDC_NO_ERR

    Parameter:

    3.7 Additional Notes

    For additional information...

    ... see comments in t8364_ob.c

    --- END OF FILE ---

    - Acquisition Buffer Size : 2048

    - Display Data Size : 2048

    - DSP Data Type : 16-bit signed integer

    - Buffer Name : Buffer2

    - Acquisition Buffer Size : 2048

    - Display Data Size : 2048

    - DSP Data Type : 16-bit signed integer

    - void *pDC : Data converter object pointer

    -

    ADS8364_DATATYPE

    **pBufAddr

    : Base address of data buffer (pass by

    reference)

    - unsigned int *pBufLen

    : Data samples in data buffer (pass by

    reference)

    Guidelines for the Example Project Page 7 of 7