ADC on 18F452

Status
Not open for further replies.

0mega

New Member
Hello All,

I want to use a PIC 18F452 to do analogue to digital conversion. I know how to aquire the input using C18 or assembly, but i am not sure how to wire it up. My input voltage will be around 20VDC +- 4V, however i intend to use this through a voltage divider, so i'll convert to 2.0VDC +- 0.4V (ie. 1/10).

What would i wire to vref? I read at
that a TL341 chip (what is that?) will give 2.5V range.... this is perfect.

How would i wire up such a circuit?

CHeerZ, JB
 

As you've already seen my tutorial, you will have noticed that I use an opamp fed from a potential divider (to give 10V range), all you would need to change is the input resistor to give 20V range.

What would i wire to vref? I read at
that a TL341 chip (what is that?) will give 2.5V range.... this is perfect.

As the tutorial mentions, the TL341 is a precision voltage reference source, there are various different ones available - but they usually end in 341. The one I used actually came from an old VCR, they are commonly used in switchmode power supplies for the regulation - a lot of TV's and VCR's have them.

How would i wire up such a circuit?

Wire it like my tutorial, I'm not sure which pins the 18F452 uses, so you will need to check the datasheet - presumably, like the 16F876, you will need to configure the chip correctly - the details in my tutorial should help you work it out.
 
Ahhh

Soz, Your website was down, so i couldn't dl the schematic, i have done so now. Thankz a dozen.

(How about making a usb board?? Look at PicNet USB)
 
Re: Ahhh

0mega said:
Soz, Your website was down, so i couldn't dl the schematic, i have done so now. Thankz a dozen.

My web forwarding service seem to have been having problems recently :cry: but you can always access it directly at **broken link removed**

(How about making a usb board?? Look at PicNet USB)

The problem with that is that the only USB PIC's are OTP (or expensive UV eraseable JW versions) - the USB interface for PicNet simply converts from USB to serial, which you can already buy easily in any computer store (although it also gives access to the facilities of the 16C745 within PicNet).

I do have a 16C745JW, which I obtained as a sample (before they stopped supplying it as a sample), and I'll probably do something with USB one day (but I don't know what yet!).
 
pic18f452


Hello,

I really like your tutorials and i was wondering if i can use your code on a 18F4520. I have a pic Dem 2 board from microchip.

Thank you.
 
Hello,

I really like your tutorials and i was wondering if i can use your code on a 18F4520. I have a pic Dem 2 board from microchip.

You have to modify the code slightly for 18F series chips, but it's pretty easy to do.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…