K32W061/QN9090/JN5189: How to select trigger for ADC?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

K32W061/QN9090/JN5189: How to select trigger for ADC?

44 Views
ckielstra
Contributor II

I want to do a single ADC conversion and trigger this from software. What do I specify for the TRIGGER bits?

Manual UM11323 for the K32W061 mentions in section 27.7.1:

Set the trigger source to an unused setting using the SEQ_CTRL[TRIGGER] bits. The
value 3, for example, is not used on this device.

Question 1) Is this TRIGGER source a number or a mask?

In the description of the TRIGGER field, section 17.1.3, it says:

Select which of the available hardware trigger sources will cause this conversion sequence to be initiated.
Program the trigger input number in this field. Setting: 0 : PINT0; 1 : PWM8; 2 : PWM9; 3 : ARM TX EV.

Here it says the field contains a number, i.e. you can only select one trigger source. An identical text can be found in UM10732 for the LPC11U6x/E6x. Which makes sense as that chip has 7 bits and 7 potential trigger sources.

But.... in the source code for the K32W061 ADC driver, fsl_adc.h, we read:

 

 

uint32_t triggerMask; /*!< Selects which one or more of the available hardware trigger sources will cause this
             conversion sequence to be initiated. The available range is 6-bit.*/

 

That's completely different! According to the source code the field is a mask and you can select multiple triggers.
Which is wrong? The User Manual, or the source code?

 

 

Question 2) Assuming that the manual is correct and that we have to configure a trigger number and not a trigger mask, then what is a good number for a software trigger?

UM11323 states:

 

The value 3, for example, is not used on this device.

This is incorrect, see above quote from section 17.1.3, numbers 0 to 3 are in use.

What is the suggested number to use?

Note that all code examples for the K32W061 use number 0 which I suspect to be wrong.

0 Kudos
0 Replies