AdcRegs.ADCMAXCONV.bit.MAX_CONV1 = 0x7; // convert and store in 8 results registers
AdcRegs.ADCMAXCONV.bit.MAX_CONV2 = 0x3;
本人新手,求高手解答为什么这样编写语句第二条语句会无效呢???
// Start SEQ1
AdcRegs.ADCTRL2.all = 0x2000;//软件触发SOC
// AdcRegs.ADCTRL2.all = 0x0020;
for(;;)
{ // Take ADC data and log them in SampleTable array
// Initalize the array index. This points to the current
// location within the SampleTable
array_index = 0;
for (i=0; i<(BUF_SIZE/16); i++)
{
// Wait for int1
while (AdcRegs.ADCST.bit.INT_SEQ1== 0){}
// while (AdcRegs.ADCST.bit.INT_SEQ1== 1){}
GpioDataRegs.GPBSET.bit.GPIO34 = 1; // Set GPIO34 for monitoring -optional
#if POST_SHIFT
// For post shifting, shift the ADC results
// in the SampleTable buffer after the buffer is full.
for (i=0; i<BUF_SIZE; i++)
{
SampleTable = ((SampleTable) >>4);
}
#endif // -- POST_SHIFT
AdcRegs.ADCTRL2.bit.RST_SEQ2 = 1; ////////////////////////////////////////////////////////////////////
GpioDataRegs.GPBCLEAR.bit.GPIO34 = 1; // Clear GPIO34 for monitoring -optional
}
// Start SEQ1
AdcRegs.ADCTRL2.all = 0x2000;//软件触发SOC
// AdcRegs.ADCTRL2.all = 0x0020;
for(;;)
{ // Take ADC data and log them in SampleTable array
// Initalize the array index. This points to the current
// location within the SampleTable
array_index = 0;
for (i=0; i<(BUF_SIZE/16); i++)
{
// Wait for int1
while (AdcRegs.ADCST.bit.INT_SEQ1== 0){}
// while (AdcRegs.ADCST.bit.INT_SEQ1== 1){}
GpioDataRegs.GPBSET.bit.GPIO34 = 1; // Set GPIO34 for monitoring -optional
#if POST_SHIFT
// For post shifting, shift the ADC results
// in the SampleTable buffer after the buffer is full.
for (i=0; i<BUF_SIZE; i++)
{
SampleTable = ((SampleTable) >>4);
}
#endif // -- POST_SHIFT
AdcRegs.ADCTRL2.bit.RST_SEQ2 = 1; ////////////////////////////////////////////////////////////////////
GpioDataRegs.GPBCLEAR.bit.GPIO34 = 1; // Clear GPIO34 for monitoring -optional
}