28335的AD如何配置呀 我从例程ADC的程序把通道ADCIN0 改成到了ADCIN1后 没有转化数据出现,如何做
InitAdc(); // For this example, init the ADC
// Specific ADC setup for this example:
AdcRegs.ADCTRL1.bit.ACQ_PS = ADC_SHCLK; // Sequential mode: Sample rate = 1/[(2+ACQ_PS)*ADC clock in ns]
// = 1/(3*40ns) =8.3MHz (for 150 MHz SYSCLKOUT)
// = 1/(3*80ns) =4.17MHz (for 100 MHz SYSCLKOUT)
// If Simultaneous mode enabled: Sample rate = 1/[(3+ACQ_PS)*ADC clock in ns]
AdcRegs.ADCTRL3.bit.ADCCLKPS = ADC_CKPS;
AdcRegs.ADCTRL1.bit.SEQ_CASC = 1; // 1 Cascaded mode
AdcRegs.ADCTRL1.bit.CONT_RUN = 1; // Setup continuous run
// AdcRegs.ADCTRL1.bit.ADCBSYCHN =
AdcRegs.ADCTRL1.bit.SEQ_OVRD = 1; // Enable Sequencer override feature
AdcRegs.ADCCHSELSEQ1.bit.CONV01 = 0x01;
AdcRegs.ADCCHSELSEQ2.all = 0x0;
AdcRegs.ADCCHSELSEQ3.all = 0x0;
AdcRegs.ADCCHSELSEQ4.all = 0x0;
AdcRegs.ADCMAXCONV.bit.MAX_CONV1 = 0x1;
AdcRegs.ADCTRL2.all = 0x2000;
scic_fifo_init(); // Initialize the SCI FIFO
scic_echoback_init(); // Initalize SCI for echoback
msg = "\r\n\n\nHello World!\0";
scic_msg(msg);
msg = "\r\nIf you change the ADC Res,we will give you the value! \n\0";
scic_msg(msg);
// Enable global Interrupts and higher priority real-time debug events:
//EINT; // Enable Global interrupt INTM
// ERTM; // Enable Global realtime interrupt DBGM
i = 0;
for(; ;)
{
// LED_pulse();
PM2_5_reg = ~0x40;
DELAY_US(260);
while(AdcRegs.ADCST.bit.INT_SEQ1 == 0);
AdcRegs.ADCST.bit.INT_SEQ1_CLR = 1;
ADCValue[0] = ( (AdcRegs.ADCRESULT0) >>4);
PMvalue = ADCValue[0];
// PMvalue = ((double)PMvalue /4096) *3*3/2;
// PMvalue = (PMvalue-0.0356)*120000 * 0.127 -0.0999;
sprintf(cbuf,"tne PM2.5 is %d\n",ADCValue[0]);
DELAY_US(20);
PM2_5_reg = 0x40;
DELAY_US(9680);
DELAY_US(200000);
scic_msg(cbuf); |