ADC

Hello All,

I am trying to build a 8051 based single board computer. I am planning to have an ADC (0804) and serial port drivers ( 1488 and 1489) on it too. The project is to read the voltages form the temparature sensor and update a website portal using serial port.

And I have following worries and questions

  1. Let suppose the temparature sensor updates itself every one second. The 8051 is also commnunicating with the PC via serial port and then PC is updating the portal. My question is that how will I keep everything synchronize?

  1. What should be the size of the RAM and EPROM?

  2. What should be the relation between the serial communication baud rate and the update rate of the portal and the ADC update rate?

  1. How can I measure the serial baud rate generated by the 8051?

Please advice! John

Reply to
john
Loading thread data ...

Use a real-time-clock and send the time along with the temperture data.

I would think this could easily be done w 128 bytes of RAM (the minimum avail on most 8051's), and 4K of code space. Note, many

8051's use Flash these days, not EPROM, but the answer is basically the same.

Bottom line is you can't count on the web to be real-time. You can have delays from milliseconds, to days, even longer. Chances are the ADC can run much faster than the serial port can anyway. So, you're probably left with selecting a standard baud rate, like

9600 or ??, and slowing down your conversions to match. Or, maybe you can take multiple readings in between serial transmissions and average them first. Though, I can't think of an instance where temp would change this quickly...??

For most 8051 designs, an 11.0592 MHz main clock crystal allows for standard baud rates. (easily divisible when stuffing the timer/counter registers.)

Oscilliscope or a dedicated communications test set capable of measuring RS232. The cheap-and-dirty way would be to just connect the output to HyperTerminal (Microsoft Windows app) and you'll know you got it right when you can see the characters on screen correctly. (This is more "verification", than "measurement", but you get the idea...) Good luck. -mpm

Reply to
mpm

On a sunny day (Wed, 12 Dec 2007 06:48:00 -0800 (PST)) it happened john wrote in :

How about a PIC with some ADC and a MAX232? Much simpler.

Protocol, have the PC ask the board for a temp measurement, the board then sends the result(s).

Any PIC has enough.

PC and board baudrate should be the same, and in the above case it can be almost any value.

Read the docs?

Reply to
Jan Panteltje

Project for school?

??

Make one the master and one the slave. For example, have the 8051 send a data packet once every second and have the PC parse it in an event loop. You could also have the PC request data and the SBC respond with the data, in which case the 8051 would not have to keep track of time for that purpose.

As much as needed. For something like this, you probably can't buy one too small.

The baud rate is probably going to be fast enough for once a second no matter what reasonable baud rate you choose. A common baud rate is

9600 baud, 8 bits no parity. Decide on your packet format and maybe add a checksum and you can figure out how many bytes. Suppose you have lots of overhead and send 15 bytes, that's roughly 15msec at 9600 baud.

An oscilloscope. But if you do the programming right, there's no need to measure it, it will just arrive error-free at the PC.

Best regards, Spehro Pefhany

--
"it\'s the network..."                          "The Journey is the reward"
speff@interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Reply to
Spehro Pefhany

Here you go, 1/2 your homework done for you.

formatting link

All you need is the portal side done.

The above link was the first hit on google.

I am sure you can find the rest of your homework done for you.

Good luck

donald

Reply to
donald

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.