1wire DS2760 > SX28
T Chap
Posts: 4,223
I am looking for an easy solution to get the DS2760 Temp into a computer via serial port. Is the SX able to read the chip and convert to F or C, then allow the computer to read it? I am looking through the 1wire file in the SX software, trying to decide how to start. t looks doable, just wanted to make sure. If a code exists somewhere already for the Parallax thermocoupler kit please let me know. I have the Stamp version, but it looks like a ton of work to convert it.
The idea in mind is to program the SX to locate the 1wire device, read it's temp value every second, and output the temp value for every readTemp. I don't see a need for the SX to get info back from the comp.
Thanks for any suggestions whether this will work. If it will work, will the timing be critical enough to require the 4m resonator?
The idea in mind is to program the SX to locate the 1wire device, read it's temp value every second, and output the temp value for every readTemp. I don't see a need for the SX to get info back from the comp.
Thanks for any suggestions whether this will work. If it will work, will the timing be critical enough to require the 4m resonator?
Comments
Here is the link: http://forums.parallax.com/showthread.php?p=601621
As written it·is only for the K-Type thermocouple, and only for 0°C to 500°C.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap used 4-digit LED display with driver IC·www.hc4led.com
Low power SD Data Logger www.sddatalogger.com
SX-Video Display Modules www.sxvm.com
"People who are willing to trade their freedom for·security deserve neither and will lose both." Benjamin Franklin
Post Edited (Bean (Hitt Consulting)) : 11/16/2006 11:33:36 PM GMT
Thanks
Post Edited (originator99) : 11/17/2006 4:56:47 AM GMT
Looking at the code, it's pretty obvious that "temperature" is the variable holding the temperature, and the one you want to send... but you know that already.
Sometimes it's better to knock things around a bit, do some tests (boiling water), and verify what you believe to be true. It sounds like you read the code but didn't quite trust yourself. Give it a shot! It's the best way to learn.
Thanks, PeterM
I merged the ReadString and Thermo codes and have everything working as needed except getting the Temp to look like it should.
I have knocked it around, 4 hours non stop [noparse]:)[/noparse]
Anything I send within quotes goes over no problem. But TX_Str temperature shows up as all kinds of symbols , no numbers
Post Edited (originator99) : 11/17/2006 7:19:57 AM GMT
I'm don't use SX/B, but it looks to me like you're not sending a string, but rather sending an integer to the PC. You have this code:
The problem is that the definition of "temperature" is this:
That is just an integer, and not a string. Furthermore, temperature is whittled away to create a string for the LCD, so when it's done, it has nothing or junk in it. It makes sense that you get junk on the PC side because I am assuming you're using a terminal program to read it. If so, then the terminal program takes whatever is receives and tries to interpret it as ASCII when it's not - it's a raw integer.
You comment mentions "inline string" but there is no inline string that I see. Instead, the code creates an equivalent of the temperature and sends it a character at a time to the LCD as it creates it. I think that if you follow each call of:
with something like:
You should get the results you're looking for.
Bear in mind, I have no idea what hardware you're using. I'm not sure what LCD you have attached, and if it is working or not. I also don't know if you have verified that you are able to send any string data to the PC over a serial port. If not, then get that working first, and then figure out how to integrate that knowledge into this code you're working on.
Thanks, PeterM
This works when TX_Str is replaced with TX_Byte
Thanks for the schooling. I looked everywhere in the help and did not see a method to convert to string.
OR'ing the numbers 0 to 9 with $30 is a classic old school trick for converting to ASCII. It works because the ASCII value for the number "0" is $30, and ASCII for "9" is (you guessed it) $39. In this case simply adding them together would also work just as well.
Glad to hear it helped.
Thanks, PeterM
If you were using a slower baud rate (say 1200 baud), you MIGHT get away with the internal 4MHz with IRC_CAL IRC4MHZ.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap used 4-digit LED display with driver IC·www.hc4led.com
Low power SD Data Logger www.sddatalogger.com
SX-Video Display Modules www.sxvm.com
Stuff I'm selling on ebay http://search.ebay.com/_W0QQsassZhittconsultingQQhtZ-1
"People who are willing to trade their freedom for·security deserve neither and will lose both." Benjamin Franklin
·
I've been using it in my coffee roaster and it seems to be pretty accurate. I've not done a lot of testing to see exactly how accuracte, but someday I will... honest.
Bean's method is likely more accurate tho.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
stand back! I have a slide rule and I know how to use it!