I am having problems with using AIN6-AIN9 as ADC inputs on the ADuC7061.
My register setup is as per the datasheet - is there something I am missing?
Check the startup file for the following code:
MVN r0,#0xFB MOV r0,r0,lsl #0x08 MOV r5,#0x08 STR r5,[r0,#0x50] mov r5,#0x1 <---------------- This line must be set to 1 for 32-pin mode
STR r5,[r0,#0x54] MOV r5,#0x29 STR r5,[r0,#0x58]
IMPORT __main LDR R0, =__main BX R0 ; Branch to Main
To explain what the code does...
An internal configuration register is located at 0xFFFF0454.
It is a keyed register hence the register at address 0xFFFF0450 must be set to 0x8 before writing to it and the register at address 0xFFFF0458 must be set to 0x29 after to complete the write to 0xFFFF0454
Bit 0 of this register is all this is relevant:
When bit0 =0, The part is configured for 48-pin mode. (ADuC7060)
When bit0 =1, The part is configured for 32-pin mode. (ADuC7061)
Retrieving data ...