I have written a simple temperature measurment program using the LM35 IC Using a PIC16F877A on a V7 programmer
This has an output of 10mV/°C.
The program works as expected with the LM35 connected to ADC0 & LCD Display on PORTB
I have tried running the same code on the ECIO40, with the same connections, but the indicated value is approx 50% of the actual true value
Ive tried different ADCs on the ECIO with the same results.
i.e.Ambient temp 20°C 16F877A = 20.11 °C ECIO = 11.22°C
Any suggestions would be welcome. Thanks
Files attached
ECIO
Moderator: Benj
- JohnCrow
- Valued Contributor
- Posts: 1367
- Joined: Wed Sep 19, 2007 1:21 pm
- Location: Lincolnshire
- Has thanked: 364 times
- Been thanked: 716 times
- Contact:
Re: ECIO
Hi
Tried looking at this from a different angle.
I connected the LM35 to Port A bit 0 on both the ECIO and the 16F877A in the V7 Programmer and read the ADC directly as floating point voltage.
Ambient temp in room is 23°C
The 16F877a gave a value of 0.2293 which equates to 22.93 °C i.e. correct (10mV/°C)
The ECIO gave a value of 1.8492
Is there somthing I'm missing in the data sheets
Tried a similar experiment with both boards and using read as byte and read as int, both ways gave totally different values for the different micros.
The ADC settings in flowcode were kept the same.
I only have the 1 ECIO so not able to verify if it has a fault by trying another device
Thanks
Tried looking at this from a different angle.
I connected the LM35 to Port A bit 0 on both the ECIO and the 16F877A in the V7 Programmer and read the ADC directly as floating point voltage.
Ambient temp in room is 23°C
The 16F877a gave a value of 0.2293 which equates to 22.93 °C i.e. correct (10mV/°C)
The ECIO gave a value of 1.8492
Is there somthing I'm missing in the data sheets
Tried a similar experiment with both boards and using read as byte and read as int, both ways gave totally different values for the different micros.
The ADC settings in flowcode were kept the same.
I only have the 1 ECIO so not able to verify if it has a fault by trying another device
Thanks
1 in 10 people understand binary, the other one doesn't !
-
- Valued Contributor
- Posts: 548
- Joined: Tue Jun 26, 2007 11:23 am
- Has thanked: 6 times
- Been thanked: 44 times
- Contact:
Re: ECIO
Hello,
I have tested your program using a 4K7 potentiometer as a voltage source. The temperature displayed on the LCD corresponds correctly with the input voltage across the full range:
0.3V - Temp = 30.00
5V - Temp = 499.2V
I also used an EB-061 ECIO Base Board to ensure that the port connections were correct.
I have tested your program using a 4K7 potentiometer as a voltage source. The temperature displayed on the LCD corresponds correctly with the input voltage across the full range:
0.3V - Temp = 30.00
5V - Temp = 499.2V
I also used an EB-061 ECIO Base Board to ensure that the port connections were correct.
- JohnCrow
- Valued Contributor
- Posts: 1367
- Joined: Wed Sep 19, 2007 1:21 pm
- Location: Lincolnshire
- Has thanked: 364 times
- Been thanked: 716 times
- Contact:
Re: ECIO
Hi Sean
Thanks for having a look at the program. I also used the base board with the ECIO.
Tried using a 5k Pot between 5V and gnd with a 10k resistor from wiper to ADC0 in the ECIO and it works just perfectly.So I'm sure my ecio is fine.
Put the LM35 back in the protoboard and still gives an error.
Im suspecting it could be picking up some sort of interference. (Could the resonator on the ECIO cause this? as opposed to using a crystal with the eb006) ?
Thanks again
Thanks for having a look at the program. I also used the base board with the ECIO.
Tried using a 5k Pot between 5V and gnd with a 10k resistor from wiper to ADC0 in the ECIO and it works just perfectly.So I'm sure my ecio is fine.
Put the LM35 back in the protoboard and still gives an error.
Im suspecting it could be picking up some sort of interference. (Could the resonator on the ECIO cause this? as opposed to using a crystal with the eb006) ?
Thanks again
1 in 10 people understand binary, the other one doesn't !