WAY OT: pushing data bits



http://www.parallax.com/ProductInfo/Microcontrollers/Applications/tabid/430/Default.aspx#AN001
This is for a different microcontroller and a different language.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
On Wed, 27 Jan 2010 17:31:09 -0500, Karl Townsend wrote:

Karl, you can't assume that 3rd-party IP that you pay tens of thousands of dollars for is correct. Given that, you _certainly_ can't assume that some cruddy code that you get for free off the net is correct.
Apps engineers are generally fresh out of school, working at the requisite 'two years experience programming in ...' so they can get a real job (so kids -- make sure to get those internships!).
--
www.wescottdesign.com

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

I have a 1 wire system setup to monitor 13 freezers, I used my computer a DS 9097, DS 18S20s and Lampomittari software. Here's a forum that will have someone that could help you set up a stamp. It helped me get started. http://www.cocoontech.com/forums/index.php?sx400d45e171eeb0a2a5d31713ea5131&showforumA
Here's the top page, go to hardware and find hobby boards http://www.cocoontech.com/forums/
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

This could be interesting. I have a Pick2 kit and a few of those sensors I ordered last year. Winter ended and I never pursued it further since the sensors showed up in spring.
I'll go back to eating dinner and reading.
Wes -- "Additionally as a security officer, I carry a gun to protect government officials but my life isn't worth protecting at home in their eyes." Dick Anthony Heller
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Today would you buy the PicKit 3 instead? Or something else?
jsw
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Jim Wilkins wrote:

The general opinion on the Microchip forums is the PICkit 3 is not yet ready for prime time. Some would say it is not fit for purpose. It has to re-flash its firmware every time you select a different 'family' of PICs and many users have complained of its tendency to 'brick' itself.
--
Ian Malcolm. London, ENGLAND. (NEWSGROUP REPLY PREFERRED)
ianm[at]the[dash]malcolms[dot]freeserve[dot]co[dot]uk
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
wrote:

\ \Today would you buy the PicKit 3 instead? Or something else? \ \jsw
Having bought a PICKit2 and 3 last week, today I'd choose only the PICKit 2, maybe they will get the PICKit 3 right later. I'm waiting on a return authorization for the PICKit3, it doesn't even work correctly with the board it came with. I don't know about others but I have to hold pressure on my PICkit 3 to get it to work at all, I think something is wrong with the connector. Microchip is going to send me a RA. The PICkit2 works great however.
RogerN
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Reading the responses, I'm glad I didn't wait for the PicKit3.
Wes -- "Additionally as a security officer, I carry a gun to protect government officials but my life isn't worth protecting at home in their eyes." Dick Anthony Heller
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
wrote:

Why? Just because the PICKit2 works better and cost less?
:-)
MicroChip is sending me a replacement for my PICKit 3, hopefully this one works correctly.
RogerN
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

This is about a year later. That is pathetic. Light years in electronics.
Wes -- "Additionally as a security officer, I carry a gun to protect government officials but my life isn't worth protecting at home in their eyes." Dick Anthony Heller
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
' Started...
' Updated... 10 DEC 2001
' {$STAMP BS2p}
' -----[ Program Description ]--------------------------------------------------
'
' This program demonstrates using the DS1822 in its simplest form for direct
' temperature measurement. With only one sensor, we can use SkipROM and ignore
' the device serial number.
'
' Program output is via DEBUG.
' -----[ Revision History ]-----------------------------------------------------
'
' -----[ I/O Definitions ]------------------------------------------------------
'
OWpin CON 15
' -----[ Constants ]------------------------------------------------------------
'
' 1-Wire Support
'
OW_FERst CON %0001 ' Front-End Reset
OW_BERst CON %0010 ' Back-End Reset
OW_BitMode CON %0100
OW_HighSpd CON %1000
ReadROM CON $33 ' read ID, serial num, CRC
MatchROM CON $55 ' look for specific device
SkipROM CON $CC ' skip rom (one device)
SearchROM CON $F0 ' search
' DS1822 control
'
CnvrtTemp CON $44 ' do temperature conversion
RdScratch CON $BE ' read scratchpad
NoDevice CON %11 ' no device present
DS1822 CON $22 ' device code
DegSym CON 176
' -----[ Variables ]------------------------------------------------------------
'
devCheck VAR Nib ' device check return ocde
idx VAR Byte ' loop counter
romData VAR Byte(8) ' ROM data from DS1820
tempIn VAR Word ' raw temperature
sign VAR tempIn.Bit11 ' 1 = negative temperature
tLo VAR tempIn.LowByte
tHi VAR tempIn.HighByte
tSign VAR Bit
tempC VAR Word ' Celsius
tempF VAR Word ' Fahrenheit
' -----[ EEPROM Data ]----------------------------------------------------------
'
' -----[ Initialization ]-------------------------------------------------------
'
Initialize:
DEBUG CLS
PAUSE 250 ' allow DEBUG screen to open
' -----[ Main Code ]------------------------------------------------------------
'
Main:
GOSUB Device_Check ' look for device
IF (devCheck <> NoDevice) THEN Get_ROM
No_Device_Found:
DEBUG CLS,"No DS1822 present.", CR
DEBUG "-- Insert device and re-start."
END
Get_ROM
OWOUT OWpin,OW_FERst,[ReadROM] ' send Read ROM command
OWIN OWpin,OW_BERst,[STR romData\8] ' read serial number & CRC
IF (romData(0) = DS1822) THEN Show_Data
DEBUG "Installed device is not DS1822", CR
DEBUG "-- Code = ",HEX2 romData(0)
END
Show_Data:
DEBUG Home, "DS1822 Data",CR,CR
DEBUG "Serial Number : "
FOR idx = 6 TO 1
DEBUG HEX2 romData(idx)
NEXT
DEBUG CR," Checksum : ",HEX2 romData(7),CR,CR
Show_Raw:
GOSUB Get_Temp
DEBUG " Raw Input : ",BIN16 tempIn,CR,CR
Display_Temperatures:
DEBUG " Temp C : ", SDEC tempC,DegSym,CR
DEBUG " Temp F : ", SDEC tempF,DegSym,CR
PAUSE 1000
GOTO Main
END
' -----[ Subroutines ]----------------------------------------------------------
'
' This subroutine checks to see if any 1-Wire devices are present on the
' bus. It does NOT search for ROM codes
'
Device_Check:
devCheck = 0
OWOUT OWpin,OW_FERst,[SearchROM] ' reset and start search
OWIN OWpin,OW_BitMode,[devCheck.Bit1,devCheck.Bit0]
RETURN
Get_Temp:
OWOUT OWpin,OW_FERst,[SkipROM,CnvrtTemp] ' send conversion command
PAUSE 500 ' give it some time
OWOUT OWpin,OW_FERst,[SkipROM,RdScratch] ' go get the temperature
OWIN OWpin,OW_BERst,[tLo,tHi]
tSign = sign ' save sign bit
tempC = tempIn
tempC = tempC >> 4 ' round to whole degrees
IF (tSign = 0) THEN NoNegC
tempC = tempC | $FF00 ' extend sign bits for negs
NoNegC:
tempF = tempC */ $01CD ' multiply by 1.8
IF tSign = 0 THEN NoNegF ' if neg, extend sign bits
tempF = tempF | $FF00
NoNegF:
tempF = tempF + 32 ' finish C -> F conversion
RETURN
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
THANKS ROGER!
This is a file I hadn't found. It seems to record the serial number but not temp. on first run:
DS1822 Data
Serial Number : 0000002488F0 Checksum : 6C
Raw Input : 0000010101010000
Temp C : 85 Temp F : 185
I had just a 1/2 hour to play this morning. An ice cube on the sensor or blowing on the sensor doesn't change the reading.
Between this program and the above discussion, there almost proof that sensor is not receiving the command to "convertemperature"
A problem is solved by continually narrowing the scope.
Karl
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Karl Townsend wrote:

Why don't you ask on news:sci.electronics.design?
--
Greed is the root of all eBay.

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Found something that might be of interest to you, expands your I/O, and the app. note if for a keypad and LCD.
http://ww1.microchip.com/downloads/en/AppNotes/01081a.pdf
RogerN
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.