看2812与28335的Datasheet,写的好几个地方都有矛盾。
2812的AD采样最快频率是25MHz吗?
28335的AD采样最快频率是12.5MHz吗?
是不是2812的AD采样速率比28335块?
是不是2812的采样带宽同样比28335快?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
看2812与28335的Datasheet,写的好几个地方都有矛盾。
2812的AD采样最快频率是25MHz吗?
28335的AD采样最快频率是12.5MHz吗?
是不是2812的AD采样速率比28335块?
是不是2812的采样带宽同样比28335快?
AD初始化代码如下:
void ADReal_init(void)
{
EALLOW;
SysCtrlRegs.PCLKCR0.bit.ADCENCLK = 1;
ADC_cal();
EDIS;
AdcRegs.ADCTRL3.all = 0x00E0; // Power up bandgap/reference/ADC circuits
DELAY_US(5000L); // Delay before converting ADC channels
AdcRegs.ADCTRL1.bit.ACQ_PS = 0x0;
AdcRegs.ADCTRL3.bit.ADCCLKPS = 1;
AdcRegs.ADCTRL3.bit.SMODE_SEL = 0;
AdcRegs.ADCTRL1.bit.SEQ_CASC = 0;
AdcRegs.ADCCHSELSEQ1.bit.CONV00 = 0x0;
AdcRegs.ADCTRL1.bit.CONT_RUN = 1;
AdcRegs.ADCTRL1.bit.SEQ_OVRD = 0;
AdcRegs.ADCMAXCONV.bit.MAX_CONV1 = 0; //Max Conv
AdcRegs.ADCMAXCONV.bit.MAX_CONV2 = 0; //Max Conv
AdcRegs.ADCCHSELSEQ1.all = 0x3210;
AdcRegs.ADCCHSELSEQ2.all = 0x7654;
AdcRegs.ADCCHSELSEQ3.all = 0xBA98;
AdcRegs.ADCCHSELSEQ4.all = 0xFEDC;
}
Main函数代码如下:
void main(void)
{
InitSysCtrl();
EALLOW;
SysCtrlRegs.HISPCP.all = 0x0003;
EDIS;
DINT;
InitPieCtrl();
IER = 0x0000;
IFR = 0x0000;
InitPieVectTable();
EALLOW;
PieVectTable.TINT0 = &CPU_timer0_isr;
EDIS;
InitCpuTimers();
// 150MHz CPU Freq, 1 second Period (in uSeconds 1000000)
ConfigCpuTimer(&CpuTimer0, 150, 100);
PieCtrlRegs.PIEIER1.bit.INTx7 = M_INT1;
EnableInterrupts();
// Step 3. Initialize all the Device Peripherals:
Adreal_init();
IER = M_INT1;
AdcRegs.ADCTRL2.all = 0x2000;
CpuTimer0Regs.TCR.all = 0x4001;
for(;;)
{
while(AdcRegs.ADCST.bit.INT_SEQ1 == 0){}
AdcRegs.ADCST.bit.INT_SEQ1_CLR = 1;
Point++;
}
}
CPUTIMER0中断如下:
interrupt void CPU_timer0_isr(void)
{
State[i++] = Point;
Point = 0;
if(i>=99)
i = 0;
// Acknowledge this interrupt to receive more interrupts from group 1
PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;
}
程序是RAM调试程序,直接在RAM中运行的,请帮助看看程序是否有问题?测试出来的结果数组中基本都是61或62.
LZ你这里设置的有点乱呀,我这里有一个HELLODSP的例程,这个可以实现,你参考研究一下吧,大家共同学习,我已经下面个哥们QQ,大家有机会多交流一下。