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.

[SOLVED] Problem with ADC @ PIC16F877A

Status
Not open for further replies.
I guess PORTB in PIC doesn't support your input since it can use 1ly as digital I/P. A digital input has !ly 0V and 5V levels. If u vary your I/P by means of sensor it doesn't respond as u required.
Just configure it to PORTA or PORTC...

I might be wrong. Please consider my points and give corrections...
 

I guess PORTB in PIC doesn't support your input since it can use 1ly as digital I/P. A digital input has !ly 0V and 5V levels. If u vary your I/P by means of sensor it doesn't respond as u required.
Just configure it to PORTA or PORTC...

I might be wrong. Please consider my points and give corrections...

You should read the post before you make a comment.
Read # 20.

"
****** Most important note: Both sensors are connected and powered up all the time. And if I use just the Thermistor calculation, its fully fully ok. And if I use just DHT11 calculation its also fully fully ok. But if I use both calculation, Its not ok. Only DHT11 data is ok and showing right result and only the thermistor measurement result is not ok. That means only the ADC is not working properly."


What you read?????? The RB7 is working good. if not how can I get the data from DHT11????????????????? From sky??????????
 

Just connetct your power supply with a variable resistance to your PORTB pin. Now varry the resistance value and monitor the variation in voltage. If you get the variation as it is, it's working fine for your sensor too. If it doesn't U r getting a wrong value and it jst matching with the correct value. Just check this and say your comments...

For more reference read the I/O and ADC of PIC in your PIC16F877A data sheet....
 

Just connetct your power supply with a variable resistance to your PORTB pin. Now varry the resistance value and monitor the variation in voltage. If you get the variation as it is, it's working fine for your sensor too. If it doesn't U r getting a wrong value and it jst matching with the correct value. Just check this and say your comments...

For more reference read the I/O and ADC of PIC in your PIC16F877A data sheet....

Why don't you understand that nobody will measure a analog voltage with PORTB of PIC16F877A????? Is this a analog port??? Read the post before. I mentioned many many times that the thermistor is connected at ADC channel, that means at PORTA. And AN0 is used to measure the analog voltage.

on the other hand DHT11 is connected at RB7, calculating the digital data.
 
Last edited by a moderator:

As I suggested earlier,

It sounds like you are corrupting either the ADC/port setup with your code. Run it with the debugger and when the problem occurs, check all registers associated with the ports and ADC to see if they are what you expect.

Keith
 

May be, I didn't found any thing like that.
Do you mean you tried using the debugger and didn't find any problem with the ADC/Port setup registers? When I have had strange problems with microcontrollers I group together the registers associated with the ADC (including port control registers associated with the ADC pins that are shared), and examine them when the program works and when it doesn't. You will most likely find a difference. Then you will need to trace the program to find out where the registers(s) was changed. Any built in functions you didn't write are a possibility.

Keith
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top