Generate PWM signal with configurable Dutycycle & Frequency

Post general discussions on using our drivers to write your own software here
Post Reply
Pradeep
Newbie
Posts: 1
Joined: Mon Apr 04, 2016 10:21 am

Generate PWM signal with configurable Dutycycle & Frequency

Post by Pradeep »

Hi,

We are using Picoscope 3406D MSO variant. Using the sample code provided with SDK, we are happy that picoscope measures the waveform values at high accuracy.
We would also like to use the build-in signal generator to generate PWM signal with different frequency & dutycycle values configured at runtime.
Kindly help us by providing some information how to generate PWM signal with different frequency & dutycycle.
Thanks in advance.

Hitesh

Re: Generate PWM signal with configurable Dutycycle & Freque

Post by Hitesh »

Hi Pradeep,

The PicoScope 3406D MSO had a 32768 sample buffer that can be used to specify arbitrary waveforms which are then passed to the ps3000aSetSigGenArbitrary() function.

In your program you can specify the waveform adjusting the duty cycle as required. The ps3000aSigGenFrequencyToPhase() function can be used to convert the frequency to a phase value to be passed to the ps3000aSetSigGenArbitrary() function.

Please refer to the Programmer's Guide for further information on these functions.

I hope this helps,

Pradeep
Newbie
Posts: 1
Joined: Mon Apr 04, 2016 10:21 am

Re: Generate PWM signal with configurable Dutycycle & Freque

Post by Pradeep »

Thank you for the response.

Yes, in Programmer’s Guide there are API methods for configuring Signal generator. Such as ps3000aSetSigGenArbitrary, ps3000aSetSigGenBuiltIn, ps3000aSetSigGenPropertiesArbitrary, ps3000aSetSigGenPropertiesBuiltIn, ps3000aSigGenFrequencyToPhase etc.

But in SDK’s C# sample code, there is no single method available to deal with Signal generator. Also no method is declared in PS3000Imports.cs file. So I don’t have any idea of how to implement those in C# .Net platform.

Please share some code snippets through which I can configure and make use of signal generator. For Example, Code to make the signal generator to generate one Standard wave (Sine wave, DC voltage etc) and one Arbitrary Wave. It would be very much helpful for me to proceed.

Hitesh

Re: Generate PWM signal with configurable Dutycycle & Freque

Post by Hitesh »

Hi Pradeep,

Please find below a C# project that is based on the Signal Generator example for the PicoScope 4824.

It can be used to control the in-built functions and the AWG. There are some test AWG files in the \PS3000aSigGen\bin\x86\Debug folder.
PS3000aSigGen.zip
Signal Generator example
(55.67 KiB) Downloaded 742 times
Hope this helps,

Pradeep
Newbie
Posts: 1
Joined: Mon Apr 04, 2016 10:21 am

Re: Generate PWM signal with configurable Dutycycle & Freque

Post by Pradeep »

Thank you for the response. The attached sample code is very good and helped me to work with the signal generator.

Hitesh

Re: Generate PWM signal with configurable Dutycycle & Freque

Post by Hitesh »

Hi Pradeep,

Good to hear that the code has helped. :)

Regards,

Post Reply