More info on adc11_set_trigger function

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

More info on adc11_set_trigger function

Post by mentalsurge »

Hello,

Can you please give me some more info on the set_trigger function.
I cannot get it to work correctly in my program. (C++)
I need it to trigger when I get a voltage on channel 11, but it seems to just return straight away.

I was using the following syntax:

adc11_set_trigger(true, false, 0, 11, false, 300, 0);


The voltage that is my trigger is around 1V. My adc11 is V3, and I am using Visual C++ for windows.

Many thanks


Dan Tallentire.

Guest

ADC11 Set Trigger Values

Post by Guest »

Hello,

It looks like you have scaled the 1V into adc counts incorrectly so the unit is trigger early.

A description of the function is given below

Code: Select all

adc11_set_trigger(
                           true,           //trigger enabled 
                           false,          // Auto trigger, not enabled
                           0,               //Auto trigger set to false
                           11,             //Chosen Channel
                           false,          // Trigger direction, rising selected, select true for falling
                           300,            //Trigger value in ADC counts
                           0);               //Delay in percent, set to zero
As you have a V3 ADC11, this returns adc values between 0 and 4096.

To convert voltages to ADC counts, divide the voltage by 2.5 and then multply by 4096 i.e. for 1V the ADC count value is 1638, not 300.

Best regards
James

mentalsurge

ADC11 Set Trigger Values

Post by mentalsurge »

Thankyou for the response, but this still does not seem to be working.

It does not matter what I set the trigger value to, it still does not wait for the trigger. I know my ADC11 is working, as it intializes correctly in the code, and I have used the digital output from the code also.

I have also checked the channel using the Picoscope, and this shows the voltage change from the channel.

Changing the trigger value to well above the level of my voltage does not make any difference, as it still triggers straight away.

Any ideas?

Thanks,

Dan Tallentire.

User avatar
matthew
Advanced User
Advanced User
Posts: 109
Joined: Wed Sep 25, 2002 9:35 am
Location: Cambridgeshire, UK

Post by matthew »

Hi Dan,

Does the ADC-11 trigger correctly in PicoScope (you hint at this but do not state it explicitly)?
Try it in Auto-Trigger mode.

Regards,
Matt Everett

Pico Software Engineer

Post Reply