Page 1 of 1
PIC18F4550 & TC77 ... Help Please
Posted: Mon Mar 07, 2011 10:23 pm
by Gypo
Hi
I am using Flowcode 4 with a PIC18F4450 connected to a TC77, I am able to read it with the SPI component OK but the values I am getting just confuse me.
I have read the datasheet for the TC77 loads of times and it doesn't get any clearer.
I have used other temperature sensors in the past where the tempreature is read from a specific register from inside the temperature semsor and converting that to a temperature was quite easy..... But.......
With the TC77 you don't use register address's to get at the temperature you just keep reading it... There is obviously a fudge factor when you have the high & low values from the TC77 but although the values I get are similar each time they don't seem to be the same time and time again. In amoungst the readings is other data and I just can't seem to identify that to be able to strip it from the data I need.
Anyone else done this?
If you have managed to get the right values from a TC77 using the SPI component I'd be most appreciative if you'd lend a hand....
Thanks
Gypo
Re: PIC18F4550 & TC77 ... Help Please
Posted: Tue Mar 08, 2011 8:48 am
by Steve
There seem to be a load of application notes on Microchip's website relating to this device. Is there anything in these that you can apply to Flowcode?
http://www.microchip.com/wwwproducts/De ... e=en010750
Re: PIC18F4550 & TC77 ... Help Please
Posted: Tue Mar 08, 2011 10:56 am
by medelec35
Re: PIC18F4550 & TC77 ... Help Please
Posted: Tue Mar 08, 2011 11:27 pm
by Gypo
Guys
Thanks but as I said I have been through the datasheet and several application notes...
I have a good idea of how to convert the temperature data from the TC77 into a real temperature number but I am having trouble identifying the temperature data from the rest of the data read out
of the chip.
It's just not obvious looking at the data that comes out.
The application notes and the datasheet talk round clocking the data out bit by bit, and if you want just the temperature data clock out the first 16 bits (13 of which is the temperature) and then taking the chip select line high to end the data flow, and then just do it all again when you want to read it again.
This isn't straight forward using the SPI component I have tried reading 2 bytes (16 bits) and then un-init the TC77 but that doesn't seem to work any better than a continual read from the chip.
As the application notes give examples in assembly code I'd rather not try and convert that to C and all the hassle that hard coding has...... The reason for trying to use Flowcode.
Thanks anyway
Re: PIC18F4550 & TC77 ... Help Please
Posted: Wed Mar 09, 2011 8:43 am
by Dan81
Hello Gypo
Can you post your flowchart and the schematic of your hardware (TC77 has a single SI/O).
Daniel
PS : look at your PM
Re: PIC18F4550 & TC77 ... Help Please
Posted: Wed Mar 09, 2011 9:08 am
by medelec35
Sorry,
Your right Gypo.
You have probably look on the net and already seen the datasheets.
Besides the data sheet I found by searching the net, I did not realise can be seen by looking at Steve's link as well.
I admit I have not use this device before, but I have two solutions in mind.
1) convert 16bit serial o/p to string (by using a loop), then use left$ and convert result back to integer with correct bits for calculations.
2) Again using a loop and take each bit in turn and multiply by power of 2, 4, 8 etc. Disregarding the 3 lower bits ( I think need to re read data sheet:P ).
I am working on a flowchart for both methods, and if successful, will post them.
Mean while if you do find the answer, can you let us know please, so can stop working of flowcharts.
Re: PIC18F4550 & TC77 ... Help Please
Posted: Wed Mar 09, 2011 9:02 pm
by medelec35
Here is my attempt at reading TC77 and converting results to Celsius and storing in variable called Temperature .
The main routine is in a macro, so you can import it to your existing flowchart.
I have labelled the i/p & o/p so you can see what connects to it. E.g port A1 connects to SCK
Since I have not seen your circuit, I did not know which connections to use.
This may or may not work, as not got or never used TC77 + I made it up as I went along

.
All the flowchart does is read the 1st 13 bits (MSB > LSB) convert binary 13 bits to decimal, then divide results by 32.
Since I don't know if works or not, I have not allowed for temperatures below 1 deg, as that takes a little more working out.
If it works then great!, if not...sorry, I did try.
Edit: I am curretly working on a version with Flowcode SPI component.
Re: PIC18F4550 & TC77 ... Help Please
Posted: Fri Mar 11, 2011 11:41 pm
by Gypo
Many thanks Guys
I have had to leave the project alone for a while I have a few things that are more urgent. Looks like I won't be able to do any more until late nex week.
I'll try all the help you have given and get right back to it when I get the chance.
Many thanks again
Gypo