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.

CCS/TMS320F28035: Trying to read GPIOs that board offers but don't know how to activate them

Part Number: TMS320F28035
Other Parts Discussed in Thread: TDC1000, , C2000WARE, TMDSDOCK28035, TDC1000-C2000EVM

Tool/software: Code Composer Studio

I have a transducer hooked up to the TDC1000 in the TX1 pins. I start the graph on the (TDC1000_C2000_EVM) software to read the TOF (time of flight) which is the time it takes for the signal to be sent and received back to the transducer. I would like to be able to read this value somewhere else outside of the software if possible. There is also a TMS320 microcontroller on the board that has 7 possible GPIOs to hook up to (GPIO0, GPIO1, GPIO3, GPIO7, GPIO30, GPIO31, GPIO32, GPIO33). These include PWM, ADC converter and CAN bus communication. I was wondering if i could get help on how to activate these GPIOs in order to read or print the values of the transducer measurement somewhere else.

 

I figure out that I needed Since the XDS110 JTAG Debug Probe to try debug the TMS320F28035 microcontroller and flip the necessary GPIOs to outputs so I can output the value of the transducers to somewhere else other than tdc1000_c2000 software. I have code composer studio installed onto my laptop but am very unfamiliar with how to use it.

 

I was wondering if I could get pointed in the right direction on code composer to change the necessary GPIO bits for I do not know where to begin. There are so many documents to read with hundreds of pages to look at and can be a little overwhelming.

  • Colin,

    you're going to have to write code. Its going to take a significant amount of learning by you to get this to work. Go through the workshop, it will introduce you to the C2000 device and has labs to show you how to use code composer studio. It was written for an older version, but it is very similar.

    Code composer studio and C2000 getting started:

    CCS getting started video: https://www.youtube.com/watch?v=11lsNYW7zkw 

    F2803x workshop: https://training.ti.com/c2000-f2803x-microcontroller-workshop?context=1137791-1137784

    F2803x examples are in C2000Ware: C2000ware

    The GPIO examples should help show you what you need. They can be found here: C:\ti\c2000\C2000Ware_3_02_00_00\device_support\f2802x\examples\structs

    Best of luck,
    Cody 

  • Cody, 

    I have been going through the workshop a little bit and some youtube videos to get started on the code for what I am trying to do. I also looked at the example code of the GPIOs. I haven't tested it yet but would like your opinion if I'm heading in the right direction. I'm trying to activate all the GPIOs that I can connect to. The pins that I can hook up to are GPIO0, GPIO1, GPIO3, GPIO7, GPIO30, GPIO31, GPIO32, GPIO33. They all have different forms of communications and was wondering what you think would be the best to read out to somewhere else to something like an arduino. 

    GPIO0 - ePWM1 output A output

    GPIO1 - ePWM1 output B output

    GPIO3 - ePWM2 output B output

    GPIO7 - ePWM4 output B output

    GPIO30 - no output available 

    GPIO31 - CANTXA - eCAN-A transmit output

    GPIO32 - CANTXA - ADC start-of-conversion B output

    GPIO33 - CANTXA - ADC start-of-conversion B output

    some of these can be set to different outputs and can be found here: https://www.ti.com/lit/ug/sprui10/sprui10.pdf

    Here is an snippet of the code that I have written so far. 

    Is it possible to read them as outputs all at once or do i need to test them all individually?

  • Colin,

    if I'm being perfectly honest I have no idea what you mean by the following statement.

    Colin Murphy1 said:
    The pins that I can hook up to are GPIO0, GPIO1, GPIO3, GPIO7, GPIO30, GPIO31, GPIO32, GPIO33. They all have different forms of communications and was wondering what you think would be the best to read out to somewhere else to something like an arduino. 

    Being that you've asked about a F28035 device I assume you are using a TMDSDOCK28035 controlCARD to prototype with. This has access to significantly more pins than what you have called out.

    Please note that our GPIOs have 3 major modes of function.

      1. input: take generic information into the device
      2. output: send generic information out of the device.
      3. Peripheral function: Take or send information in or out of the device from a peripheral(PWM, CAP,CAN, etc.) 

    As for your "something like Arduino" comment: Arduino is, at its core, a limited functionality cheap microcontroller. C2000 is a more powerful version of that. The difference is that Arduino has abstracted away all of the technical aspects of operating a microcontroller.

    Please reference the datasheet not the TRM for peripheral functions(signal descriptions section): https://www.ti.com/lit/gpn/tms320f28035

    Your code snippet is missing.

    Colin Murphy1 said:
    Is it possible to read them as outputs all at once or do i need to test them all individually?

    I am a little confused by this statement you typically "read inputs" and "write outputs". Outputs can be written in groups, groups of outputs are clustered in 'registers' . Look at GPxDAT where x represents one of many letters a,b,c...

    If you truly want to read your outputs, as in what you are currently outputting, that is possible by reading the same registers.

    Regards,
    Cody

  • Cody, 

    I have attached a PDF that describes a little better of what I am working on. It has some pictures that will help since last time my picture did not upload. 

    Appreciate the help

    - Colin

    TMS320 Forum.pdf

  • Colin,

    Ah, you're using the TDC1000-C2000EVM! This was designed for level sensing of fluids in mind.

    Reading your attached PDF:

    1. It looks like you have correctly configured some outputs.
    2. The XDS110 will work fine for programming this kit.
    3. I don't know why you want to communicate to an Arduino when you have a fully capable F28035 available to do whatever it is you need.
    4. I think its been nearly a decade since I've looked at Auduino code, but the "uS" value that your talking about, I think, is the way they measure a pulse duration.
    1. There are a million ways to communicate data from one device to the next, if you want to encode that data into a fixed frequency variable pulse width signal that seems pretty reasonable. I would recommend you look in to using a PWM to do this.
    2. If you setup a GPIO all you can do is set the GPIO high and set the GPIO low. You cannot give it a command to say "stay high for 10uS". Now that being said you can certainly set the pin high , wait 10 uS and then set the pin low. Fundamentally this is actually what the Arduino is doing its taking your simple high-level code and breaking it down into something that manipulates the hardware to do what you want it to do.

    Also I want to remind you that as part of our disclaimer all of our EVMs are not intended for use in any final end application. These are designed to enable prototyping, and could be discontinued at any point, so designing a system around it might not be the best idea.

    Regards,
    Cody

  • Cody, 

    Is there a device with similar applications to the  TDC1000-C2000EVM that isn't an EVM and can be used for final end applications?

    We used this board to detect the build up of sand in water at a certain level through metal. 

  • Colin,

    the design files are provided, you can use this as a starting point for your own custom design. And in that design you could tweak or bring out any extra pins that you wish.

    At the end of the day TI is a component manufacture, we do not provide end applications kits, only evaluation modules to enable the prototyping of our components. We expect customers to design systems using our components, not using our EVMs.

    While I don't think this EVM is going EOL anytime soon, we reserve the right to EOL our EVMs whenever we see fit. Our components on the other hand we take very seriously and ensure that all customers have ample notice on any EOL decisions we make.

    Regards,
    Cody

  • Cody, 

    I built my code and reading values on my arduino like I wanted to. I am not sure what these values mean yet. I am also messing around with the different forms of communication, mainly the PWM. When i have it plugged in, I read a very high value. When I disconnect it, I read a 0. This is good as it means I am reading some sort of value. The only thing is when I disconnect the leads for the ultrasonic transducer, the values don't change. 

    This leads me to question what is the difference between channel A and channel b? 

    For example:

    GPIO32 an be set to CANTXA - ADC Start of conversion output A with pioCtrlRegs.GPBDIR.bit.GPIO32 = 11; and

    GPIO32 an be set to CANTXA - ADC Start of conversion output B with pioCtrlRegs.GPBDIR.bit.GPIO33 = 11;

    My assumption was that A corresponded to TX1 and RX1 values and B corresponded to TX2 and RX2 values. These TX and RX values are directly wired to the ultrasonic transducers that make the measurements of the fluid. But I have a feeling my assumption is way off 

    Thanks,

    Colin

  • Colin,

    Colin Murphy1 said:
    This leads me to question what is the difference between channel A and channel b? 

    Are you talking about the PWM's A and B channel? The function of the "A" and "B" channels of the PWM are nearly identical. It is worth noting that they can be configured to respond differently to compare events or to other stimulus. This means that you have to configure each channel individually, and that configuring PWM1A does not mean that PWM1B is configured. 

    Colin Murphy1 said:

    For example:

    GPIO32 an be set to CANTXA - ADC Start of conversion output A with pioCtrlRegs.GPBDIR.bit.GPIO32 = 11; and

    GPIO32 an be set to CANTXA - ADC Start of conversion output B with pioCtrlRegs.GPBDIR.bit.GPIO33 = 11;

    You had a few typos in there, but I believe I understood you. 

    1. What do you want this pin to be doing?
      1. GPIOs 32 and 33 cannot be set to CAN TXA.
      2. ADCSOCAO and ADCSOCBO can be configured
    2. writing GpioCtrlRegs.GPBDIR.bit.GPIOxx =11;
      1. Writing this value = b11; does not make any sense, this is a single bit field writing anything more than a single bit will be ignored.
      2. GpioCtrlRegs.GPBDIR does not configure the peripheral function it only takes effect when the GPIO is configured as a 'GPIO' 
        1. Are you meaning to write GPxMUX?
    3. Why are you trying to output CAN or the ADC SOC signal on these GPIOs?

    Colin Murphy1 said:
    My assumption was that A corresponded to TX1 and RX1 values and B corresponded to TX2 and RX2 values. These TX and RX values are directly wired to the ultrasonic transducers that make the measurements of the fluid. But I have a feeling my assumption is way off 

    Colin, Honestly i'm having a hard time interpreting to what you are referring. "A" and "B" here mean what? "TX1" and "RX1" are the pin outputs from the TDC1000? I would stress that the C2000 device and the TDC device are two completely independent systems. They do not just work if you plug them in, it requires a complex setup and communication to work. Similar names between the two imply NO relationship, this is entirely up to the system designer to define.

    Have you looked at the schematic of this system?https://www.ti.com/lit/zip/snar033 

    This will at least allow you to see how these devices are connected.

    Regards,
    Cody 

  • Hello Cody,

    I have attached a PDF file that describes my project in a little more depth and more organized fashion. I have a couple questions at the bottom that if you could answer it would help my progression with the project. Project Setup.pdf

    Thanks,

    Colin

  • Colin,

    1. Yes, this project is possible.
      1. The integration of the TDC and the C2000 devices is demonstrated in the example code that you seem to have loaded on the EVM. If you want to do some averaging of the returned values you might need to modify the code running on the C2000 device. Please note that the c2000 devices is already configured to output all of these sampled values. I presume this is done through UART using the C2000's SCI module. The Arduino should be able to directly receive this information, so I see no need to use a PWM to encode the data.
    2. Our GPIOs are multiplexed. They have many available functions, and can be configured using the GPxMUX registers. The configuration of these is fully described in the Technical Reference Manual. section 1.4 "General-Purpose Input/Output (GPIO) https://www.ti.com/lit/pdf/sprui10 
    1. If you want to use EPWM1A on GPIO1 please select GPIO mux position 1. That can be done with the GPAMUX register.

    Please note that the transducer you use is designed for a range of permeability. This board was primarily designed to be used to sense fluid I assume it would not work very well with sand.


    Regards,
    Cody