Skip to main content
Visitor II
January 25, 2017
Question

STM8L ADC Input drawing current

  • January 25, 2017
  • 2 replies
  • 1175 views
Posted on January 25, 2017 at 16:07

I’m using the STM8L052r8 to measure temperatures on the ADC channels 24/25. I’m using a proven ADC routine but my expected counts aren’t coming in correct.

It seems I've got a volt drop/ current flow across R1 on the input to the ADC pin.

Could anyone tell me what internal resistance there is in the micro from the ADC input to ground please, and the kind of current I can expect to be flowing there.

I have the ADC pins configured as input floating, with the Schmitt trigger disabled.

The temperature probe is connected across THP1 and THM1. R2 is the drive resistor 9k09, R2 is a 1k in series with the ADC input.

Really simple I bet but I'm pretty new to this.

Thanks in advance,

Richard0690X00000603ZhQAI.jpg

    This topic has been closed for replies.

    2 replies

    Super User
    January 25, 2017
    Posted on January 25, 2017 at 21:43

    Does changing the sampling time influence the readout value?

    JW

    Visitor II
    January 26, 2017
    Posted on January 26, 2017 at 13:17

    Hi,

    Yes it does change the readings. I did have my SYSCLK running at 16MHz but have now reduced that to 4MHz and the readings seem almost perfect.

    It seems that the only option to adjust the ADC clock is to presale the SYSCLK, but it only allows you to divide by 1 or 2.

    Is there a way to run my ADC at 4MHz and keep the SYSCLK at 16MHz please?

    Regards,

    Richard

    ________________

    Attachments :

    image001.jpg : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hylr&d=%2Fa%2F0X0000000bEd%2FEj4hlF_Be7PFkDzP39kgDGkNdnAAs_p06xoa2_AmKgY&asPdf=false
    Super User
    January 26, 2017
    Posted on January 26, 2017 at 18:33

    No, I meant sampling time as set in ADC_CR2.SMTP1 and/or ADC_CR3.SMTP2.

    JW

    PS. See also AN3137

    Visitor II
    January 31, 2017
    Posted on January 31, 2017 at 15:30

    Brilliant thanks for your help!