ADC_setInterruptPulseMode (M_PAN_ADCA_BASE、ADC_PULSE_END_of _CONV); //为模数转换器内核加电。 ADC_enableConverter (M_PAN_ADCA_BASE); //延迟1ms 以允许 ADC 加电时间 DEVICE_DELAY_US (500); // SOC 配置:设置 ADC ePWM 通道和触发器设置 //禁用 SOC 突发模式。 ...
ADC_setInterruptSource(ADCB_BASE,ADC_INT_NUMBER1,ADC_SOC_NUMBER1); ADC_enableInterrupt(ADCB_BASE,ADC_INT_NUMBER1); ADC_clearInterruptStatus(ADCB_BASE,ADC_INT_NUMBER1); } ADC_forceSOC(ADCA_BASE,ADC_SOC_NUMBER0); ADC_forceSOC(ADCA_BASE,ADC_SOC_NUMBER2); A...
初始化 ADC: #defineISR_PRIORITY_ADC 2IFX_INTERRUPT(ISRresultADC,0,ISR_PRIORITY_ADC);/* ADC Interrupt Service Routine */voidISRresultADC(void){/* Get the VADC conversions */for(uint32 chnIx=0;chnIx<3;++chnIx){Ifx_VADC_RES conversionResult;uint32 index=Get_Index(IfxVadc_Group...
1、使用EPWM的SOCA触发; 登录后复制AdcRegs.ADCTRL2.bit.EPWM_SOCA_SEQ1=1;// Enable SOCA from ePWM to start SEQ1AdcRegs.ADCTRL2.bit.INT_ENA_SEQ1=1; // Enable SEQ1interrupt (every EOS) 2、使能EPWMxSOCA信号的产生,以何种方式何时产生; 登录后复制EPwm1Regs.ETSEL.bit.SOCAEN=1; // Enable ...
timer_channel_output_mode_config(TIMER0, TIMER_CH_2, TIMER_OC_MODE_PWM1); timer_channel_output_shadow_config(TIMER0, TIMER_CH_2, TIMER_OC_SHADOW_ENABLE); /* 预装载使能 */ /* channel4 设置, 触发ADC用 */ timer_channel_output_pulse_value_config(TIMER0, TIMER_CH_3, 5); ...
// set the ADC interrupt pulse generation to prior ADC_setIntPulseGenMode(obj...
ADC_setInterruptPulseMode(ADCA_BASE, ADC_PULSE_END_OF_CONV); // // Power up the ADC and then delay for 1 ms // ADC_enableConverter(ADCA_BASE); DELAY_US(ADC_usDELAY); // Delay before converting ADC channels // // Select the channels to convert and the end of conversion flag ...
这样每调用一次 StartConvert() 函数, ADC 会执行一次采样,然后自动停止。这样你也不需要再ADC 中断中再调用 StopConvert() 来停止 ADC 采样了。 Note: Hardware Trigger - A rising-edge pulse on the SOC pin starts a single conversion.The ADC_StartConvert() function also starts a single conversion...
9、/ 1 reserved uint16 int_mod_seq2:1; / 2 seq2 interrupt mode uint16 int_ena_seq2:1; / 3 seq2 interrupt enable uint16 rsvd2:1; / 4 reserved uint16 soc_seq2:1; / 5 start of conversion for uint16 rst_seq2:1; / 6 reset seq2 seq2复位 uint16 ext_soc_seq1:1; / 7 ex...
(INTERRUPT_CPU_INT1); ADC_enableConverter(ADCA_BASE); //adcb ADC_setVREF(ADCB_BASE, ADC_REFERENCE_MODE, ADC_REFERENCE_VOLT); ADC_setPrescaler(ADCB_BASE,ADC_CLK_DIV); ADC_setInterruptPulseMode(ADCB_BASE, ADC_PULSE_END_OF_CONV); ADC_setupSOC(ADCB...