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.

8051 Query

Status
Not open for further replies.
I'm doing a small project in which I have to store magnitudes of DC voltages ranging from 0 to 12V in a 8051. I know I have to use an external ADC to change the input type. How do i proceed from here? I know that the 8051 can store only upto FF that is 255. So mapping 12 into equal divisions of 255 gives me a resolution of 12/255=0.047V.

My question is how do i store this value in the uC?
 
As with any micro (such as the computer you're using) you store 8 bit values in a single byte (0-255 decimal) or for up to 16 bit values in two bytes (a word) giving 0-65535 decimal.
 
The easiest way is to think big...Fixed point arithmetic.. If you oversample 10 times so you result = 120 and then * 100 you get 12000 / 255 = 47 (an integer) all you need to do now is remember to divide your answer by 100.... Or use the answer to two decimal places using this method ..
 
Guys, i'm a total noob when it comes to uCs. What i meant was how do i store the values? Imagine I get the values from a source and the value is continuously changing. How do i feed this data to the uC? I use an ADC to convert it into discrete values and how do i store it? DO i connect the o/p of the ADC directly to uC pin or do i have to use any circuit in between?

I'm an electrical student so I don't know much abt the 8051 than its basic programming..

And the reason i didn't post this in the 8051 section is cos many people don't visit this section of the forum..
 
Last edited:
You would connect the output of your ADC to the uC inputs and write a program that reads the ports and stores the value in a variable.
 
I wasn't meaning to go over your head... It is very difficult to gauge competence... I saw a float .0.047 I thought that was your issue .... If you have a standard 8051, you will need to interface to an external non volatile memory, to save variables.
 
hi Friends..
I am new-comer on this blog, I want to make small 80C51 microcontroller based project coding using DC motor (24V).
Can any body suggest me regarding how the circuit diagram will be and interface coding?
Shruti
 
U r Correct sir.I dont wann to highjack somebodies code n ckt...!!!!
I am refering mazzidii book also but there I got info abt Stepper Motor interfacing.But in my pjct application is with DC MOTOR (24 V) and specially data will be sence from long distance thats the matter...!!!
 
I'm not talking about code and circuit... If you need help with an unrelated issue, you should start your own thread. We don't want people answering your issue on Mohamed's question..

I'm sure he wont mind you using posted code...
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top