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)  ???

yongwang hou:

手册说,仅GPIO XINT2能够启动,不知道为啥

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)  ???

Eric Ma:

回复 yongwang hou:

你的疑问是什么?

手册上是写可以由触发XINT2外部中断的GPIO信号来触发ADC信号,有什么问题吗?

ERIC

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)  ???

yongwang hou:

回复 Eric Ma:

手册没有说,XINT1也能触发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)  ???

Eric Ma:

回复 yongwang hou:

你用XINT1触发了SOC??

那你ADC SOC的触发源怎么配置的啊?

ERIC

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)  ???

yongwang hou:

回复 Eric Ma:

ADC外部中断触发启动

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

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)  ???

yongwang hou:

回复 Eric Ma:

完整程序:

#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;// ADCINA0AdcRegs.ADCTRL2.bit.EXT_SOC_SEQ1 = 1;AdcRegs.ADCTRL2.bit.INT_ENA_SEQ1 = 1;

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

GpioDataRegs.GPASET.bit.GPIO0 = 1;

EALLOW;GpioCtrlRegs.GPAMUX1.bit.GPIO15 = 0;// XINT1GpioCtrlRegs.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;}

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