Internet Explorer is not a supported browser for TI.com. For the best experience, please use a different browser.
Video Player is loading.
Current Time 0:00
Duration 10:06
Loaded: 1.65%
Stream Type LIVE
Remaining Time 10:06
 
1x
  • Chapters
  • descriptions off, selected
  • en (Main), selected

[AUDIO LOGO]

Hi, and welcome to the continuation in our C2000 SysConfig video series. I'm Peter [INAUDIBLE]. Today in this video, I'll be doing a live demonstration of using the SysConfig tool. Specifically, I'll be showing how SysConfig can be used to easily modify an existing project.

In this demo, I'll be making a few alterations to one of the ADC examples from our C2000Ware SDK, specifically example 13, which showcases start of conversion oversampling. The hardware that I'll be running this project one will be the F28002x launch pad. To give a background on this example, the device samples three ADC channels-- A0, A1, and A2-- with channel A2 being oversampled.

This example expects an outside source to supply these analog inputs. But I'll be making the modifications so that the launch pad hardware would be responsible for driving these analog signals. Luckily, the launch pad includes an analog signal that can be driven into the ADCs. All C2000 launch pads feature some form of a Digital Analog Converter or DAC signal, whether that be a true DAC that's supplied from on-chip DAC or a PWM-based DAC solution for devices that don't feature an integrated DAC.

The F28002x launch pad that I'm using features a second implementation. The DAC signal is driven by an ePWM signal coming out of GPIO23 that goes into a buffer followed by some low-pass RCA filter circuitry. I'll be driving the ADC channel A0 with this DAC arsenal in a loopback manner.

Now, let's move to the SysConfig demonstration section. To begin, I'm going to want to Import the project into Code Composer Studio. I'm going to show how to Import this example project using TI's Resource Explorer utility.

I have the launch pad already plugged in, and TI Resource Explorer can automatically detect this. Now on the left sidebar, I can pull up to ADC example that I'm looking for. The structure of this might differ depending on the device you're using, but I want to pull up the example which is located under the device's Driverlib lib folder.

First, I have to go to Software, then choose C2000Ware. I want to use the English version of our SDK. Now, I have to choose a device-- so F28002x and, specifically, the F280025C package.

Now, I'll pull up the example under the Driverlib folder. And I'm looking for ADC example 13. When I select this example, it will automatically pull this example into CCS. Even though TI Resource Explorer is hosted in the cloud, this project is going to be copied and stored locally on my machine. And any changes I make to this local project will not affect the original source code.

Now if I expand the project, you can see that there's a number of files and folders that make up the project. This includes the main.c example file as well as the SysConfig file. To start off, the first thing I want to do is to check to make sure that I'm using the correct target configuration. Each of our examples featured different target configurations depending on the device you're using and whether you want to load into RAM or Flash.

Right click on the project. Go down to Build Configurations, and hover over the Set Active option. It's initially set to the base RAM configuration. Since I plan to run this example on the launch pad, I'll change this to that LAUNCHXL_RAM configuration. Now if you look at the targetConfigs folder, the launch pad version will now be highlighted.

Now, I can begin to implement the changes that I mentioned earlier in the video. Double click in this SysConfig file will launch the SysConfig GUI. Notice that it's already populated with all the module configurations needed for the original example. On the left side, you can see all of the peripherals that are available on the device. And on this main panel, you can see all the configuration options.

Let me bring up the ADC peripheral configuration settings to look at. So now, you can see all of the different settings that users can configure for the device's ADC peripherals. Notice that this instance is configured under ADCA. So anything that is configured in this panel is restricted to that instance. If I want to use another ADC, I can click on this Add button, and SysConfig will populate another ADC peripheral.

SysConfig has broken up all the settings into some main sections. For now, I'm primarily interested in looking at how the SOCs are configured. In this project, there are six SOCs configured at numbers 0 through 5. I can go to each of these SOCs and look into even more detail about how they're configured exactly.

So SOC0 is configured ADCIN0. SOC1 is configured to ADCIN1. And SOC2 through SOC5 are configured to ADCIN2. This is because those four SOCs are used to perform oversampling on Channel 2.

So I'm going to change a few things to the ADC configuration using SysConfig. Right now, we're sampling three ADC channels. But I plan on reconfiguring the SOCs since I only plan to drive Channel 0 with the launch pad's DAC signal.

The first SOC is correct. Now, I want to configure this SOC so that it matches the specifications for the launch pad. To start off, I'm going to be using a neat feature within SysConfig to help me do some of the calculations.

The ADC peripheral includes a sample time calculator, and that goes beyond what you're seeing right here. You can set the number of SYSCLKs here, and that's an easy translation into sample time with 10 nanoseconds per SYSCLK. So 10 clocks would be 100 nanoseconds.

But if I click this check button, you can see that SysConfig goes even deeper and can even help you calculate the Acquisition Prescaler or the ACQPS value. Some of this information is pre-populated, but you can see there's fields where I can enter the Input Capacitance, the Input Resistance, in my desired Settling Error. This LSB field is pretty standard, so I'll keep it at 0.5. But for these other two fields, I'll be referring to the F28002x launch pad schematic for this.

For the input cap, that's 0.1 microfarad, which translates to 100,000 picofarads. And for the resistance, that's just 1 kiloohm. Now, notice that the sample time gets calculated and populated right here. And I can choose to use that value for this SOC by clicking this checkbox. And now, you can see that that populates right here.

And now, what I'm going to want to do is to make the same changes for the rest of the SOCs. So for SOC1, I'll change that to convert channel A0. And for the sample window, I could enter all the information again. But since I already the value I want, I can just enter that manually right here-- so 236. And I'll do the same for the rest of the SOCs. Remember that we went all of them to convert channel A0 and for all of them to have the same number of SYSCLK cycles that we've calculated.

And so after I finish making these changes, SysConfig will automatically generate these changes into the source code that's present in the bor.c file. So now that I've set that up, the other thing I want to do is configure the ePWM DAC. The setup process I'm about to perform is something that is specific to the launch pad for devices that don't include an on-chip DAC. For devices with a DAC, the setup will be easier since you can directly configure the DAC within SysConfig.

So now, I want to add an ePWM peripheral to my project by clicking the Add button, right here. I'm going to rename the one I just added to be myEPWM4. The first thing I want to configure is the GPIO being used. A helpful note-- if I go over to this triple-dot button on the top right and go to Preferences, I can add the device pin name to my view to make it easier to identify which signals I'm using.

Now that that's done, I can configure the PWM. Let me scroll to the bottom and configure the pin box first. So for use case, I'll change this to Custom since I only need to use the EPWM4_B and not the full EPWM module.

Next, I'll select EPWM_4 from this list and, specifically, the one mux'd to GPIO23. Now, I need to configure the other parameters for the EPWM. I'll start with the time-based options. I want to set the Time Base period to 200. I'll change the High Speed Clock Divider to divide the clock by 1. Next, I want to change the Counter Mode to Up Count mode.

Now, I can configure the counter compare cell module. For CMPB, I'll set the value to 100 to get a 50% duty cycle. Now, moving on to the Action Qualifier, let me enable the Shadow Mode enable checkbox. I'll configure this action qualifier setting to toggle when the time base equals 0 and when the time base counter up equals CMPBB. The zero event will trigger the pin high, and the CMPB will trigger the signal low.

So now that everything is set up, I can run this code by clicking on this debug icon within CCS. This will do everything for me. It is going to compile the code, connect to the board, download the code, and then go to main. So as you can see, the project is building, and linking, and now launching the debug to connect to the launch pad.

Now that everything is complete, you can see that it goes to the main function. What I'm going to do right now is just take these global variables and populate them to the watch expressions window set that they're easier to monitor. Be sure to enable continuous refresh when you're monitoring these watch expressions so that they don't remain static and actually change as the code progresses.

So now, I'm going to hit the Run and Resume button. And I already have the jumper wires populated going from a DAC on site 2 to the ADC A0 header. And now, you see that the watch expressions should be changing now. So we're aiming for 2048, at least for this specific device since it's a 12-bit DAC.

This value will be different for 16-bit DACs. The value isn't exact because there's some noise in non-optimizations. And to note, the first two, A0 and A1, are raw ADC samplings, whereas this A2 channel is being oversampled. So you can see that it's changing less dramatically than the other two channels.

That concludes this live SysConfig demo within our C2000 SysConfig video series. You saw that we were able to modify the source code using the intuitive SysConfig user interface and test on some hardware. Feel free to watch the other videos within this series for more information about SysConfig. In addition, I've included some more resources for SysConfig, and you can download this presentation below. Thanks for watching.

This video is part of a series