Shop OBEX P1 Docs P2 Docs Learn Events
DS2450 problem with nv82 basic code — Parallax Forums

DS2450 problem with nv82 basic code

bobhillierbobhillier Posts: 27
edited 2004-08-08 18:20 in BASIC Stamp
I am trying to measure wind direction on a Dallas 1-wire device with my BS2p24. I have used the nv82 article as a base for temperature, humidity, wind speed and wind direction measurements. All other devices measure correctly. The wind direction device (DS2450) does not work. I have confirmed the DS2450 direction device works with a PC based program called Weather Display and the AAG basic program. I have confirmed the correct 64 bit address is being used.

I can’t get the DS2450 to report correctly.

The first attempt to communicate specifically with this device (other then device_id detection) is to program the device for 8 bit mode and 5.10v peak voltage detection.

I have used the following code fragment and do not receive the correct verification data from the DS2450. This is the exact same code used in the nv82 example.

Show_Wind_Dir:
· eeAddr = DS2450
· GOSUB Load_SN
· OWOUT OWpin, OW_FERst, [noparse][[/noparse]MatchROM_DS2450, STR romData\8, WriteMem, $08, $00]
·
· FOR idx = 1 TO 4····························· ' setup four channels
··· OWOUT OWpin, OW_NoRst, [noparse][[/noparse]$08]··············· ' 8-bit values
··· OWIN· OWpin, OW_NoRst, [noparse][[/noparse]crc16.LOWBYTE, crc16.HIGHBYTE, verify]
······· DEBUG 2, 0, 8+(idx*2), "crc16 ", HEX2 crc16.LOWBYTE, " ", HEX2 crc16.HIGHBYTE, " ", HEX2 verify
··· OWOUT OWpin, OW_NoRst, [noparse][[/noparse]$01]··············· ' 5.12 volt scale
··· OWIN· OWpin, OW_NoRst, [noparse][[/noparse]crc16.LOWBYTE, crc16.HIGHBYTE, verify]
······· DEBUG 2, 6, 9+(idx*2), HEX2 crc16.LOWBYTE, " ", HEX2 crc16.HIGHBYTE, " ", HEX2 verify
· NEXT

The following screen display shows the values that are printed by the debug statement
crc16 6E 37 08
····· FE 39 01
crc16 7E 3E 08
····· FF F0 03··· ß should be 01
crc16 FB E7 10··· ß should be 08
· ····FF D1 04··· ß should be 01
crc16 FF BB 1A··· ß should be 08
····· DF 77 0E··· ß should be 01

The first line correctly shows the verify bytes 08 and 01 on each line. The next line pairs do not show the correct verify bytes. (They should also be 08 and 01.)

Can anyone suggest why these verify bytes are not correct? They should be echoes of the 08 and 01 written inside the loop.

I have read the DS2450 spec cover to cover. As near as I can tell this programming sequence is correct.

Any suggestions are grateful.



▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
······ Bob, Ottawa
W75 54 17·· N45 18 30
·········· G16 #27
Sign In or Register to comment.