TI中文支持网
TI专业的中文技术问题搜集分享网站

28335 ADC-SOC触发启动方式

Multiple triggers as sources for the start-of-conversion (SOC) sequence
– S/W – software immediate start
– ePWM 1-6
– GPIO XINT2

Why XINT1 can start ADC (SOC mode)  ???

为啥XINT1也能触发启动ADC

Martin Yu:

原则上只有XINT2可以触发ADC转换,请问如何判断是XINT1触发的?

Multiple triggers as sources for the start-of-conversion (SOC) sequence
– S/W – software immediate start
– ePWM 1-6
– GPIO XINT2

Why XINT1 can start ADC (SOC mode)  ???

为啥XINT1也能触发启动ADC

yongwang hou:

回复 Martin Yu:

我通过仿真,看到进入ADC中断

Multiple triggers as sources for the start-of-conversion (SOC) sequence
– S/W – software immediate start
– ePWM 1-6
– GPIO XINT2

Why XINT1 can start ADC (SOC mode)  ???

为啥XINT1也能触发启动ADC

yongwang hou:

回复 Martin Yu:

#include "DSP28x_Project.h"

interrupt void adc_isr(void);interrupt void xint1_isr(void);

Uint16 Result = 0;

main(){ InitSysCtrl();

EALLOW; SysCtrlRegs.HISPCP.all = 3; EDIS;

DINT;

InitPieCtrl();

IER = 0x0000; IFR = 0x0000;

InitPieVectTable();

EALLOW; PieVectTable.ADCINT = &adc_isr; PieVectTable.XINT1 = &xint1_isr; EDIS;

InitAdc();

AdcRegs.ADCMAXCONV.all = 0x0000; AdcRegs.ADCCHSELSEQ1.bit.CONV00 = 0x0;// ADCINA0 AdcRegs.ADCTRL2.bit.EXT_SOC_SEQ1 = 1; AdcRegs.ADCTRL2.bit.INT_ENA_SEQ1 = 1;

EALLOW; GpioCtrlRegs.GPAMUX1.bit.GPIO0 = 0;// LED GpioCtrlRegs.GPADIR.bit.GPIO0 = 1; EDIS;

GpioDataRegs.GPASET.bit.GPIO0 = 1;

EALLOW; GpioCtrlRegs.GPAMUX1.bit.GPIO15 = 0;// XINT1 GpioCtrlRegs.GPADIR.bit.GPIO15 = 0; GpioCtrlRegs.GPAPUD.bit.GPIO15 = 1; GpioCtrlRegs.GPAQSEL1.bit.GPIO15 = 2; GpioCtrlRegs.GPACTRL.bit.QUALPRD1 = 0xFF; EDIS;

EALLOW; GpioIntRegs.GPIOXINT1SEL.bit.GPIOSEL = 15; EDIS;

XIntruptRegs.XINT1CR.bit.POLARITY = 1; XIntruptRegs.XINT1CR.bit.ENABLE = 1;

PieCtrlRegs.PIECTRL.bit.ENPIE = 1; PieCtrlRegs.PIEIER1.bit.INTx6 = 1; PieCtrlRegs.PIEIER1.bit.INTx4 = 1; IER |= M_INT1; EINT;

for(;;);}

interrupt void adc_isr(void){ Result = AdcRegs.ADCRESULT0 >>4;

AdcRegs.ADCTRL2.bit.RST_SEQ1 = 1; AdcRegs.ADCST.bit.INT_SEQ1_CLR = 1; PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;}

interrupt void xint1_isr(void){ GpioDataRegs.GPATOGGLE.bit.GPIO0 = 1;

PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;}

Multiple triggers as sources for the start-of-conversion (SOC) sequence
– S/W – software immediate start
– ePWM 1-6
– GPIO XINT2

Why XINT1 can start ADC (SOC mode)  ???

为啥XINT1也能触发启动ADC

yongwang hou:

回复 Martin Yu:

我已经把程序粘贴到论坛

赞(0)
未经允许不得转载:TI中文支持网 » 28335 ADC-SOC触发启动方式
分享到: 更多 (0)