s32k144 AD1 software trigger can not into the interrupt,ADC0 can into the interrupt

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

s32k144 AD1 software trigger can not into the interrupt,ADC0 can into the interrupt

2,023 次查看
jiangbolwj
Contributor II

I use the AD software trigger   but  can not  into the interrupt,can you help me look where is the problem。

the main procedure fellow:

const adc_converter_config_t adConv1_ConvConfig0 =

{
.clockDivide = ADC_CLK_DIVIDE_1,
.sampleTime = 12U,
.resolution = ADC_RESOLUTION_8BIT,
.inputClock = ADC_CLK_ALT_1,
.trigger = ADC_TRIGGER_SOFTWARE,
.dmaEnable = false,
.voltageRef = ADC_VOLTAGEREF_VREF,
.continuousConvEnable = false,
};

const adc_chan_config_t adConv1_ChnConfig0 =

{
.interruptEnable = true,
.channel = ADC_INPUTCHAN_AD0,
};

ADC_DRV_ConfigConverter(INST_ADCONV1, &adConv1_ConvConfig0);

INT_SYS_InstallHandler(ADC1_IRQn, &adISR,(isr_t *)0);
INT_SYS_EnableIRQ(ADC1_IRQn);

ADC_DRV_ConfigChan(INST_ADCONV1, 0U, &adConv1_ChnConfig0);

void adISR(void)
{
   ADC_DRV_GetChanResult(INST_ADCONV1, 0U, &adcRawValue);
}

this can not into adISR

QQ截图20170722090605.png

QQ截图20170722090626.png

0 项奖励
回复
5 回复数

1,602 次查看
jiangbolwj
Contributor II

someone could help me

0 项奖励
回复

1,602 次查看
dragos-ionutgal
NXP Employee
NXP Employee

Hi,

Are you kind enough to provide the following details:

1) Design Studio version

2) SDK version;

3) Mask set for the microcontroller you are using.

These will help us narrow down the area where to look.

Thanks.

0 项奖励
回复

1,602 次查看
jiangbolwj
Contributor II

1.SKD0.82

2.software: S32 Design Studio for ARM v1.3

3.mcu :FRDM-S32

0 项奖励
回复

1,602 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi jiangbolwj,

the SDK 0.8.2 supports the latest MCU revisions. These are mounted on S32K144EVB-Q100.

The FRDM board has MCU with first revision (mask 0N77P) mounted. There are differences in vector table, the vector for the ADC0 is the same but ADC1 not, that could be a reason why the ADC1 interrupt is not working on your board.

pastedImage_1.png

The S32 sdk ear 0.8.1 supports cut1 MCU (mask 0N77P).

BR, Petr

1,602 次查看
dragos-ionutgal
NXP Employee
NXP Employee

Hi jiangbolwj,

Thank you for sending the information and attaching the code.

I have found you problem!

In software trigger mode function "ADC_DRV_ConfigChan" always restarts the ADC conversion, regardless if another conversion was already started.

Because the CPU runs at a higher frequency than the ADC and you are calling "ADC_DRV_ConfigChan" continuously inside the while(1) loop, the ADC never gets a chance to complete a conversion, thus no interrupt is generated.

If you use a delay after calling "ADC_DRV_ConfigChan" then it will trigger the interrupt.

You can also use function "ADC_DRV_WaitConvDone" between two consecutive calls of "ADC_DRV_ConfigChan" function for the same ADC peripheral.

Our ADC also supports timer based triggering, this means you can use a LPIT timer to start the ADC conversion automatically at specific time intervals, please look in the examples.

I hope this helps you.

Sincerely,

Dragos.

0 项奖励
回复