Test and Measurement Forum

Generate PWM signal with configurable Dutycycle & Frequency

Post general discussions on using our drivers to write your own software here

Generate PWM signal with configurable Dutycycle & Frequency

Postby Pradeep » Fri Apr 29, 2016 9:37 am

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.
Pradeep
Newbie
 
Posts: 1
Joined: Mon Apr 04, 2016 10:21 am

Re: Generate PWM signal with configurable Dutycycle & Freque

Postby Hitesh » Tue May 03, 2016 11:40 am

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,
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2000
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: Generate PWM signal with configurable Dutycycle & Freque

Postby Pradeep » Wed May 04, 2016 4:32 am

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.
Pradeep
Newbie
 
Posts: 1
Joined: Mon Apr 04, 2016 10:21 am

Re: Generate PWM signal with configurable Dutycycle & Freque

Postby Hitesh » Wed May 04, 2016 2:48 pm

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 40 times

Hope this helps,
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2000
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: Generate PWM signal with configurable Dutycycle & Freque

Postby Pradeep » Thu May 05, 2016 5:52 am

Thank you for the response. The attached sample code is very good and helped me to work with the signal generator.
Pradeep
Newbie
 
Posts: 1
Joined: Mon Apr 04, 2016 10:21 am

Re: Generate PWM signal with configurable Dutycycle & Freque

Postby Hitesh » Thu May 05, 2016 8:51 am

Hi Pradeep,

Good to hear that the code has helped. :)

Regards,
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2000
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire


Return to General Software Discussions

Who is online

Users browsing this forum: No registered users and 1 guest