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

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

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

142件の閲覧回数
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.

ラベル(3)
0 件の賞賛
3 返答(返信)

94件の閲覧回数
Ricardo_Zamora
NXP TechSupport
NXP TechSupport

Hello,

 

Hope you are doing well. The available trigger is the mentioned on the User Manual.

 

For Software-triggered conversion, please refer to section 27.6.3 of the K32W061/K32W041 User Manual.

Also, you can refer to the adc_interrupt SDK example. This example does a Software Trigger.

 

And, just as a comment, some of the SDK example set the Trigger to 0 or 2.

 

Hope this helps.

 

Regards,

Ricardo

0 件の賞賛

36件の閲覧回数
ckielstra
Contributor II

Hello Ricardo,

 

Thanks for your reply.

 

For Software-triggered conversion, please refer to section 27.6.3 of the K32W061/K32W041 User Manual.

This doesn't help as that document seems to contain an error. In section 27.7.1, it states: 

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.

In section 17.1.3 of the K32W061/K32W041 Register Manual, we see for TRIGGER (bit 17 to 12) that values 0, 1, 2 and 3 are in use.

 

Also, you can refer to the adc_interrupt SDK example. This example does a Software Trigger.

 

And, just as a comment, some of the SDK example set the Trigger to 0 or 2.

Well, this could also be a bug, couldn't it? I'm sure the examples work with these settings, but there is a risk of a spurious interrupt when the PINT0 (for 0) or PWM9 (for 2) is triggered.

 

0 件の賞賛

5件の閲覧回数
Ricardo_Zamora
NXP TechSupport
NXP TechSupport

Hello,

 

Are you having any issue with the SDK example?

 

Regards,

Ricardo

0 件の賞賛