I worked on a project where all of the perf boards we build had a reverse biased diode in
case of a negative spike a person can have the diode clamp the negative voltage and keep
it from blowing the gates
wonder if this hellps anybody, I dont have a BasicX set up I am just a spectator and read
some of the discussions
dan
________________________________
From: patratacus
To: b...@yahoogroups.com
Sent: Tuesday, November 11, 2008 3:40:32 PM
Subject: [BasicX] Re: DS18S20 problem
I did the same thing except on BX-24P itself and I didn't even have a
terrible cold. I pays to double check your connections or have a
robust protection circuits before powering up things. I'm surprised
that BX-24P doesn't have any reverse polarity protection on it. An
expensive lesson ...
-Patrick
--- In basicx@yahoogroups. com, "David E. Basile" wrote:
>
> James,
>
> Yep, it is shot. I move them and wired it up backwards. Valuable
lesson... don't do this kind of stuff when you have a terrible cold
and not feeling well!!!! I looked at the datasheet but got the pins
mixed up.
>
> Thanks
> David
> ----- Original Message -----
> From: James R. Parish
> To: basicx@yahoogroups. com
> Sent: Thursday, March 27, 2008 9:27 PM
> Subject: RE: [BasicX] DS18S20 problem
> It's probably shot. I was using one on my breadboard and one wire
> pulled out. I plugged it back in with the power on and
> zapp-o, 85C. I read somewhere the firmware in these sometimes get
> scrambled but I can't remember if there was a way to fix it.
>
> From: basicx@yahoogroups. com
> [mailto:basicx@yahoogroups. com] On Behalf Of David E. Basile
> Sent: Saturday, March 22, 2008 9:57 AM
> To: basicx@yahoogroups. com
> Subject: [BasicX] DS18S20 problem
>
> I'm having problems with my DS18S20 and was wondering if
> there is a good way
> to test it. I had this working at one time and moved my
> work bench around
> and now it has stopped. I've moved the DS18S20 to a
> seperate breadboard and
> now it is the only thing connected to the BX24 and it
> still reads 85C. I
> tried another BX24, Carrier and power supply just to
> make sure and even
> tried a different DS18S20 with the same results. I
> changed these out 1 by 1
> and tested each time.
>
> The DS18S20 is tied to pin 13 via a pullup resistor
> (4.7k) and pins 1 and 2
> are grounded. In the code I changed the hard logic one
> pullup time from .5
> to .75. With the component changes I made listed above I
> would have thought
> I would have found the problem in one of them but I keep
> getting the power
> on reset value of +85C. Is there a simple way to test
> this or some sort of
> diagnostic I can perform. I can't believe that by just
> moving this from one
> bench to another I've changed something.
> I'm using Peter Anderson's code with listed below with
> some small
> modifications.
>
> Private Const InputBufferSize As Integer = 13 ' 4-byte
> buffer.
> Private Const OutputBufferSize As Integer = 10 ' 1-byte
> buffer.
>
> Private InputBuffer( 1 To InputBufferSize) As Byte
> Private OutputBuffer( 1 To OutputBufferSize) As Byte
>
> Sub Main()
>
> Dim N as Integer
> Dim Dat(1 To 9) as Byte
>
> Dim T_C as Single
>
> Call OpenSerialPort( 1, 19200)
> Dim B as Byte
>
> Do
>
> Call Init_1W(13)
> Call OutByte_1W(13, &Hcc) ' skip ROM
>
> Call OutByte_1W(13, &H44) ' perform temperature
> conversion
> Call StrongPullup_ 1W(13) ' strong pullup
>
> Call Init_1W(13)
> Call OutByte_1W(13, &Hcc) ' skip ROM
>
> Call OutByte_1W(13, &Hbe) ' get temperature data
>
> For N = 1 to 9
> Dat(N) = InByte_1W(13) ' fetch the nine bytes
> Next
>
> For N = 1 to 9
> Call PutHexB(Dat( N))
>
> Next
>
> If (Dat(2) = 0) Then ' its postive
> T_C = CSng(Dat(1)) / 2.0
> Else
> Dat(1) = (Dat(1) XOR &Hff) + 1 ' takes the 2's comp
> T_C = CSng(Dat(1)) / 2.0
> End If
>
> debug.print cstr(t_c) ' What is the temp?
> Loop
> End Sub
>
> Sub Init_1W(ByVal Pin as Byte) ' bring Pin low for 500
> usecs and then back
> ' high
>
> Dim N as Integer
> Call PutPin(Pin, 2) ' be sure DQ is an input
>
> Call PutPin(Pin, 0)
> For N = 1 to 3 ' adjust for 500 usec delay
> Next
>
> Call PutPin(Pin, 2)
>
> For N = 1 to 3
> Next
>
> End Sub
>
> Function InByte_1W(ByVal Pin as Byte) as Byte
>
> Dim N as Integer, IByte as Byte, B as Byte
> For N =1 to 8
> B = Get1Wire(Pin)
> If (B=1) then
> IByte = (IByte\2) OR bx10000000
> Else
> IByte = IByte\2
> End If
> Next
>
> InByte_1W = IByte
>
> End Function
>
> Sub OutByte_1W(ByVal Pin as Byte, ByVal OByte as Byte)
>
> Dim N as Integer, B as Byte
> For N = 1 to 8
> B = OByte AND bx00000001
> If (B=1) Then
> Call Put1Wire(Pin, 1)
> Else
> Call Put1Wire(Pin, 0)
> End If
> OByte = OByte \ 2
> Next
> End Sub
>
> Sub StrongPullUp_ 1W(ByVal Pin as Byte)
> ' Provide a hard logic one for 0.5 secs
> Call PutPin(Pin, 1)
> Call Sleep(0.75) ' Changed from .5 to .75
> Call PutPin(Pin, 2)
> End Sub
>
> Sub PutHexB(ByVal X as Byte) ' display a byte in hex
> format
> Dim Y as Byte
>
> Y= X \ 16 ' convert high nibble to character
> If (Y < 10) then
> Y = Y + Asc("0")
> Else
> Y = Y - 10 + Asc ("A")
> End If
>
> Y= X And bx00001111 ' same for low nibble
> If (Y < 10) then
> Y = Y + Asc("0")
> Else
> Y = Y - 10 + Asc ("A")
> End If
>
> End Sub
>
> Public Sub OpenSerialPort( _
> ByVal PortNumber As Byte, _
> ByVal BaudRate As Long)
>
> Call OpenQueue(InputBuff er, InputBufferSize)
> Call OpenQueue(OutputBuf fer, OutputBufferSize)
> Call OpenCom(PortNumber, BaudRate, InputBuffer,
> OutputBuffer)
>
> End Sub
> [Non-text portions of this message have been removed]
>
> [Non-text portions of this message have been removed]
>
[Non-text portions of this message have been removed]
------------------------------------

(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )
If you can use a diode to protect your circuit I think it's a good idea. Ei=
ther use one forward biased when polarity is correct if you can lose the 7/=
10Th's of a volt. But I usually use the diode across the power and have it =
forward bias in wrong polarity mode causing=A0 a fuse to open. But I think =
you are thinking of the diode being used to protect against the inductive k=
ick generated from the collapse of electromagnetic field, generating the re=
versed polarity spike. Not using that diode, or other method=A0across the r=
elay coil or other inductive load in close proximity of your micro will cau=
se the micro to lock up, or operate improperly. When driving AC loads you n=
eed to use zero switching triacs so that the transition is during zero volt=
time so you don't get the inductive kick. Hope this is helpful....
--- On Wed, 11/12/08, daniel labelle
wrote:
From: daniel labelle
Subject: Re: [BasicX] Re: DS18S20 problem
To: b...@yahoogroups.com
Date: Wednesday, November 12, 2008, 5:40 AM
I worked on a project where all of the perf boards we build had a reverse b=
iased diode in case of a negative spike a person can have the diode clamp t=
he negative voltage and keep it from blowing the gates
wonder if this hellps anybody, I dont have a BasicX set up I am just a spec=
tator and read some of the discussions=20
dan
____________ _________ _________ __
From: patratacus
To: basicx@yahoogroups. com
Sent: Tuesday, November 11, 2008 3:40:32 PM
Subject: [BasicX] Re: DS18S20 problem
I did the same thing except on BX-24P itself and I didn't even have a
terrible cold. I pays to double check your connections or have a
robust protection circuits before powering up things. I'm surprised
that BX-24P doesn't have any reverse polarity protection on it. An
expensive lesson ...
-Patrick
--- In basicx@yahoogroups. com, "David E. Basile" wrote:
>
> James,
>=20
> Yep, it is shot. I move them and wired it up backwards. Valuable
lesson... don't do this kind of stuff when you have a terrible cold
and not feeling well!!!! I looked at the datasheet but got the pins
mixed up.
>=20
> Thanks
> David
> ----- Original Message -----=20
> From: James R. Parish=20
> To: basicx@yahoogroups. com=20
> Sent: Thursday, March 27, 2008 9:27 PM
> Subject: RE: [BasicX] DS18S20 problem
>=20
>=20
> It's probably shot. I was using one on my breadboard and one wire
> pulled out. I plugged it back in with the power on and=20
> zapp-o, 85C. I read somewhere the firmware in these sometimes get
> scrambled but I can't remember if there was a way to fix it.
>=20
> From: basicx@yahoogroups. com
> [mailto:basicx@ yahoogroups. com] On Behalf Of David E. Basile
> Sent: Saturday, March 22, 2008 9:57 AM
> To: basicx@yahoogroups. com
> Subject: [BasicX] DS18S20 problem
>=20
> I'm having problems with my DS18S20 and was wondering if
> there is a good way
> to test it. I had this working at one time and moved my
> work bench around
> and now it has stopped. I've moved the DS18S20 to a
> seperate breadboard and
> now it is the only thing connected to the BX24 and it
> still reads 85C. I
> tried another BX24, Carrier and power supply just to
> make sure and even
> tried a different DS18S20 with the same results. I
> changed these out 1 by 1
> and tested each time.
>=20
> The DS18S20 is tied to pin 13 via a pullup resistor
> (4.7k) and pins 1 and 2
> are grounded. In the code I changed the hard logic one
> pullup time from .5
> to .75. With the component changes I made listed above I
> would have thought
> I would have found the problem in one of them but I keep
> getting the power
> on reset value of +85C. Is there a simple way to test
> this or some sort of
> diagnostic I can perform. I can't believe that by just
> moving this from one
> bench to another I've changed something.=20
>=20
>=20
> I'm using Peter Anderson's code with listed below with
> some small
> modifications.
>=20
> Private Const InputBufferSize As Integer =3D 13 ' 4-byte
> buffer.
> Private Const OutputBufferSize As Integer =3D 10 ' 1-byte
> buffer.
>=20
> Private InputBuffer( 1 To InputBufferSize) As Byte
> Private OutputBuffer( 1 To OutputBufferSize) As Byte
>=20
> Sub Main()
>=20
> Dim N as Integer
> Dim Dat(1 To 9) as Byte
>=20
> Dim T_C as Single
>=20
> Call OpenSerialPort( 1, 19200)
> Dim B as Byte
>=20
> Do=20
>=20
> Call Init_1W(13)
> Call OutByte_1W(13, &Hcc) ' skip ROM
>=20
> Call OutByte_1W(13, &H44) ' perform temperature
> conversion
> Call StrongPullup_ 1W(13) ' strong pullup
>=20
> Call Init_1W(13)
> Call OutByte_1W(13, &Hcc) ' skip ROM
>=20
> Call OutByte_1W(13, &Hbe) ' get temperature data
>=20
> For N =3D 1 to 9=20
> Dat(N) =3D InByte_1W(13) ' fetch the nine bytes=20
> Next
>=20
> For N =3D 1 to 9
> Call PutHexB(Dat( N))
>=20
> Next=20
>=20
> If (Dat(2) =3D 0) Then ' its postive
> T_C =3D CSng(Dat(1)) / 2.0
> Else
> Dat(1) =3D (Dat(1) XOR &Hff) + 1 ' takes the 2's comp
> T_C =3D CSng(Dat(1)) / 2.0
> End If
>=20
> debug.print cstr(t_c) ' What is the temp?
> Loop
> End Sub
>=20
> Sub Init_1W(ByVal Pin as Byte) ' bring Pin low for 500
> usecs and then back=20
> ' high
>=20
> Dim N as Integer
> Call PutPin(Pin, 2) ' be sure DQ is an input
>=20
> Call PutPin(Pin, 0)=20
>=20
>=20
> For N =3D 1 to 3 ' adjust for 500 usec delay
> Next
>=20
> Call PutPin(Pin, 2)
>=20
> For N =3D 1 to 3
> Next
>=20
> End Sub
>=20
> Function InByte_1W(ByVal Pin as Byte) as Byte
>=20
> Dim N as Integer, IByte as Byte, B as Byte
> For N =3D1 to 8
> B =3D Get1Wire(Pin)
> If (B=3D1) then
> IByte =3D (IByte\2) OR bx10000000
> Else
> IByte =3D IByte\2=20
> End If
> Next
>=20
> InByte_1W =3D IByte
>=20
> End Function
>=20
> Sub OutByte_1W(ByVal Pin as Byte, ByVal OByte as Byte)
>=20
> Dim N as Integer, B as Byte
> For N =3D 1 to 8
> B =3D OByte AND bx00000001
> If (B=3D1) Then
> Call Put1Wire(Pin, 1)
> Else
> Call Put1Wire(Pin, 0)
> End If
> OByte =3D OByte \ 2
> Next
> End Sub=20
>=20
> Sub StrongPullUp_ 1W(ByVal Pin as Byte)
> ' Provide a hard logic one for 0.5 secs
> Call PutPin(Pin, 1)
> Call Sleep(0.75) ' Changed from .5 to .75
> Call PutPin(Pin, 2)
> End Sub
>=20
> Sub PutHexB(ByVal X as Byte) ' display a byte in hex
> format
> Dim Y as Byte
>=20
> Y=3D X \ 16 ' convert high nibble to character
> If (Y < 10) then
> Y =3D Y + Asc("0")
> Else
> Y =3D Y - 10 + Asc ("A")
> End If
>=20
> Y=3D X And bx00001111 ' same for low nibble
> If (Y < 10) then
> Y =3D Y + Asc("0")
> Else
> Y =3D Y - 10 + Asc ("A")
> End If
>=20
> End Sub
>=20
> Public Sub OpenSerialPort( _
> ByVal PortNumber As Byte, _
> ByVal BaudRate As Long)
>=20
> Call OpenQueue(InputBuff er, InputBufferSize)
> Call OpenQueue(OutputBuf fer, OutputBufferSize)
> Call OpenCom(PortNumber, BaudRate, InputBuffer,
> OutputBuffer)
>=20
> End Sub
>=20
>=20
> [Non-text portions of this message have been removed]
>=20
>=20
>=20
>=20
>=20
> [Non-text portions of this message have been removed]
>
[Non-text portions of this message have been removed]
=20
=20=20=20=20=20=20
[Non-text portions of this message have been removed]
------------------------------------
______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.

(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )