Specifying a duty cycle with C - Picoscope 2205A

Post your C and C++ discussions here
Post Reply
rcrodriguez
Newbie
Posts: 0
Joined: Fri Aug 19, 2016 9:41 pm

Specifying a duty cycle with C - Picoscope 2205A

Post by rcrodriguez »

Hello,

I'm using your C API functions to control the Picoscope 2205A. I'm looking to generate a square waveform signal with a specified duty cycle. I know there's a way to specify the duty cycle in the GUI, but is there any way of doing it with C?
Thanks.

Hitesh

Re: Specifying a duty cycle with C - Picoscope 2205A

Post by Hitesh »

Hi rcrodriguez,

You can use the ps2000_set_sig_gen_arbitrary() function to load in your own defined waveform, so you can adjust the duty cycle by changing the point at which your waveform goes from low to high in the in the buffer.

The maximum AWG buffer size is 4096 samples.

Hope this helps,

rcrodriguez
Newbie
Posts: 0
Joined: Fri Aug 19, 2016 9:41 pm

Re: Specifying a duty cycle with C - Picoscope 2205A

Post by rcrodriguez »

Hello, thanks for your response.

I was looking at this function in the SDK example provided. I'm not quite sure on the format of the values. It says max 4096 values with inputs 0-255. Does this mean the waveform will have a max 8-bit resolution?

Also, I'm assuming the file will just have 1 value (0-255) in each line, correct? Is there anyway that you can provide me with a sample file to test and follow?

Thanks.

Hitesh

Re: Specifying a duty cycle with C - Picoscope 2205A

Post by Hitesh »

Hi rcrodriguez,

The 0 - 255 range is supposed to map to the minimum and maximum output level of the waveform. For example if you set the peak to peak voltage to 2000000 microvolts (i.e. +/- 1 V), then 0 will correspond to -1 V and 255 to +1 V.

The output resolution for the AWG is 12 bits so the values are scaled.

Please find attached an example file, where each value is on a separate line.
ps2000_ramp.txt
Example AWG file for PS2000 driver
(18.29 KiB) Downloaded 609 times
Hope this helps,

Post Reply