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.

RTOS/LAUNCHXL-F28069M: Sin Wave generation using DAC

Part Number: LAUNCHXL-F28069M
Other Parts Discussed in Thread: C2000WARE, CONTROLSUITE

Tool/software: TI-RTOS

Hi,

I am using F28069M MCU. I wanted to generate 10khz Sinwave using DAC on the board of LAUNCHXL-F28069M. I have checked data sheet and it was written there that device has 4 DAC pins. but in the simulink library i could not find any DAC block in support package to access the DAC  just like it does exists in other library(see pic).

any help?

thank you

regards

Rahul 

  • For F28069, I think you need this block - its denoted as AnalogIO Output.

    www.mathworks.com/.../c2802xc2803xc2806xf28m3xanalogiooutput.html

    HTH,
    -Brian
  • Rahul,
    The F28069 does not have integrated general purpose DACs. There are three internal DACs on this device, all of which are associated with the comparator sub-systems but not brought to external pins.
    If you want to generate an analogue sine wave output on F28069 you can use any of the PWM modules and then low-pass filter the output in hardware. The LaunchPad board has circuitry to do this on four channels (see page 4 of the board schematics), which I think is what you mean. In you Simulink model, you will need to set up PWMs 7A, 7B, 8A, & 8B to have fixed switching frequency (say, 100 kHz), and modulate their duty cycles with a 10 kHz sinusoid.
    Regards,
    Richard
  • Hi Richard,

    Thank you.

    Can you upload the board schematic here that you were talking about.?

    regards

    Rahul

  • Hi Rahul,

    Sure, attached.

    The full documentation is in C2000Ware.  If you install in the default location the document is at:

    C:\ti\c2000\C2000Ware_1_00_03_00\boards\LaunchPads\LAUNCHXL_F28069M

    Regards,

    Richard

    LAUNCHXL_F28069M_sch.pdf

  • Hi Richard,

    As you have mentioned that I need to set up PWMs 7A, 7B, 8A, & 8B to have fixed switching frequency (say, 100 kHz) so can you tell me why these specific channels only? I mean there also pwm channels.

    thank you.

    regards
    Rahul
  • Hi Rahul,

    If you look at the schematic page I mentioned you will find the GPIO pin numbers to which the RC filters are connected (GPIO40-43). Then, go to the device datasheet and look at the PWM channels connected to those pins. The board designer has connected A & B outputs from PWM modules 7 & 8 to the filters.

    Regards,

    Richard
  • Hi Richard,

    Nice explanation. Thank you again!

    do you know that these GPIOs will give directly sinwave or do i need to use passive RC filters on the bread board to generate sinwave via PWM signal. And from one GPIO cannot we get the wave we wanted and if yes then why do I need to use all of them?

    regards
    Rahul
  • Hi Rahul,

    The filtered outputs will be on the board header pins J5/71 & 72, and J1/31 & 32 (see page 5 of the schematic). Unfortunately I've just noticed the LaunchPad filter frequency is well below that of the sine wave you want to produce. If you're going to use these on-board filters you'll need to change some passive values: I suggest reducing the four capacitor values (C33 - C36) to 10nF. Alternatively, if you have a bread-board available you could use a different PWM channel and build your own filter off the board.

    There is an application note here which may help:
    www.ti.com/.../spraa88a.pdf

    Your first message mentioned 4 DACs so I thought you wanted four separate signals. Of course if you just want one sine wave, you'll only need one PWM output and one filter.

    Regards,

    Richard
  • HI Richard,

    Thank you for faster response and enlightening.

    I will try to use that and see if it works.

    Have a nice weekend.

    regards
    Rahul
  • Thanks. I hope it works out.

    A nice week-end to you too.

    Regards,

    Richard
  • Hello Richard,

    I have tried to model and used ePWM model and config parameters of block. I have enabled 8A channel only because I need only one output of sinwave. does this ePWM block directly give me sinwave?

    I just dont want to destroy(I did once) Launchpad again so making sure that i am doing right way. Or can you post or give some demo to deal with this model(to generate sinWave)? The pdf file that you have suggested above is understandable but as theoritical point of view.

    Thank you.

    regards

    Rahul

  • Hello Rahul,

    What you're doing here is configuring the ePWM8 module to produce a PWM pattern on output A. This looks like a duty cycle modulated pattern in up-down count mode. You will have to add other blocks to your Simulink model to generate the sine wave data and connect it to the duty cycle input (CMPA) of the ePWM8 block.

    For Simulink model related advice I think you will get better answers from The Mathworks support forum. Please let me know how you get along with this.

    Regards,

    Richard
  • Hi Richard,

    Do you have any .c or .cpp file that generates sinwave which may be sometimes found in controlSUITE example to work with CCS. So i can just directly use that and make MATLAB function.

    regarding SIMULINK, I have already made a request. i will let you know if I get an answer.

    reagrds
    Rahul
  • Hi Rahul,

    If you're looking for something in controlSUITE there is a signal generator library with a sine wave generator included. If you have cS in the default location, the library will be at:
    C:\ti\controlSUITE\libs\dsp\SGEN

    Other than that, you might like to try take a look at the F2837xD 1-day worksho materials which include a look-up table based sine wave generator in lab 4. You can find the workshop materials here:
    processors.wiki.ti.com/.../C2000_One-Day_Workshop

    Regards,

    Richard