Searching \ for 'Vref on PIC 16C74' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/microchip/devices.htm?key=16C
Search entire site for: 'Vref on PIC 16C74'.

Truncated match.
PICList Thread
'Vref on PIC 16C74'
2000\04\05@115237 by Paul Howell

flavicon
face
Hi -

I'm new to the PICLIST too, so thanks in advance for the help.

I am building a programmable high voltage power supply. It charges a
capacitor bank that discharges through flash tube (pretty ordinary stuff).
What is a little different is that the output must be confined to
(logarithmically) equal discrete steps. It works by sensing the voltage
output (through a divider) from the power supply compared to a setpoint
(from a look-up table) and altering the duty cycle of the power supply to
meet the setpoint (hexfet type of approach).  There are only 12 steps, and
the accuracy and frequency requirements are such that the internal 8 bit A/D
is adequate to the task of sensing the divider voltage.

Everything works just fine, but here's my problem that I thought would be
simple. The A/D supposedly has two ways of taking a reference voltage
depending on how the register ADCON1 is set. The Vref can either be taken
from Vdd, or taken from whatever external voltage is applied to RA3.
Naturally, I would like to apply a nice, stable Vref rather than taking Vdd
which may (and does) droop internally. Unfortunately, setting the Vref
either way seems to make little, if any difference.

I am using a PIC16C74A. I have checked and re-checked my settings. They are
as follows: RA0 - RA5 tristated (TRISA set), RA0, RA1, RA2, RA4, RA5 set to
analog input, RA3 set to Vref (not Vdd but is seems to make little
difference) via ADCON1, and A/D input channel set to RA0 via ADCON0. I am
addressing the correct bank when setting these registers. The chip is
operating at 20MHz, the A/D clock is set to 32Tosc (1.6uS) . The charging
time is regulated by a software timer and is well above the minimum
recommended. The analog input is buffered by an op-amp so it has a nice, low
impedance.  The Vref is buffered too. Conversion is paced by polling the A/D
complete flag.

To summarize with an example, with Vref set internally to Vdd (5V in my
case) one would expect an A/D response of about128/255 on an input of 2.5V,
and 255/255 for the same input but with Vref selected and 2.5V applied.
Doesn't happen. This is driving me nuts!

Thanks  Paul Howell

Please reply to the PICLIST....

2000\04\05@122412 by Thomas C. Sefranek

face picon face
Paul Howell wrote:

> Hi -
>
> I'm new to the PICLIST too, so thanks in advance for the help.
>
> I am building a programmable high voltage power supply. It charges a
> capacitor bank that discharges through flash tube (pretty ordinary stuff).
> What is a little different is that the output must be confined to
> (logarithmically) equal discrete steps. It works by sensing the voltage
> output (through a divider) from the power supply compared to a setpoint
> (from a look-up table) and altering the duty cycle of the power supply to
> meet the setpoint (hexfet type of approach).  There are only 12 steps, and
> the accuracy and frequency requirements are such that the internal 8 bit A/D
> is adequate to the task of sensing the divider voltage.
>

Been there, Done that, Have the tee shirt!
I built more than an dozen supplies using the 16C73B,
>From as low a 150 volts up to 7.5 kV.

> Everything works just fine, but here's my problem that I thought would be
> simple. The A/D supposedly has two ways of taking a reference voltage
> depending on how the register ADCON1 is set. The Vref can either be taken
> from Vdd, or taken from whatever external voltage is applied to RA3.
> Naturally, I would like to apply a nice, stable Vref rather than taking Vdd
> which may (and does) droop internally. Unfortunately, setting the Vref
> either way seems to make little, if any difference.

Strange...

{Quote hidden}

What do you mean  "Doesn't happen.", what DO you get?

>
>
> Thanks  Paul Howell
>
> Please reply to the PICLIST....

--
 *
 |  __O    Thomas C. Sefranek  spam_OUTtcsTakeThisOuTspamcmcorp.com
 |_-\<,_   Amateur Radio Operator: WA1RHP
 (*)/ (*)  Bicycle mobile on 145.41, 448.625 MHz

ARRL Instructor, Technical Specialist, VE Contact.
hamradio.cmcorp.com/inventory/Inventory.html
http://www.harvardrepeater.org

2000\04\05@144730 by Paul Howell

flavicon
face
First of all, I want to know where to get the T-shirt.

'Doesn't happen' means that if I set the RA3 pin to Vref, then say, ground
that pin, you would expect that any voltage at all on the analog input (RA0
in my case) would peg the A/D. What happens instead is miniscule, like maybe
a few A/D counts difference if we happen to be around 2-3 volts input for
example. In essence it appears that the A/D is taking Vref to be Vdd no
matter what I select for Vref. I feel silly since this should be a
straightforward thing to do.

Could you easily include a snippet of your code that configures PORTA and
the A/D? Or advise generally? I think I am following the datasheet
correctly, but maybe I am overlooking something really dumb.

Thanks very much Thomas, your help is appreciated.

Paul Howell

----------
{Quote hidden}

2000\04\05@145357 by Andrew Kunz

flavicon
face
Vref must be > something like 3.5V though to work "by the book."

Andy









Paul Howell <EraseMEpaulspam_OUTspamTakeThisOuTHOWELL-LTD.COM> on 04/05/2000 02:42:34 PM

Please respond to pic microcontroller discussion list <PICLISTspamspam_OUTMITVMA.MIT.EDU>








To:      @spam@PICLISTKILLspamspamMITVMA.MIT.EDU

cc:      (bcc: Andrew Kunz/TDI_NOTES)



Subject: Re: Vref on PIC 16C74








First of all, I want to know where to get the T-shirt.

'Doesn't happen' means that if I set the RA3 pin to Vref, then say, ground
that pin, you would expect that any voltage at all on the analog input (RA0
in my case) would peg the A/D. What happens instead is miniscule, like maybe
a few A/D counts difference if we happen to be around 2-3 volts input for
example. In essence it appears that the A/D is taking Vref to be Vdd no
matter what I select for Vref. I feel silly since this should be a
straightforward thing to do.

Could you easily include a snippet of your code that configures PORTA and
the A/D? Or advise generally? I think I am following the datasheet
correctly, but maybe I am overlooking something really dumb.

Thanks very much Thomas, your help is appreciated.

Paul Howell

----------
{Quote hidden}

2000\04\05@201751 by Harold M Hallikainen
picon face
On Wed, 5 Apr 2000 14:50:12 -0400 Andrew Kunz <TakeThisOuTakunzEraseMEspamspam_OUTTDIPOWER.COM>
writes:
> Vref must be > something like 3.5V though to work "by the book."
>

       Is this in "the book" somewhere? I've checked the 16c74 datasheet off
the web and the big ap note book and found nothing about how the chip
works with different references.

Harold



FCC Rules Online at http://hallikainen.com/FccRules
Lighting control for theatre and television at http://www.dovesystems.com

________________________________________________________________
YOU'RE PAYING TOO MUCH FOR THE INTERNET!
Juno now offers FREE Internet Access!
Try it today - there's no risk!  For your FREE software, visit:
dl.http://www.juno.com/get/tagj.

2000\04\06@075605 by Andrew Kunz

flavicon
face
I forget which it is in, perhaps an errata, perhaps in a different line.  Your
FAE should be able to tell you the same, but we've already gone over this
several times here, perhaps it's doc'd in the archive.

The ADC module isn't as good as it could be, but it sure beats adding an extra
chip most of the time.

Andy









Harold M Hallikainen <RemoveMEharoldhallikainenspamTakeThisOuTJUNO.COM> on 04/05/2000 08:10:19 PM

Please respond to pic microcontroller discussion list <PICLISTEraseMEspam.....MITVMA.MIT.EDU>








To:      EraseMEPICLISTspamMITVMA.MIT.EDU

cc:      (bcc: Andrew Kunz/TDI_NOTES)



Subject: Re: Vref on PIC 16C74








On Wed, 5 Apr 2000 14:50:12 -0400 Andrew Kunz <RemoveMEakunzEraseMEspamEraseMETDIPOWER.COM>
writes:
> Vref must be > something like 3.5V though to work "by the book."
>

       Is this in "the book" somewhere? I've checked the 16c74 datasheet off
the web and the big ap note book and found nothing about how the chip
works with different references.

Harold



FCC Rules Online at http://hallikainen.com/FccRules
Lighting control for theatre and television at http://www.dovesystems.com

________________________________________________________________
YOU'RE PAYING TOO MUCH FOR THE INTERNET!
Juno now offers FREE Internet Access!
Try it today - there's no risk!  For your FREE software, visit:
dl.http://www.juno.com/get/tagj.

2000\04\06@104556 by Barry King

flavicon
face
Thomas,

The Selection of Vref is in ADCON1 as you said, make sure you are
setting it to xxxxx001 to have RA3 as Vref.  Setting ADCON1 to all
zeroes is the reset default, where Vcc is the ref.  Is it possible
you're getting an unintended reset which trashes the ADCON1?

The data sheet does not allow a Vref below 3V.  Its in the A/D
converter section, DC characteristics.  (Parameter A20).  Vref range
is allowed to be 3V to Vdd+0.3, (I assume the upper limit is where
the over-voltage protection diodes on RA3 begin to turn on.)  That
said, I am using mine with 2.55V reference (10 mV per count), and
seems to be working fine.  I asked the FAE why the 3V min, and it
comes down to the allowable offset in the comparator that is the
heart of the A/D.  If Vref is smaller than the 3V spec, the
comparator error budget is << 10 mV.  So a "good" one should work
fine at 2.50V Vref.  I don't think that is your problem.

-Barry.
------------
Barry King, KA1NLH
NRG Systems "Measuring the Wind's Energy"
http://www.nrgsystems.com
Check out the accumulated (PIC) wisdom of the ages at:
PIC/PICList FAQ: http://www.piclist.org

2000\04\06@122140 by Paul Howell

flavicon
face
Interesting...

I am actually setting ADCON1 to xxxxx011 as I am using PORTE for I/O, but my
understanding that anything with an lsb of 1 sets RA3 to Vref. I can however
move that I/O somewhere else if setting ALL analog-enabled imputs to analog
somehow makes a difference. I will also check for an unintended
reset....intriguing.

I confess I am running an old MPLAB version (3.5 or something) and the
firmware in my Picstart is surely outdated as well. My next step is to
upgrade to 5.0 and freshen up my firmware too. You don't mention the device
you are using, is it in fact a '74A? Does it matter?



--Thanks everyone....Paul Howell

----------
{Quote hidden}

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