2017-01-25 07:07 AM
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,
Richard
2017-01-25 12:43 PM
Does changing the sampling time influence the readout value?
JW
2017-01-26 05:17 AM
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=false2017-01-26 10:33 AM
No, I meant sampling time as set in ADC_CR2.SMTP1 and/or ADC_CR3.SMTP2.
JW
PS. See also AN3137
2017-01-31 06:30 AM
Brilliant thanks for your help!