Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PIC16F877A A/D conversion problem

Status
Not open for further replies.

RATAN ROY

Junior Member level 1
Joined
Jul 29, 2009
Messages
18
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Kolkata,West bengal,India
Activity points
1,410
Hi Everybody,
I m a new user of microcontroler (PIC16F877A). I will have to perform an a/d conversion n will have to display the corresponding analog value with the help of seven segment display.but i got the converted result from 10bit inbuilt ADC,but my controller is 8bit.After this how can i go ahead?? i m finding nothing from myself.If anybody can help me,plz......
I wd like to start embedded C also. for this what should i follow,anybook...plz
 

your 10 bit ADC result is stored in two registers ADRESL(8 LSB) and ADRESH(2 MSB) so
<ADRESH:ADRESL> comprises of 16 bit of data which contains 10 LSB of ADC write a program which store two bytes in one 16 bit word
 
  • Like
Reactions: ashref

    ashref

    Points: 2
    Helpful Answer Positive Rating
Hai
How many seven segment digit you have interfaced in your hardware?
I thing you need 4 Nos.
What Mr.Saeed saying is correct. Since you are doing in C, Use shift operator << and concatenate these two registers. Then simply do for hexadecimal to decimal conversion store the result in 4 variable. The hexadecimal range for the ADC output will be 000H --3FFH
If you convert into decimal, it is maximum of 1023(3FFH). So totally 4 digits.The stored 4 variables content are despatched to each corresponding 7 segment display.
 

Hi..........
thnx for ur rply to me.bt i m confused where i will keep the 16bit word(L+H) in PIC16F877A from where i'll take 10LSB n hw will i convert hex to original analog voltage in assembly language which is going to display by 7-segment display.Can u help me by sending any example code for the same.......Plz

I m looking frwrd 4 ur positive rply......
 

There is a simulation software called PROTEUS. If you have it then you can find the sample code with circuit design for the ADC of PIC you want.
Regards,
Jerin.
 

There are also samples in C compilers. If you are using one of them =)
 

There are also samples in C compilers
You can find the sample programs in MikroC compiler(compiler in C) as said by john & also various library functions are also available there to do the same operation with simple functions.
Regards,
Jerin.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top