Other Parts Discussed in Thread: HALCOGEN
We are attempting to convert 24 channels using Group1 using Advanced Conversion Group.
We have previously been able to read some values in single trigger mode.
This is a polled system, with no interrupts or DMA involved.
The MCU is up running many other peripherals. HalCoGen used for the bare minimum, the rest is hand-coded assembler, since we need to save code size and execution time.
The main issue is that after initialization and starting conversion by setting the lowest 24 bits in ADG1SEL, conversion does not start, and the ADSMSTATE register shows 0x0A, which the Lauterback Trace32 interprets as 'Wait_sw1'. What could be the reason?
My initialization sequence is:
ADRSTCR = 1 // start reset
wait 100us
ADRSTCR = 0 //bring ADC out of reset
Initialize the LUT table at 0xFF3F2080 (Grp1 section) with values 0-23 in proprietary order - debugger shows they get there correctly
ADOPMODECR = 0x80000001 // select 12-bit and enable ADC (also tried to wait with enabling to later)
ADCLOCKCR = 3 // VCLK is 96 MHZ, divided by (3+1) = 24 MHz ADCLK - also tried much lower clocks
ADG1MODECR = 0x10012 //Continuous conv.mode, Ignore buf.overwrite, NoAutoBufferReset
ADG1SAMP = 22 // Grp1 conversion time = (22+2) ADCLK = 1 us
ADBNDCR = 0x0C000C // allocate (2 * 12) = 24 buffers for Event and Grp1 in result RAM (have also tried higher)
ADBNDEND = 2 // total buffers = 64 (maximum)
ADG1CHNSELMODECTRL = 0x0A // enable Enhanced Channel Selection mode for Grp1
ADG1CURRCOUNT = 0
ADG1MAXCOUNT = 23
(optionally ADOPMODECR = 0x80000001 if no enable at the beginning, see above)
And then write 0x00FFFFFF to ADG1SR to start conversion (set 24 bits).
Observations:
- ADG1SR = 0x0C meaning: Empty, Not completed, Busy, Not frozen
- ADG1CURRCOUNT stays at zero (according to the debugger)
- ADSMSTATE = 0x0A
When reading results via the FIFO, the high bit for Under-run is set for every value.
Also when reading result RAM directly, no visible changes seem to occur.
So what reasons could prevent the ADC from starting sampling ????
Also: Where can we find more information on the ADSMSTATE values - mentioned as 'Reserved for TI debug' in the TRM?
Kind Regards
Niels