voltmeter- with a 8051 and SDCC

Most importantly I am looking for HELP pages for the SDCC, I haven't been able to find much.

I have an LCD display, a 89c4051, and a c compiler. I would like to try to make a voltmeter. Does anybody have any sample c code to do this.

Two parts, I don't know how to write to the lcd. I don't know how to read the analog bit.

I have SDCC but all I can do is produce simple code.

Reply to
richardscheff
Loading thread data ...

The AT89C4051 doesn't have much in the way of analog bits inside it- just a comparator. If you really want to make a voltmeter you've got a bunch of work to do. Have you looked at links from

formatting link
?

Best regards, Spehro Pefhany

--
"it's the network..."                          "The Journey is the reward"
speff@interlog.com             Info for manufacturers: http://www.trexon.com
 Click to see the full signature
Reply to
Spehro Pefhany

You could use an external analog/digital converter. There are several available; the MCP3001 from Microchip is inexpensive (only about $2) pretty easy to interface to, using bit-banging if necessary:

formatting link
You'll have to handle scaling the input, of course.

Which LCD are you using? The character-based matrix displays based on the Hitachi HD44780 controller and its work-alikes are fairly available on the surplus market and are reasonably inexpensive. It takes a little work to get them up and running; follow the instructions in the data sheets to the letter to get the display properly initialized. A good reference for this type of display is available at

formatting link

--
Rich Webb   Norfolk, VA
Reply to
Rich Webb

I am using HD44780. I figured out that all I need to add a putchar function into my code. So the LCD part should be working now.

My next part is the voltage measurement. I thought the comparator would give a voltage value, but now I am seeing that it only campares two pins. Is there a way that I can measure a voltage value using the comparator. Thanks for the quick replies.

Reply to
richardscheff

I was seeing that some chips can produce a voltage reference. Can the

4051 do this as well.
Reply to
richardscheff

Yes there is. Atmel has an application note describing how to implement this at

formatting link

--
Rich Webb   Norfolk, VA
Reply to
Rich Webb

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.