ric
If you're using XC8, why did you put this post in the C18 forum?
If I declare adcon1 to configure the digital inputs the reset function returns 0, if I do not configure adcon1, the reset function returns 0 but the temperature reading is always 0
Your code simply will not work if you leave pin RA2 in analog mode, so don't waste time trying it without configuring ADCON1.
Does any of your LCD code access other pins on PORTA?
If it makes the same mistake, of writing to the PORTA register (e.g. using RA2) rather than the LATA register (LATA2), then it will lose the low setting on LATA2, stopping your one-wire logic working at all.
I can't check as you have not shown that code or mentioned how the other pins on your PIC are wired up.
Hello sorry, I realized too late, my post had already been approved, in fact it is the first time I ask in this microchip forum, whatever, yeah! I know the pin needs to be set digital, I tried but it's when the reset function returns 1 and the sensor never connects, it's actually part of a larger system so almost all other pins are busy, the LCD is connected to port D, RA0 and RA1 are push buttons and the other pins of port A are free and are only configured as inputs with TRISA, from port b only RB2, RB3 are free, because I use RB0 and RB1 to read an RTC and from RB4 to RB7 I use them as external interrupts, almost all port C is free and the three pins of port E, I have tried with each one and I have not been able to make the sensor connect, I have tested it with LATA, with PORTA, configured ADCON1 and nothing :( In that example, for example, if I configure adcon1 and I don't use anything else, there's no reason why it doesn't work, or at least that's what my logic tells me hehehe