[MCU] 请教28035 AD 顺序采样

[复制链接]
847|8
 楼主| 两只袜子 发表于 2020-11-5 09:50 | 显示全部楼层 |阅读模式
AD, ADC, dc, SOC, se

28035,开发板示例代码采用同步采样方式,我改成顺序采样,结果不进入中断服务子程序,这个问题已经折磨我好几天了,请大神们看一下。代码如下:
void Motor_ADC_Config(void)
{

   InitAdc();  // For this example, init the ADC

   EALLOW;  // This is needed to write to EALLOW protected register
   PieVectTable.ADCINT1 = &adc_isr;
   EDIS;    // This is needed to disable write to EALLOW protected registers

   PieCtrlRegs.PIEIER1.bit.INTx1 = 1;        // Enable INT 1.1 in the PIE
   IER |= M_INT1;                                                 // Enable CPU Interrupt 1

// Configure ADC
        EALLOW;
        AdcRegs.ADCCTL1.bit.ADCREFSEL        = 0;    //REF Int
        AdcRegs.ADCCTL1.bit.INTPULSEPOS        = 1;        //ADCINT1 trips after AdcResults latch
        AdcRegs.INTSEL1N2.bit.INT1E     = 1;        //Enabled ADCINT1
        AdcRegs.INTSEL1N2.bit.INT1CONT  = 0;        //Disable ADCINT1 Continuous mode,single conversion mode

        AdcRegs.INTSEL1N2.bit.INT1SEL        = 1;        //setup EOC1 to trigger ADCINT1 to fire , EOC1 is trigger for ADCINTx


//Sequential sampling enable for SOC0/SOC1
        AdcRegs.ADCSAMPLEMODE.bit.SIMULEN0 = 0;        //SOC0/1 Sequential Sampling Enable        ,SOC0与SOC1独立工作
        AdcRegs.ADCSOC0CTL.bit.CHSEL         = 0;        //SOC0 ,配置模拟通道连接
        AdcRegs.ADCSOC1CTL.bit.CHSEL         = 8;        //SOC1 ,配置模拟通道连接

        //AdcRegs.ADCSAMPLEMODE.bit.SIMULEN0=1;        //SOC0与SOC1
        //AdcRegs.ADCSOC0CTL.bit.CHSEL         = 0;        //SOC0 ,配置模拟通道连接
        //AdcRegs.ADCSOC1CTL.bit.CHSEL         = 1;        //SOC1 ,配置模拟通道连接

        AdcRegs.ADCSOC0CTL.bit.TRIGSEL         = 0x00;    //ADCTRIG0- Software only
        AdcRegs.ADCSOC1CTL.bit.TRIGSEL         = 0x00;

        AdcRegs.ADCSOC0CTL.bit.ACQPS         = 6;
        AdcRegs.ADCSOC1CTL.bit.ACQPS         = 6;        //set SOC0 S/H Window to 7 ADC Clock Cycles, (6 ACQPS plus 1)

        EDIS;
}



//-------------------------------------------------------------------------
//AD 中断处理函数
//
//##########################################################################
interrupt void  adc_isr(void)
{
        EALLOW;
        PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;   // Acknowledge interrupt to PIE
        EDIS;

        AdcRegs.ADCINT**CLR.bit.ADCINT1 = 1;                //Clear ADCINT1 flag reinitialize for next SOC
}
zhangmangui 发表于 2020-11-9 23:37 | 显示全部楼层
顺序采样的某个寄存器没配对  和并行采样比较只需改几个寄存器
zhangmangui 发表于 2020-11-9 23:37 | 显示全部楼层
下载controlSUITE了吗
zhangmangui 发表于 2020-11-9 23:38 | 显示全部楼层
还有c2000ware
八层楼 发表于 2020-12-2 14:37 | 显示全部楼层
寄存器如何进行配对呢
观海 发表于 2020-12-2 14:40 | 显示全部楼层
这个是什么系列的芯片啊
guanjiaer 发表于 2020-12-2 14:41 | 显示全部楼层
controlSUITE 这个是啥工具啊
heimaojingzhang 发表于 2020-12-2 14:43 | 显示全部楼层
一直没有显示转换完成是吗
keaibukelian 发表于 2020-12-2 14:44 | 显示全部楼层
先用一个通道试试看
您需要登录后才可以回帖 登录 | 注册

本版积分规则

2122

主题

8121

帖子

11

粉丝
快速回复 在线客服 返回列表 返回顶部