This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RM46L852: ADC will not start. ADSMSTATE = 0x0A, 'Wait_sw1' Meaning?

Part Number: RM46L852
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

  • Hi Niels,

    ADSMSTATE = 0xA indicates that a conversion was started but the analog-to-digital converter core never completed the conversion. Can you check if the ADREFHI / ADREFLO and VCCAD / VSSAD connections are okay?

    One other tip is to enable the AWM1_EXT_ENA and AWM1_EXT_SELx outputs on to the assigned device pins. These signals can be used to indicate when the internal ADC sampling is enabled. So if the ADC is converting successive channels, you will see these signals toggle (depending on your configuration of the EXT_CHANNEL).

    Regards,
    Sunil
  • Hi Sunil,

    You were right that there were problems with the hardware supply and related signals on the PCBs.
    And then - very suitable for a safety controller - it stopped working instead of just returning garbage data (as I had expected).

    So lesson learned, also for others who might read this: Implement a time-out when waiting for the ADC conversion to complete - also during initialization. And if a time-out occurs, flag it as a unique hardware error for the user and/or service people to be informed and check the four signals you mention.

    Regards,
    Niels