EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

USB circuit disconnects when the circuit is put near another surface

Started by Unknown January 28, 2008
Hello,

I have built a basic circuit for the PIC18f4550 using a 20 MHz crystal
from http://www.create.ucsb.edu/~dano/CUI/ .  I have installed the HID
firmware from http://www.lvr.com/usb.htm (USB complete).  The circuit
works fine and connects ok then installs the driver as long as it is
suspended in free space.

As soon as the circuit comes near ( 2-3 cm) another surface (paper or
the wooden table) the usb disconnects.  When I investigated I found
the voltage on D+ signal line went down from the required 3.1V(approx)
to 1.45V as it neared the surface, thus initiating the disconnection.

Connecting just the ground side of an oscilloscope to the ground on
the circuit also cured the problem.  I have no idea how to modify the
circuit to make it more stable.  I assume it is interference in the
clock signal that is causing the problem, although this is only a
guess.

Any help would be greatly appreciated.

Best regards

Mike.

<caagal@googlemail.com> wrote in message
news:0a55d245-04c6-4a73-a053-b1bcc8bb2167@v29g2000hsf.googlegroups.com...
> Hello, > > I have built a basic circuit for the PIC18f4550 using a 20 MHz crystal > from http://www.create.ucsb.edu/~dano/CUI/ . I have installed the HID > firmware from http://www.lvr.com/usb.htm (USB complete). The circuit > works fine and connects ok then installs the driver as long as it is > suspended in free space. > > As soon as the circuit comes near ( 2-3 cm) another surface (paper or > the wooden table) the usb disconnects. When I investigated I found > the voltage on D+ signal line went down from the required 3.1V(approx) > to 1.45V as it neared the surface, thus initiating the disconnection. > > Connecting just the ground side of an oscilloscope to the ground on > the circuit also cured the problem.
Seems to me there is no ground connection between the PC and the CUI board.... Meindert
On Monday, in article
     <479defe5$0$22821$e4fe514c@dreader18.news.xs4all.nl>
     ms@NOJUNKcustomORSPAMware.nl "Meindert Sprang" wrote:

><caagal@googlemail.com> wrote in message >news:0a55d245-04c6-4a73-a053-b1bcc8bb2167@v29g2000hsf.googlegroups.com... >> Hello, >> >> I have built a basic circuit for the PIC18f4550 using a 20 MHz crystal >> from http://www.create.ucsb.edu/~dano/CUI/ . I have installed the HID >> firmware from http://www.lvr.com/usb.htm (USB complete). The circuit >> works fine and connects ok then installs the driver as long as it is >> suspended in free space. >> >> As soon as the circuit comes near ( 2-3 cm) another surface (paper or >> the wooden table) the usb disconnects. When I investigated I found >> the voltage on D+ signal line went down from the required 3.1V(approx) >> to 1.45V as it neared the surface, thus initiating the disconnection. >> >> Connecting just the ground side of an oscilloscope to the ground on >> the circuit also cured the problem. > >Seems to me there is no ground connection between the PC and the CUI >board....
Yes but caused by an intermittent connection on the ground as the circuit is moved nearer the surface something is flexing, causing an open circuit. Whenever movement causes a problem I look for intermittent connections or cable breaks. -- Paul Carpenter | paul@pcserviceselectronics.co.uk <http://www.pcserviceselectronics.co.uk/> PC Services <http://www.gnuh8.org.uk/> GNU H8 & mailing list info <http://www.badweb.org.uk/> For those web sites you hate
On 29 Jan, 15:39, pa...@pcserviceselectronics.co.uk (Paul Carpenter)
wrote:
> On Monday, in article > =A0 =A0 =A0<479defe5$0$22821$e4fe5...@dreader18.news.xs4all.nl> > =A0 =A0 =A0m...@NOJUNKcustomORSPAMware.nl "Meindert Sprang" wrote: > > > > > > ><caa...@googlemail.com> wrote in message > >news:0a55d245-04c6-4a73-a053-b1bcc8bb2167@v29g2000hsf.googlegroups.com...=
> >> Hello, > > >> I have built a basic circuit for the PIC18f4550 using a 20 MHz crystal > >> fromhttp://www.create.ucsb.edu/~dano/CUI/. =A0I have installed the HID > >> firmware fromhttp://www.lvr.com/usb.htm(USB complete). =A0The circuit > >> works fine and connects ok then installs the driver as long as it is > >> suspended in free space. > > >> As soon as the circuit comes near ( 2-3 cm) another surface (paper or > >> the wooden table) the usb disconnects. =A0When I investigated I found > >> the voltage on D+ signal line went down from the required 3.1V(approx) > >> to 1.45V as it neared the surface, thus initiating the disconnection. > > >> Connecting just the ground side of an oscilloscope to the ground on > >> the circuit also cured the problem. > > >Seems to me there is no ground connection between the PC and the CUI > >board.... > > Yes but caused by an intermittent connection on the ground as the circuit > is moved nearer the surface something is flexing, causing an open circuit.=
> > Whenever movement causes a problem I look for intermittent connections or > cable breaks. > > -- > Paul Carpenter =A0 =A0 =A0 =A0 =A0| p...@pcserviceselectronics.co.uk > <http://www.pcserviceselectronics.co.uk/> =A0 =A0PC Services > <http://www.gnuh8.org.uk/> =A0 =A0 =A0 =A0 =A0 =A0 =A0GNU H8 & mailing lis=
t info
> <http://www.badweb.org.uk/> =A0 =A0 =A0 =A0 =A0 =A0 For those web sites yo=
u hate- Hide quoted text -
> > - Show quoted text -
Thanks for the advice. However the circuit definately disconnects when something is brought to within approximately 1-2 cm of it. To prove this I clamped the USB plug with the circuit board in free space vertically. With no contact at all with the circuit board and it not moving, a book brought slowly towards the circuit makes it disconnect once it comes within 1-2 cm and reconnects when I take it away. I have tried swapping the usb cable and measured the resistance of the board ground to the computer end of the usb cable, they are all fine. I have connected all the ground points shown in the circuit to the ground of the usb supply (pin 4), should there need to be any connection to the usb cable sheath earth? Or does it need to be in a metal box connected to the sheath to stop the stray reflections? Thanks Mike.
caagal@googlemail.com wrote:

<snip>
> Thanks for the advice. However the circuit definately disconnects > when something is brought to within approximately 1-2 cm of it. To > prove this I clamped the USB plug with the circuit board in free space > vertically. With no contact at all with the circuit board and it not > moving, a book brought slowly towards the circuit makes it disconnect > once it comes within 1-2 cm and reconnects when I take it away. >
<snip> Hey Lewin, Remember your thread on the proximity detector in the supermarket freezer island? Michael
On Jan 29, 8:30=A0pm, caa...@googlemail.com wrote:
> On 29 Jan, 15:39, pa...@pcserviceselectronics.co.uk (Paul Carpenter) > wrote: > > > > > > > On Monday, in article > > =A0 =A0 =A0<479defe5$0$22821$e4fe5...@dreader18.news.xs4all.nl> > > =A0 =A0 =A0m...@NOJUNKcustomORSPAMware.nl "Meindert Sprang" wrote: > > > ><caa...@googlemail.com> wrote in message > > >news:0a55d245-04c6-4a73-a053-b1bcc8bb2167@v29g2000hsf.googlegroups.com.=
..
> > >> Hello, > > > >> I have built a basic circuit for the PIC18f4550 using a 20 MHz crysta=
l
> > >> fromhttp://www.create.ucsb.edu/~dano/CUI/. =A0I have installed the HI=
D
> > >> firmware fromhttp://www.lvr.com/usb.htm(USBcomplete). =A0The circuit > > >> works fine and connects ok then installs the driver as long as it is > > >> suspended in free space. > > > >> As soon as the circuit comes near ( 2-3 cm) another surface (paper or=
> > >> the wooden table) the usb disconnects. =A0When I investigated I found=
> > >> the voltage on D+ signal line went down from the required 3.1V(approx=
)
> > >> to 1.45V as it neared the surface, thus initiating the disconnection.=
> > > >> Connecting just the ground side of an oscilloscope to the ground on > > >> the circuit also cured the problem. > > > >Seems to me there is no ground connection between the PC and the CUI > > >board.... > > > Yes but caused by an intermittent connection on the ground as the circui=
t
> > is moved nearer the surface something is flexing, causing an open circui=
t.
> > > Whenever movement causes a problem I look for intermittent connections o=
r
> > cable breaks. > > > -- > > Paul Carpenter =A0 =A0 =A0 =A0 =A0| p...@pcserviceselectronics.co.uk > > <http://www.pcserviceselectronics.co.uk/> =A0 =A0PC Services > > <http://www.gnuh8.org.uk/> =A0 =A0 =A0 =A0 =A0 =A0 =A0GNU H8 & mailing l=
ist info
> > <http://www.badweb.org.uk/> =A0 =A0 =A0 =A0 =A0 =A0 For those web sites =
you hate- Hide quoted text -
> > > - Show quoted text - > > Thanks for the advice. =A0However the circuit definately disconnects > when something is brought to within approximately 1-2 cm of it. =A0To > prove this I clamped the USB plug with the circuit board in free space > vertically. =A0With no contact at all with the circuit board and it not > moving, a book brought slowly towards the circuit makes it disconnect > once it comes within 1-2 cm and reconnects when I take it away. > > I have tried swapping the usb cable and measured the resistance of the > board ground to the computer end of the usb cable, they are all fine. > > I have connected all the ground points shown in the circuit to the > ground of the usb supply (pin 4), should there need to be any > connection to the usb cable sheath earth? =A0Or does it need to be in a > metal box connected to the sheath to stop the stray reflections? > > Thanks > > Mike.- Hide quoted text - > > - Show quoted text -
Sounds like the reset pin on the PIC is floating..
caagal@googlemail.com wrote:
<snip>
> I have tried swapping the usb cable and measured the resistance of the > board ground to the computer end of the usb cable, they are all fine. > > I have connected all the ground points shown in the circuit to the > ground of the usb supply (pin 4), should there need to be any > connection to the usb cable sheath earth? Or does it need to be in a > metal box connected to the sheath to stop the stray reflections? >
I always have an independent wire connecting the PC chassis to the ground on a board before connecting either USB or parallel port (e.g., debuggers) to a board. RS-232 connections work fine, but USB and parallel ports are much more affected by ground noise. The extra wire has made a clear difference to the reliability of USB devices in a number of setups.
In article <bcf116ff-811c-4689-907d-0690213a4b7a@q21g2000hsa.googlegroups.com>, caagal@googlemail.com wrote:
>> >> I have built a basic circuit for the PIC18f4550 using a 20 MHz crystal >> >> fromhttp://www.create.ucsb.edu/~dano/CUI/. =A0I have installed the HID >> >> firmware fromhttp://www.lvr.com/usb.htm(USB complete). =A0The circuit >> >> works fine and connects ok then installs the driver as long as it is >> >> suspended in free space. >> >> >> As soon as the circuit comes near ( 2-3 cm) another surface (paper or >> >> the wooden table) the usb disconnects. =A0When I investigated I found >> >> the voltage on D+ signal line went down from the required 3.1V(approx) >> >> to 1.45V as it neared the surface, thus initiating the disconnection. >> > >Thanks for the advice. However the circuit definately disconnects >when something is brought to within approximately 1-2 cm of it. To >prove this I clamped the USB plug with the circuit board in free space >vertically. With no contact at all with the circuit board and it not >moving, a book brought slowly towards the circuit makes it disconnect >once it comes within 1-2 cm and reconnects when I take it away. > >I have tried swapping the usb cable and measured the resistance of the >board ground to the computer end of the usb cable, they are all fine. > >I have connected all the ground points shown in the circuit to the >ground of the usb supply (pin 4), should there need to be any >connection to the usb cable sheath earth? Or does it need to be in a >metal box connected to the sheath to stop the stray reflections?
Could be that your 20MHz oscillator is barely oscillating. Check the solder connections on both legs of the crystal, and make sure the connections between the crystal and OSC1 / OSC2 are as short as possible and not accidentally connected to ground or to the case of the crystal. Also make sure that you're using the proper type crystal (series / parallel) and the proper load capacitance; something around 18pF should be fine. Also make sure you have the proper oscillator type selected in your config fuses (address 300001), I believe it should be set to HSPLL (bits 3-0 set to 111x) for full speed USB. --Tom.
"Rocky" <RobertGush@gmail.com> wrote in message 
news:0d9d49e5-76f7-42ff-8b1e-ff7eacec6b5a@i12g2000prf.googlegroups.com...
On Jan 29, 8:30 pm, caa...@googlemail.com wrote:
> On 29 Jan, 15:39, pa...@pcserviceselectronics.co.uk (Paul Carpenter) > wrote: > > > > > > > On Monday, in article > > <479defe5$0$22821$e4fe5...@dreader18.news.xs4all.nl> > > m...@NOJUNKcustomORSPAMware.nl "Meindert Sprang" wrote: > > > ><caa...@googlemail.com> wrote in message > > >news:0a55d245-04c6-4a73-a053-b1bcc8bb2167@v29g2000hsf.googlegroups.com... > > >> Hello, > > > >> I have built a basic circuit for the PIC18f4550 using a 20 MHz > > >> crystal > > >> fromhttp://www.create.ucsb.edu/~dano/CUI/. I have installed the HID > > >> firmware fromhttp://www.lvr.com/usb.htm(USBcomplete). The circuit > > >> works fine and connects ok then installs the driver as long as it is > > >> suspended in free space. > > > >> As soon as the circuit comes near ( 2-3 cm) another surface (paper or > > >> the wooden table) the usb disconnects. When I investigated I found > > >> the voltage on D+ signal line went down from the required > > >> 3.1V(approx) > > >> to 1.45V as it neared the surface, thus initiating the disconnection. > > > >> Connecting just the ground side of an oscilloscope to the ground on > > >> the circuit also cured the problem. > > > >Seems to me there is no ground connection between the PC and the CUI > > >board.... > > > Yes but caused by an intermittent connection on the ground as the > > circuit > > is moved nearer the surface something is flexing, causing an open > > circuit. > > > Whenever movement causes a problem I look for intermittent connections > > or > > cable breaks. > > > -- > > Paul Carpenter | p...@pcserviceselectronics.co.uk > > <http://www.pcserviceselectronics.co.uk/> PC Services > > <http://www.gnuh8.org.uk/> GNU H8 & mailing list info > > <http://www.badweb.org.uk/> For those web sites you hate- Hide quoted > > text - > > > - Show quoted text - > > Thanks for the advice. However the circuit definately disconnects > when something is brought to within approximately 1-2 cm of it. To > prove this I clamped the USB plug with the circuit board in free space > vertically. With no contact at all with the circuit board and it not > moving, a book brought slowly towards the circuit makes it disconnect > once it comes within 1-2 cm and reconnects when I take it away. > > I have tried swapping the usb cable and measured the resistance of the > board ground to the computer end of the usb cable, they are all fine. > > I have connected all the ground points shown in the circuit to the > ground of the usb supply (pin 4), should there need to be any > connection to the usb cable sheath earth? Or does it need to be in a > metal box connected to the sheath to stop the stray reflections? > > Thanks > > Mike.- Hide quoted text - > > - Show quoted text -
Sounds like the reset pin on the PIC is floating.. ........or the low voltage program input pin is enabled - I'm not sure about the PIC18f4550, but I had a similar experience with a 'F877.
On 30 Jan, 03:59, t...@nospam.com (Tom) wrote:
> In article <bcf116ff-811c-4689-907d-0690213a4...@q21g2000hsa.googlegroups.=
com>, caa...@googlemail.com wrote:
> > > > > > >> >> I have built a basic circuit for the PIC18f4550 using a 20 MHz cryst=
al
> >> >> fromhttp://www.create.ucsb.edu/~dano/CUI/. =3DA0I have installed the=
HID
> >> >> firmware fromhttp://www.lvr.com/usb.htm(USBcomplete). =3DA0The circu=
it
> >> >> works fine and connects ok then installs the driver as long as it is=
> >> >> suspended in free space. > > >> >> As soon as the circuit comes near ( 2-3 cm) another surface (paper o=
r
> >> >> the wooden table) the usb disconnects. =3DA0When I investigated I fo=
und
> >> >> the voltage on D+ signal line went down from the required 3.1V(appro=
x)
> >> >> to 1.45V as it neared the surface, thus initiating the disconnection=
.
> > >Thanks for the advice. =A0However the circuit definately disconnects > >when something is brought to within approximately 1-2 cm of it. =A0To > >prove this I clamped the USB plug with the circuit board in free space > >vertically. =A0With no contact at all with the circuit board and it not > >moving, a book brought slowly towards the circuit makes it disconnect > >once it comes within 1-2 cm and reconnects when I take it away. > > >I have tried swapping the usb cable and measured the resistance of the > >board ground to the computer end of the usb cable, they are all fine. > > >I have connected all the ground points shown in the circuit to the > >ground of the usb supply (pin 4), should there need to be any > >connection to the usb cable sheath earth? =A0Or does it need to be in a > >metal box connected to the sheath to stop the stray reflections? > > Could be that your 20MHz oscillator is barely oscillating. Check the solde=
r
> connections on both legs of the crystal, and make sure the connections bet=
ween
> the crystal and OSC1 / OSC2 are as short as possible and not accidentally > connected to ground or to the case of the crystal. Also make sure that you=
're
> using the proper type crystal (series / parallel) and the proper load > capacitance; something around 18pF should be fine. Also make sure you have=
the
> proper oscillator type selected in your config fuses (address 300001), I > believe it should be set to HSPLL (bits 3-0 set to 111x) for full speed US=
B.
> > --Tom.- Hide quoted text - > > - Show quoted text -
Cracked it! You were right about the poor clock. I had a poor connection on the crystal which I had missed on many checks. Resoldered the crystal and I can now place the circuit board anywhere and it stays connected. The reflections from a nearby surface must have been just enough to overwhelm it. Thanks for all the help, I can now spend the rest of the day working out how to use the outputs of the chip. As you have probably guessed these microcontrollers are all brand new to me. Mike.

The 2024 Embedded Online Conference