The window that the IDE shows when you click on Peripherals -> Analog/Digital Converter doesn't seem to control the checkboxes properly for the Channel Status register bits ADC_CHSR[7:0]. I'm using an ATMEL AT91SAM7S32, and in my ADC init function I write 0xFF to the ADC_CHSR register, which should enable all 8 A/D channels to be A/D inputs. But... only the checkboxes in the ADC window associated with ADC_CHSR[3:0] get checked. I changed the code to:
ADC_CHSR = 1 << 0; ADC_CHSR = 1 << 1; ADC_CHSR = 1 << 2; ADC_CHSR = 1 << 3; ADC_CHSR = 1 << 4; ADC_CHSR = 1 << 5; ADC_CHSR = 1 << 6; ADC_CHSR = 1 << 7;
Also, the checkboxes associated with the ADC's status register don't seem to change as you step through the ADC's ISR. However, if I use "run to cursor", and run to the last statement in the ISR, the status register checkboxes do appear to show correct, valid info (i.e., the CH[7:0] bits get cleared). For example, consider the following code in the ADC ISR for the case when all 8 A/D channels are enabled and have current, valid conversion results in them (i.e., the conversion results have not been read yet).
volatile unsigned int status; volatile unsigned int result; status = ADC_SR; result = ADC_CDR0; status = ADC_SR; result = ADC_CDR1; status = ADC_SR; result = ADC_CDR2; status = ADC_SR; result = ADC_CDR3; status = ADC_SR; result = ADC_CDR4; status = ADC_SR; result = ADC_CDR5; status = ADC_SR; result = ADC_CDR6; status = ADC_SR; result = ADC_CDR7;