LPC43S70 HSADC THRESHOLD_SEL=1(THR_A) And HSADC MATCH_VALUE=1

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

LPC43S70 HSADC THRESHOLD_SEL=1(THR_A) And HSADC MATCH_VALUE=1

跳至解决方案
408 次查看
robberpen
Contributor III

Hi

Want to know the behavior HSADC_DESC_MATCH(0x0) and HSADC_DESC_THRESH_A below example,

As my undestand, 

  1. HSADC_DESC_MATCH(0x0) will start simpling imediataly in this case.
  2. and HSADC_DESC_THRESH_A will start simpling at trigger threshold_A.

In this case. which behavior will be higher priority? simpling  imediataly or wait unitl THRSH_A trigger?

 

Chip_HSADC_SetupDescEntry(LPC_ADCHS, 0, 0, (HSADC_DESC_CH(1) |

HSADC_DESC_BRANCH_NEXT | HSADC_DESC_MATCH(0x1) | HSADC_DESC_THRESH_A |

HSADC_DESC_RESET_TIMER));

0 项奖励
回复
1 解答
349 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

I suppose that you misunderstood the threshold_A, it is not a trigger source, it is a compare register, the ADC sample result is compared with the threshold_A register automatically, then update flag or fire interrupt which indicates that the analog signal is below a threshold or above a threshold.

If you set HSADC_DESC_MATCH(0x10), the adchs module has an internal counter, the tick is the ADC clock, after hardware/software trigger, when the counter reaches 16 or 0x10, the ADC will convert, so the ADC conversion rate is Fadc/16.is you set  HSADC_DESC_MATCH(0x00), the ADC will generate a sample for each ADC clock cycle.

Hope it can help you

BR

Xiangjun Rong

 

xiangjun_rong_0-1724380546937.png

 

在原帖中查看解决方案

0 项奖励
回复
4 回复数
375 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

Q1)HSADC_DESC_MATCH(0x0)will start sampling immediately in this case.

>>>>>The HSADC_DESC_MATCH(0x0) does not mean that the ADC converter starts-up immediately, the HSADC_DESC_MATCH(0xxx)  can control the ADC sampling time(ADC conversion rate). Setting HSADC_DESC_MATCH(0x00) means that the ADC can get one sample for each ADC clock.

You can use software trigger to start ADC conversion by setting the SW_TRIGGER bit in Trigger register, pls refer to section 48.6.5 Trigger register.

You can use hardware trigger to start ADC conversion by setting the ADCHS_TRIGGER_IN reg, pls refer to section 18.4.25 ADCHS trigger input multiplexer (ADCHS_TRIGGER_IN).

 

Q2)and HSADC_DESC_THRESH_A will start simpling at trigger threshold_A.

>>>>>DESCRIPTOR0x[THRESHOLD_SEL] selects the ADC result comparsion threshold register, it is NOT related to ADC starting.

Hope it can help you

BR

XiangJun Rong

 

 

 

0 项奖励
回复
360 次查看
robberpen
Contributor III

Hi @xiangjun_rong 

I don't quite understand.

Here a case of  both  HSADC_DESC_THRESH_A and HSADC_DESC_MATCH(0x10) set to descriptor.

then  while  threshold_A was trigger at hsadc timer 0x5, what is the timing clock of simpling? clock 0x5, 0x6 or 0x10?

thanks
Peter

0 项奖励
回复
350 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

I suppose that you misunderstood the threshold_A, it is not a trigger source, it is a compare register, the ADC sample result is compared with the threshold_A register automatically, then update flag or fire interrupt which indicates that the analog signal is below a threshold or above a threshold.

If you set HSADC_DESC_MATCH(0x10), the adchs module has an internal counter, the tick is the ADC clock, after hardware/software trigger, when the counter reaches 16 or 0x10, the ADC will convert, so the ADC conversion rate is Fadc/16.is you set  HSADC_DESC_MATCH(0x00), the ADC will generate a sample for each ADC clock cycle.

Hope it can help you

BR

Xiangjun Rong

 

xiangjun_rong_0-1724380546937.png

 

0 项奖励
回复
344 次查看
robberpen
Contributor III
Hi xiangjun_rong

thanks for your clarification.
No more question.
0 项奖励
回复