Skip to main content
JPurd.2
Associate
March 12, 2021
Question

Is there an easy way to read more than one analog input?

  • March 12, 2021
  • 3 replies
  • 1128 views

Hope all of you are well:

Using the BlueNRG-232: I'm trying to figure out how to read 2 of the analog inputs. Ideally, I'd like to read both analog inputs and the battery voltage. It appears the only way to do this is set the ADC up to read only one. I've attempted polling for a period time, then re-initialize to read another input, but that seems to cause issues. I'm trying to use the SDK and have tried different combinations of ADC_DeInit, and reinitializing. Also, I'm using DMA - but the DMA portion seems to be working fine.

Am I missing something? Is there an easier way to read more than on analog signal with this device?

    This topic has been closed for replies.

    3 replies

    Uwe Bonnes
    Chief
    March 12, 2021

    I do so by having injected channels additional to the normal channel. With each start, normal and injected channels are read sequential

    JPurd.2
    JPurd.2Author
    Associate
    March 12, 2021

    @Uwe Bonnes​ you've done this on a BlueNRG2 device? I've done it often in STM32 devices (using CubeMX ), but I'm not seeing how to change the ADC channel the DMA is looking at. The Spec Sheet for the BlueNRG doesn't mention interleaving or injected channels.

    Uwe Bonnes
    Chief
    March 12, 2021

    Sorry, I thought that the BlueNRG is some STM32 in disguise...

    JPurd.2
    JPurd.2Author
    Associate
    March 12, 2021

    No I'm afraid it's not. Would have been really nice - I'm very familiar with STM32.