This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ADC Peripheral Debug Window and ADC_CHSR[7:0]

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;

and stepped through it with the debugger. I expected to see those 8 checkboxes get checked, one at a time, since the code was enabling 1 channel and disabling the other 7 at each 'C' statement.

Instead of that I got channels 0 - 3 to get checked one by one, with nothing happening for channels 4 - 7, ending up with the first 4 channels checked, like before.

Anyone know why all 8 channels don't seem to work (i.e., be able to be checked), or why disabling a channel doesn't seem to clear the associated checkbox?

0