Ok so I have a problem with my code and I'm not sure whether its the A/D converter or the way I have configured the UART. What it is supposed to do is read the temperature from RA1 and send it out the UART. But the problem is when I look at the values on PUTTY it just looks like a bunch of random numbers ranging from 400 to 500 and it also behaves the same way when I apply heat to the sensor
Any help would be appreciated
I think i have uploaded the code as a txt file but not sure as I'm a newbie
I tried what you asked but that didnt work...but what I did notice was that I'm getting results but I have left the input hanging with no input...I have a jpg showing the results Im getting...
Not necessarily... Is there any way you could wire up a simple pot to the RA1 input?.... Also run it through the simulator... Make sure the ADC result is in the right format... justified I mean..
You can just make sure the maths are working as expected (Without casting, floating point calculations do appear odd sometimes).
I could only test RA0 with the pot as I'm only testing the program with a picdem 2 board....it seems to working fine..what I'm going to do next is to try and simulate it and see what im getting..
One thing to look at is not all LM35 have the same pin out I had this happen and it was because my LM35 output was not the same as with the data sheet i got off the net.
Im using an external sensor (LM35) and I have checked the output with a multimeter and I'm getting the right results..... roughly around 200mV at room temp
I'm puzzled..........I myself think its the pic is broke
I didnt realize there was a sensor on the board looks like its a digital output..
In my view... Its not the pic.... If the pins are connected to the LCD... You won't be able to use them as analogue inputs... The LCD has internal pullups so you will only see 5v (ish) on RA1
I think you mean PORTD...ok so im recieveing 5V on PORTD...a voltage on RA0(pot connect to RA0)...getting 5V on RA4 which is connected to a switch and 1.5V on RB0????
I taught you tested the code and it works so that would mean the PIC is at fault?????
No.. I haven't got a picdem2 board... I tried it in ISIS..
Look at it like this... LM35 connected to 5v...0v... RA1.. correct..... RA1 should read LM35 output.... correct.... LCD RS line connected to RA1 aswell.... voltage from LM35 being applied to two devices.. LCD RS connection will add / drain voltage from signal.
It's the lcd all you have to do is look at the data sheet Ian posted and you'll see what happing you may have jumper that can be cut lots of there boards do.
I do understand what you mean...but the LCD is connected to PORTD not PORTA..But I have just spotted RA1 is connected to the battery so that cant be used as an A/D converter....
The problems will probably disappear when I make a PCB....