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
PIC18F4550 & TC77 ... Help Please
Moderator: Benj
- Steve
- Matrix Staff
- Posts: 3433
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
Re: PIC18F4550 & TC77 ... Help Please
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
http://www.microchip.com/wwwproducts/De ... e=en010750
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: PIC18F4550 & TC77 ... Help Please
This may also help you?
http://ww1.microchip.com/downloads/en/A ... 00913a.pdf
http://ww1.microchip.com/downloads/en/A ... 00913a.pdf
Martin
Re: PIC18F4550 & TC77 ... Help Please
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
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
The only real simulation isn't ...
Gypo
Gypo
- Dan81
- Valued Contributor
- Posts: 268
- Joined: Sun Jan 15, 2006 4:07 pm
- Location: Albi France
- Been thanked: 60 times
- Contact:
Re: PIC18F4550 & TC77 ... Help Please
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
Can you post your flowchart and the schematic of your hardware (TC77 has a single SI/O).
Daniel
PS : look at your PM
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: PIC18F4550 & TC77 ... Help Please
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.
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.
Martin
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: PIC18F4550 & TC77 ... Help Please
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.
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.
- Attachments
-
- Read TC77.fcf
- (9 KiB) Downloaded 320 times
Martin
Re: PIC18F4550 & TC77 ... Help Please
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
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
The only real simulation isn't ...
Gypo
Gypo