各位前辈,
指南上说的type3,我看的SOC不是很明白,示例中给的ADC.c中有这么一段程序,
void InitAdcAio()
{
EALLOW;
/* Configure ADC pins using AIO regs*/
// This specifies which of the possible AIO pins will be Analog input pins.
// NOTE: AIO1,3,5,7-9,11,13,15 are analog inputs in all AIOMUX1 configurations.
// Comment out other unwanted lines.
GpioCtrlRegs.AIOMUX1.bit.AIO2 = 2; // Configure AIO2 for A2 (analog input) operation
GpioCtrlRegs.AIOMUX1.bit.AIO4 = 2; // Configure AIO4 for A4 (analog input) operation
GpioCtrlRegs.AIOMUX1.bit.AIO6 = 2; // Configure AIO6 for A6 (analog input) operation
GpioCtrlRegs.AIOMUX1.bit.AIO10 = 2; // Configure AIO10 for B2 (analog input) operation
GpioCtrlRegs.AIOMUX1.bit.AIO12 = 2; // Configure AIO12 for B4 (analog input) operation
GpioCtrlRegs.AIOMUX1.bit.AIO14 = 2; // Configure AIO14 for B6 (analog input) operation
EDIS;
}
其作用是什么呢?
另外,
void AdcChanSelect(Uint16 ch_no)
{
AdcRegs.ADCSOC0CTL.bit.CHSEL= ch_no;
AdcRegs.ADCSOC1CTL.bit.CHSEL= ch_no;
……….
AdcRegs.ADCSOC14CTL.bit.CHSEL= ch_no;
AdcRegs.ADCSOC15CTL.bit.CHSEL= ch_no;
}
这个ch_no是指什么?
user450161651:
第一个问题:
是打开Gpio的Ctrl功能,就是控制寄存器
注释的意思是:配置为AlO 2 A2(模拟输入)操作
第二个问题:ch应该是声明中的Chan的简写,ch_no应该是不打开。
对此不太懂,有点瞎猜的感觉,等待大神来解决吧。
各位前辈,
指南上说的type3,我看的SOC不是很明白,示例中给的ADC.c中有这么一段程序,
void InitAdcAio()
{
EALLOW;
/* Configure ADC pins using AIO regs*/
// This specifies which of the possible AIO pins will be Analog input pins.
// NOTE: AIO1,3,5,7-9,11,13,15 are analog inputs in all AIOMUX1 configurations.
// Comment out other unwanted lines.
GpioCtrlRegs.AIOMUX1.bit.AIO2 = 2; // Configure AIO2 for A2 (analog input) operation
GpioCtrlRegs.AIOMUX1.bit.AIO4 = 2; // Configure AIO4 for A4 (analog input) operation
GpioCtrlRegs.AIOMUX1.bit.AIO6 = 2; // Configure AIO6 for A6 (analog input) operation
GpioCtrlRegs.AIOMUX1.bit.AIO10 = 2; // Configure AIO10 for B2 (analog input) operation
GpioCtrlRegs.AIOMUX1.bit.AIO12 = 2; // Configure AIO12 for B4 (analog input) operation
GpioCtrlRegs.AIOMUX1.bit.AIO14 = 2; // Configure AIO14 for B6 (analog input) operation
EDIS;
}
其作用是什么呢?
另外,
void AdcChanSelect(Uint16 ch_no)
{
AdcRegs.ADCSOC0CTL.bit.CHSEL= ch_no;
AdcRegs.ADCSOC1CTL.bit.CHSEL= ch_no;
……….
AdcRegs.ADCSOC14CTL.bit.CHSEL= ch_no;
AdcRegs.ADCSOC15CTL.bit.CHSEL= ch_no;
}
这个ch_no是指什么?
Jason Wu4:
ch_no就是SOC选择的信号源,具体得看调用这个函数时所赋的实参。
各位前辈,
指南上说的type3,我看的SOC不是很明白,示例中给的ADC.c中有这么一段程序,
void InitAdcAio()
{
EALLOW;
/* Configure ADC pins using AIO regs*/
// This specifies which of the possible AIO pins will be Analog input pins.
// NOTE: AIO1,3,5,7-9,11,13,15 are analog inputs in all AIOMUX1 configurations.
// Comment out other unwanted lines.
GpioCtrlRegs.AIOMUX1.bit.AIO2 = 2; // Configure AIO2 for A2 (analog input) operation
GpioCtrlRegs.AIOMUX1.bit.AIO4 = 2; // Configure AIO4 for A4 (analog input) operation
GpioCtrlRegs.AIOMUX1.bit.AIO6 = 2; // Configure AIO6 for A6 (analog input) operation
GpioCtrlRegs.AIOMUX1.bit.AIO10 = 2; // Configure AIO10 for B2 (analog input) operation
GpioCtrlRegs.AIOMUX1.bit.AIO12 = 2; // Configure AIO12 for B4 (analog input) operation
GpioCtrlRegs.AIOMUX1.bit.AIO14 = 2; // Configure AIO14 for B6 (analog input) operation
EDIS;
}
其作用是什么呢?
另外,
void AdcChanSelect(Uint16 ch_no)
{
AdcRegs.ADCSOC0CTL.bit.CHSEL= ch_no;
AdcRegs.ADCSOC1CTL.bit.CHSEL= ch_no;
……….
AdcRegs.ADCSOC14CTL.bit.CHSEL= ch_no;
AdcRegs.ADCSOC15CTL.bit.CHSEL= ch_no;
}
这个ch_no是指什么?
xiaodong li5:
回复 Jason Wu4:
请问有没有28035的ADC.c的配置例程?看参考指南还是不太明白该做那些配置,比如使用ADCINA0/ADCINA1/ADCINA2分别采样直流母线电压,直流母线电流,相电流IV,这三个配置的时候那些地方需要着重注意呢?
各位前辈,
指南上说的type3,我看的SOC不是很明白,示例中给的ADC.c中有这么一段程序,
void InitAdcAio()
{
EALLOW;
/* Configure ADC pins using AIO regs*/
// This specifies which of the possible AIO pins will be Analog input pins.
// NOTE: AIO1,3,5,7-9,11,13,15 are analog inputs in all AIOMUX1 configurations.
// Comment out other unwanted lines.
GpioCtrlRegs.AIOMUX1.bit.AIO2 = 2; // Configure AIO2 for A2 (analog input) operation
GpioCtrlRegs.AIOMUX1.bit.AIO4 = 2; // Configure AIO4 for A4 (analog input) operation
GpioCtrlRegs.AIOMUX1.bit.AIO6 = 2; // Configure AIO6 for A6 (analog input) operation
GpioCtrlRegs.AIOMUX1.bit.AIO10 = 2; // Configure AIO10 for B2 (analog input) operation
GpioCtrlRegs.AIOMUX1.bit.AIO12 = 2; // Configure AIO12 for B4 (analog input) operation
GpioCtrlRegs.AIOMUX1.bit.AIO14 = 2; // Configure AIO14 for B6 (analog input) operation
EDIS;
}
其作用是什么呢?
另外,
void AdcChanSelect(Uint16 ch_no)
{
AdcRegs.ADCSOC0CTL.bit.CHSEL= ch_no;
AdcRegs.ADCSOC1CTL.bit.CHSEL= ch_no;
……….
AdcRegs.ADCSOC14CTL.bit.CHSEL= ch_no;
AdcRegs.ADCSOC15CTL.bit.CHSEL= ch_no;
}
这个ch_no是指什么?
Hong Liu37:
回复 user450161651:
我的问题是note里说AI01,3…等也是AIOMUX1配置,这个意思是这些IO口只能作为输入配置吗?
各位前辈,
指南上说的type3,我看的SOC不是很明白,示例中给的ADC.c中有这么一段程序,
void InitAdcAio()
{
EALLOW;
/* Configure ADC pins using AIO regs*/
// This specifies which of the possible AIO pins will be Analog input pins.
// NOTE: AIO1,3,5,7-9,11,13,15 are analog inputs in all AIOMUX1 configurations.
// Comment out other unwanted lines.
GpioCtrlRegs.AIOMUX1.bit.AIO2 = 2; // Configure AIO2 for A2 (analog input) operation
GpioCtrlRegs.AIOMUX1.bit.AIO4 = 2; // Configure AIO4 for A4 (analog input) operation
GpioCtrlRegs.AIOMUX1.bit.AIO6 = 2; // Configure AIO6 for A6 (analog input) operation
GpioCtrlRegs.AIOMUX1.bit.AIO10 = 2; // Configure AIO10 for B2 (analog input) operation
GpioCtrlRegs.AIOMUX1.bit.AIO12 = 2; // Configure AIO12 for B4 (analog input) operation
GpioCtrlRegs.AIOMUX1.bit.AIO14 = 2; // Configure AIO14 for B6 (analog input) operation
EDIS;
}
其作用是什么呢?
另外,
void AdcChanSelect(Uint16 ch_no)
{
AdcRegs.ADCSOC0CTL.bit.CHSEL= ch_no;
AdcRegs.ADCSOC1CTL.bit.CHSEL= ch_no;
……….
AdcRegs.ADCSOC14CTL.bit.CHSEL= ch_no;
AdcRegs.ADCSOC15CTL.bit.CHSEL= ch_no;
}
这个ch_no是指什么?
Jason Wu4:
回复 xiaodong li5:
安装controlSUITE,如下安装路径就有ADCdemo工程