ok so the chip select goes low and tells the temprature chip to send data, it reads data into mxtemp variable then chip select goes high releasing the temprature chip then does the conversion?
I didnt know you had to send a signal to the temp chip to tell it to send data to the pic, i figured it just kept sending data over and over and the pic just grabed the first set of data that was a full string of data with a start and stop bit type of thing.
however im a bit confused, you set port A to all outputs, A.2 is set as output but wouldnt you want that to be the serial in and be an input?
I read up on the shiftin command but it doesnt say if the port needs to be an input or output port. can you clarify this?
also in this code
TempF = ABS(TempC) */ 461
TempF = TempF + 32
i see absolute of tempc, but what is this */461?
I use another formula for converting C to F
My original code for conversion was
ANA0 = ANA0 / 13 'Convert 16bit to 10bit (65k = 5k)
TEMP = (((ANA0 / 10) * 9) / 5) + 33 'Convert ANA0 to Farent.
but I have changed it now to
TEMP = ((((TEMP / 10) * 9) / 5) / 13) + 32 'Convert ANA0 to Farent.
this works better and is alot more acurate since it does the math with large numbers and then reduces it.
however this is the code I use for converting a ADC line not if i have the Celcius number to begin with
So what does */461 do?




Bookmarks