Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

generating analog voltage using microcontroller

Status
Not open for further replies.

aruna1

Member
Hi

I need to generate an analog voltage using a microcontroller (16F877A)

I have two options -


1.)Use R-2R ladder and make a 10bit DAC

2.)generate 1kHz PWM signal--> send it through a 6 pole lowpass filter--> get analog voltage relevant to duty cycle.



Since I couldn't find any DAC ics, I'm stuck with above two options (they are the only methods I know of, are there any other methods?)

I have to order some DAC ICs but it will take about 3 weeks to reach me, so untill then I have to use some method to generate voltage.

What method do you think most reliable? that is more accurate and steady?

Thank you
 
The PWM uses less parts! (pins)
Both DACs require your power supply to be stable.
PWM = 0 to 5V
R-2R = 0 to 2.5V
You probably will need to buffer both.
A software PWM will eat up CPU time!
 
The PWM uses less parts! (pins)
Both DACs require your power supply to be stable.
PWM = 0 to 5V
R-2R = 0 to 2.5V
You probably will need to buffer both.
A software PWM will eat up CPU time!
PWM is genearted using hardware module inside the Microcontroller


why R-2R provide only 0-2.5V ?
 
You are right I was thinking of a different DAC. It will output 0 to 1 bit short of supply. 0 to 4.995
The R-2R needs very good resistors if you want 10 bits.
I think the 16F877A does not have a hardware PWM.
 
Definitely use PWM. An R-2R DAC is too difficult to build from discrete parts.

If you can use a PWM frequency higher than 1kHz, you will reduce your filter requirements.
 
very good.
If you supply is good.
The duty cycle is set by the clock and the clock is good.
 
Hi,

I dont know if you want to add another chip, but you can get a serial DA converter and that way you can get stable high resolution DC voltages.
 
Hi,

I dont know if you want to add another chip, but you can get a serial DA converter and that way you can get stable high resolution DC voltages.

ya but problem is finding one. I have to order one from ebay, but will take 3 weeks to get here
 
Looking for parts....digikey.com clames they have resorces in Sri Lanka. They do 1.5 billion/year. I have ordered / shipped parts world wide with out problems.
 
I checked every local store I know but couldn't find one. but didn't try digikey. I haven't brought any thing from digikey yet. I will check
 
Hi,

How fast do you need it? I think digikey is pretty quick on shipping.
I used to know someone else from Sri Lanka too until their business got wiped by a flood from the tsunami.
 
Last edited:
How fast do you need it? I think digikey is pretty quick on shipping.

Digikey = good.

Just received my first order from them in a long time. Shipped USPS, took 4-5 days. Not bad.

Plus their parametric search is so much better than, say, Jameco's. Plus better prices and a lot more stuff.

Haven't dealt w/Mouser yet; wonder how they compare?
 
digikey is too expensive.
for an example in here MC34063 is about $0.4 where in digikey its $1.4 and shipping is $32.
 
Hi,

Wow, sorry to hear that. Anywhere else closer to you maybe?
 
nope, but i was able to order some DAC samples from TI.com. hopefully the will arrive next week
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top