Searching \ for 'pic12c508/9' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: 'pic12c508/9'.

Truncated match.
PICList Thread
'pic12c508/9'
1999\09\08@175231 by Kev Howard

picon face
Hello !
Pics are a whole new world after designing analogue circuits for 20
years!...but I am learning fast!

Can anyone help with this?

I need to detect an "analogue" low signal (low battery warning!) on gpio,3
with weak pullup enabled and wake up enabled, I could use an external schmitt
trigger but that would defeat the object of the pic!
I have tried a pot as a potential divider but the pic doesnt seem to like the
slow rate of change? Schmitt trigger in programming mode only? should I call
a delay when checking  gpio,3?

Any help appreciated!

Kev

1999\09\09@102850 by Bjarne Nebelong

flavicon
face
Kev wrote:

>I need to detect an "analogue" low signal (low battery warning!) on gpio,3
>with weak pullup enabled and wake up enabled, I could use an external
schmitt
>trigger but that would defeat the object of the pic!
>I have tried a pot as a potential divider but the pic doesnt seem to like
the
>slow rate of change? Schmitt trigger in programming mode only? should I
call
>a delay when checking  gpio,3?

If you do it with a 12C671, you could use the AD section


HŠlsningar/ Regards,
Bjarne Nebelong
Manager Electrical Design
BINDOMATIC¨
spam_OUTbjarne.nebelongTakeThisOuTspambindomatic.se
+46-(0)8 709 58 46

1999\09\09@112344 by Michael Rigby-Jones

flavicon
face
We need more details.  Are you trying to measure the voltage of the battery
that you are powering the PIC with? Are you regulating the voltage to the
PIC?  If not this scheme won't work because the switching points of the
Schmitt trigger are referenced to Vdd.  As the battery voltage falls, so
will the switching voltage of the Schmitt trigger.

You need to compare the battery voltage to a stable reference, e.g Zener
diode.

Regards

Mike Rigby-Jones

> {Original Message removed}

1999\09\09@143345 by Kev Howard

picon face
Bjarne, Thanks for the tip, but was hoping to do it with the 12c508

Regards

Kev

1999\09\09@143355 by Kev Howard

picon face
Hello mike

Thank you for the reply,

I am measuring the battery (9v) and the PIC is regulated at 5v

Regards

Kev

1999\09\09@145913 by eplus1

flavicon
face
<BLOCKQUOTE AUTHOR="Kev Howard">
I have tried a pot as a potential divider but the pic doesn't seem to like
the
slow rate of change?
</BLOCKQUOTE>

I'm curious as to what you mean here. Did you get false triggering? If you
attach a pot directly from the batter Vpp to Gnd with the center tap leading
to the PIC pin and adjust the POT until the PIC just reads a 0 with a
battery that discharged to 5V plus the dropout voltage of the regulator
(minimum operational voltage), it should read a 1 with a new battery (and
the center tap hopefully will not produce more than 5V with the new
battery!) and read 0 when the power is about to go. If you get false
triggering, the problem is probably supply fluctuation or noise (especially
if the pot is a very high ohmage) and you will need a capacitor from center
tap to ground or will need to read the pin x times to verify that you never
read a 1 before you can be confident that the power is really low.

James Newton, webmaster http://get.to/techref
(hint: you can add your own private info to the techref)
.....jamesnewtonKILLspamspam@spam@geocities.com
1-619-652-0593 phone



{Original Message removed}

1999\09\09@154721 by Quentin

flavicon
face
Kev
I take it you want to measure the 9V battery and give a warning before
the battery gets to low to drive the PIC (below 5V)?
Try what we in the R/C world call BEC (Battery Elimination Circuit). We
use it to still power our reciever and servos while switching the
electric motors off to save power.
Have a look at this circuit:
http://home.hiwaay.net/~mjn/sch.gif
Look at R3, Q1, R1, R2 and U1
While the battery voltage is higher than 5V, Q1 will keep GPIO3 high,
but if the battery drops to 5V and lower, Q1 will switch off and GPIO3
goes low.

Hope this helps
Quentin

1999\09\09@161659 by Kev Howard

picon face
Quentin
   Thanks for that snippet of info!

On a different theme, Ive been building  a model of "Calypso" for the past 4
years...as time permits!

Regards

Kev

1999\09\09@161707 by l.allen

picon face
> > >I need to detect an "analogue" low signal (low battery warning!) on
> > gpio,3
The standard way is to potential divide the 9volt supply to a safe
range(5v or less), this can be 1Meg to 9v and 470k to gnd. A cap is
connected to ground(say 100nF) and the port pin, with maybe a series
resistor to the PIC for protection (180ohm) . Make the port an output
with a 0 on it, this will discharge the capacitor, make the port an
input now and measure the time until the pin goes high. This time is
a representation of the voltage.

_____________________________

Lance Allen
Technical Officer
Uni of Auckland
Psych Dept
New Zealand
_____________________________

1999\09\09@170558 by Eisermann, Phil [Ridg/CO]

flavicon
face
[snip]

> Have a look at this circuit:
> http://home.hiwaay.net/~mjn/sch.gif
> Look at R3, Q1, R1, R2 and U1
> While the battery voltage is higher than 5V, Q1 will keep GPIO3 high,
> but if the battery drops to 5V and lower, Q1 will switch off and GPIO3
> goes low.
>
neat,  if you're using a low drop out regulator. An alternative is to
use a circuit similar to the brown-out detector shown in the
datasheet (and similar to the above link):

       +Vbat
          |
    R1    +5V
    R1     |
    R1     |
    |      e
    *-----b Q1 (PNP)
    |      c
    |      |
    R2      *----> to PIC (or transistor inverter)
    R2     R3
    R2     R3
    |      R3
    |      |
       GND       GND

it works by keeping the Vbe junction reverse-biased until the
battery voltage falls below a certain threshold (eg PIC sees
a '0'). With R1 ~22k and R2 ~33k, Q1 starts conducting at
~7V (slightly above). The PIC then sees a '1'. reducing R1
will delay the turn-on point. Of course, using a zener as
a reference would give you a more predictable switching
point. or you could go way out and use a comparator :)
but it doesn't sound like that's what the original poster
was looking for....

only problem with Kev's particular application is that he's
using GP3; I'm assuming it's configured as /MCLR? If so,
i guess you could add a transistor-inverter. Or redo
the ciruit to use a NPN (and active-high logic).

I am still not sure what the problem was with the original
voltage divider. Is it not switching at a repeatable point?
Is it noise?

I guess it also makes a difference if you're doing this as
a hobby-type project, or for production.

1999\09\09@185904 by Andre Abelian

picon face
Quentin,

In the schematic I do not understand the purpose of Q1
I will appreciate if some one can  explain it.

Andre




{Quote hidden}

1999\09\09@191534 by J Nagy

flavicon
face
Kev Howard wrote:
>

>I have tried a pot as a potential divider but the pic doesnt seem to like the
>slow rate of change? Schmitt trigger in programming mode only? should I call
>a delay when checking  gpio,3?
>

Kev:
       GP3 is a standard CMOS logic input pin when not in programming
mode. The only schmitt trigger input is GP2.


       Jim Nagy
       Elm Electronics
 ICs for Experimenters
http://www.elmelectronics.com/

1999\09\10@070025 by Quentin

flavicon
face
Andre Abelian wrote:
>
> Quentin,
>
> In the schematic I do not understand the purpose of Q1
> I will appreciate if some one can  explain it.
>
> Andre
I should have included this in my last email as well, as it is not my
design:
http://home.hiwaay.net/~mjn/theory.htm
The first paragraph will explain to you how it works.

Quentin

1999\09\10@085646 by V sml
picon face
Hi Kev,

Speaking as a SX chips user, I'm not sure can pic12c508/9 does that:

1. set the pin as output with no pullup, and set it low
2. change the pin to input, and read it

The time it takes to charge the line high again will indicate the
level of your supply voltage.  Check the spec. of your chip to see if
diode is needed for protection.  And you might need extra capacitance
if the chip is not fast enough to detect the rise time of the inherent
capacitance.

Ling SM
sm.lingspamKILLspamcmpmail.com
http://www.i-pal.com (ready in a week time)

>I need to detect an "analogue" low signal (low battery warning!) on
gpio,3
with weak pullup enabled and wake up enabled, I could use an external
schmitt trigger but that would defeat the object of the pic!
I have tried a pot as a potential divider but the pic doesnt seem to
like
the slow rate of change? Schmitt trigger in programming mode only?
should I call a delay when checking  gpio,3?

More... (looser matching)
- Last day of these posts
- In 1999 , 2000 only
- Today
- New search...