Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
NeDh_4602711
Level 5
Level 5
5 solutions authored First solution authored 50 replies posted

Hello,

I want to confirm whether it is the right way forward to do so. I will be using a CR2032 coin cell or 3.7V 500mAh (regulator AMS1117 3.3) battery. I have given terminal of a battery to P3[5] pin directly without using any resistor and I am getting the correct value for battery voltage. My anxiety is that whether this method is correct or not? it should not be like it will consume more battery than usual due to this connection.

pastedImage_2.png

pastedImage_5.png

pastedImage_6.png

pastedImage_4.png

0 Likes
1 Solution
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

NeDh,

The SAR input resistance is 2.2K ohms.   This means when the SAR is sequencing to Battery input, it will draw about 3/2.2K = 1.4mA when sampling this input.   Therefore, minimize when this input is read.

You have the VDDA as your reference source.  I'm assuming that Battery is the source of VDDA.  This means that your ADC measurement will be at or near the maximum ADC count.  This is because the input is a ratio of your Vref.  Since VDDA = Battery then (input/VDDA)*((1<<12)-1) = (Battery/Battery)*(4095) = 4095.

To avoid this, use a Bandgap Vref as your reference.  This will be mostly immune to changes in VDDA.

There is a Low Voltage Detect (LVD) circuit in the PSoC.  This circuit is basically a comparator with a selectable voltage threshold.  It is intended to quickly (because it is constantly on) detect if VDDD drops below the set threshold.  The result can be polled or an interrupt can be launched if VDDD drops below the selected threshold.

This circuit is constantly ON and the input resistance is ~1M ohms or higher.   Will the LVD work better for you?

Len

Len
"Engineering is an Art. The Art of Compromise."

View solution in original post

0 Likes
1 Reply
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

NeDh,

The SAR input resistance is 2.2K ohms.   This means when the SAR is sequencing to Battery input, it will draw about 3/2.2K = 1.4mA when sampling this input.   Therefore, minimize when this input is read.

You have the VDDA as your reference source.  I'm assuming that Battery is the source of VDDA.  This means that your ADC measurement will be at or near the maximum ADC count.  This is because the input is a ratio of your Vref.  Since VDDA = Battery then (input/VDDA)*((1<<12)-1) = (Battery/Battery)*(4095) = 4095.

To avoid this, use a Bandgap Vref as your reference.  This will be mostly immune to changes in VDDA.

There is a Low Voltage Detect (LVD) circuit in the PSoC.  This circuit is basically a comparator with a selectable voltage threshold.  It is intended to quickly (because it is constantly on) detect if VDDD drops below the set threshold.  The result can be polled or an interrupt can be launched if VDDD drops below the selected threshold.

This circuit is constantly ON and the input resistance is ~1M ohms or higher.   Will the LVD work better for you?

Len

Len
"Engineering is an Art. The Art of Compromise."
0 Likes