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.

Waveform/Signal generator with a MSP430

Hi,

We need some suggestion about choosing MSP430.
Our customer is currently using Waveform Generator IC and wants to replace that with a MSP430.

We would like to know if we can implement a 200Khz Waveform/Signal generator with a MSP430(resolution of 100Hz).
The MSP430 has the option to output SMCL/MCLK, can this be used as the external output clock?
or should we use the Timers to generate the Waveform?
The signal should be Sine Wave or Digital pulses with Voltage level "0 for LOW" and "3V for HIGH".


Regards,
Paddu.

  • paddu1 said:

    Our customer is currently using Waveform Generator IC and wants to replace that with a MSP430.

    Here are a few forum threads that could be a good starting point:

    How to Implement the code for a signal Generator?

    MSP430FG437 Sine Wave Generator

  • Hi,

    We would like to know if it is possible to produce frequencies like
    180.1KHz, 180.2KHz, 180.3KHz........180.9KHz, using Timer PWM(Fixed Duty).
    As we need highly accurate frequencies(with 100Hz difference between each)
    will it be possible with MSP430 or should we go for a function generator IC.

    Regards
    Paddu

  • paddu1 said:
    We would like to know if it is possible to produce frequencies like
    180.1KHz, 180.2KHz, 180.3KHz........180.9KHz, using Timer PWM(Fixed Duty).

    Simple Answer: No.
    The PWM frequencies you can generate have to be integer fractions of a clock signal you have to provide.

    For 180100, 180200 and 180300, the smallest frequency where all three are integer fractions of is 585GHz

    Also, for 180100Hz, the cycle time is 5552ns, for 180200, it is 5549ns. 3ns difference. But on 25MHz (maximum MSP clock for the fastest MSPs) the timer granularity is 40ns. So around 180kHz, the granularity is 1303Hz.

    Maybe an MSP with the TimerD module might give better results, but I never worked with it.

  • paddu1 said:
    Our customer is currently using Waveform Generator IC and wants to replace that with a MSP430.

    This (200KHz sine generation) can't be done using microcontrollers, especially using PWM. You shall look for DDS (Direct Digital Synthesis) chip with built-in DPLL generator like AD9837 (sorry, don't know any from TI).

  • Ilmars said:
    This (200KHz sine generation) can't be done using microcontrollers, especially using PWM.

    With PWM, you're right. But with DAC it works. I'm currently working on a sine-wave of 50kHz with 80 samples per wave, using an 8MHz 1611 and DMA. 200kHz is possible with less samples (20 per wave) which is somewhat rough.

    If the wave data is precalculated for a specific frequency, this can be done. However, granularity is an issue. DMA output happens with 1/2 MCLK. So it will require quite some calculation to produce sample data that presents the frequency. And external filtering is required to smoothen the digital steps.
    Also, at this speed, you cannot produce a continuous frequency output and at the same time have the CPU do anything. Luckily, my wave output only requires ~10 consecutive waves, so the wave data is for 10 waves and one DMA burst.

  • Jens-Michael Gross said:
    200kHz is possible with less samples (20 per wave) which is somewhat rough.

    Please add frequency tuning option with 0.05% steps and it appears to be impossible without PLL/FLL for DAC sample rate generation. My fault that I did not mention fine tuning in my statement.

    I think question here is: do particular application/device of 200KHz generation with fine tuning really cannot tolerate 1.70$ cost increase (per 1000) for proper waveform generator IC? Everybody needs precision for a cheap but come on...

  • Ilmars said:
    Please add frequency tuning option with 0.05% steps and it appears to be impossible

    Not really. If you run a sine calculation over a larger number of waves, you can come quite close. Of course you'll need an external filter so 'smoothen' the result, as the digital steps get rougher with increasing frequency, but it should work. Quite some math to do and soem buffer space required.

    I just got my hardware and after some corrections, it is putting out a nice 50kHz sine wave on F1611 (8MHz MCLK). With a different (dynamically created) table, I could go for almost any frequency. Of course, the closer it comes to MCLK/4, the rougher the adjustments are. But on 200kHz there's still some headroom if you have a filter that shapes the DAC output. But I admit that on 0.05% adjustments, the size of the table for a closed cycle can go quite large. And the math isn't easy for the poor MSP :)

  • Jens-Michael Gross said:
    If you run a sine calculation over a larger number of waves, you can come quite close.

    Right. At least 4..5 KB 8-bit sample buffer needed to approximately meet original spec. So MSP with DAC, DMA and plenty of SRAM will do the job. When customer come with complaint about not good enough THD (of sine waves) or not wide enough freq range - we will kindly smile at him and say: you got what you asked for ;)

  • Thank you all..

    Actually I found an application note on how to get
    high frequency resolution with fixed duty cycle and I am trying to understand this
    application note, but it says "100 kHz signal that can be adjusted in steps of 64 Hz"
    http://ww1.microchip.com/downloads/en/AppNotes/01050a.pdf


    Regards.
    Paddu.

  • paddu1 said:

    Actually I found an application note 

    Before we start to talk about this (sorry) venerable way of pseudo- spread spectrum frequency generation which I can't find usable for ANY application except to write application note, please be so kind and tell us your application and it's requirements in more details (than 200 KHz sine with 0.1 KHz step).

**Attention** This is a public forum