Searching \ for '[PIC] Dumb PIC mistakes and solderless breadboards' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: 'Dumb PIC mistakes and solderless breadboards'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] Dumb PIC mistakes and solderless breadboards'
2011\01\19@155838 by Bob Blick

face
flavicon
face
This is sort of EE but has a lot of PIC too.

I have been stealing five minutes here and there from my normal vicious
maligning to build the IR remote control audio attenuator I mentioned a
while back.

But only getting a few minutes here and there right before bedtime is
not always the best time to write code - you write fast and don't have
time to write much, or to review what you wrote earlier, and you're
sleepy. All very sloppy. Recipe for disaster.

I needed to figure out what codes my TV remote sent for volume up and
volume down, so I put an IR receiver, a PIC12F629 and a DB9 connector on
a solderless breadboard and wrote a program to decode NEC IR protocol
and output it at 2400 baud. Yes I also had a decoupling cap each for the
PIC and the IR receiver.

The bitbanged serial port worked fine but my IR decode was stuck so the
first thing I looked for was pin settings. In my code I had defined the
IR input as GPIO4 but my TRIS line was 00001000 so I had GPIO3 as the
input. Oops, I thought, bad TRIS.

I changed the TRIS to 00010000 and the program worked. Sort of. It would
always work for about 15 seconds after turning on the power, or if I
held a remote button for continuous repeat.
I added a debug output twice a second, outputting where in the state
machine it was, and I could see it advance and stick at the second
state. If I forced the PIC's pin high or low, it would read it correctly
for a few seconds and then always see it low.

Weird, could I have a bad PIC? But it was one that had been kicking
around, so I figured it could be. I grabbed a new chip and it worked
fine.

Last night I took a few extra minutes to review my code in preparation
for doing a PC board layout and realized nothing was connected to GPIO4.
I had the IR receiver going to pin 4, which is GPIO3 and also MCLR. In
my sleepy head at one point I must have seen pin 4 on my breadboard and
typed GPIO4 in the code instead of GPIO3.

Since MCLR is input-only, it didn't short out the IR receiver, and the
pin that was looking for the signal was just getting a little stray
coupling and that's the only reason anything worked. It didn't work the
same on both chips because the leakage of the two was different.

I changed the pin definition and the TRIS line to reflect the actual
configuration, and both chips worked when programmed.

So the huge amount of crosstalk in the solderless breadboard was the
only reason it sort of worked.

Boy, did I feel dumb!

Bob

-- http://www.fastmail.fm - IMAP accessible web-mail

2011\01\19@163919 by Olin Lathrop

face picon face
Bob Blick wrote:
> In my code I had
> defined the IR input as GPIO4 but my TRIS line was 00001000 so I had
> GPIO3 as the input. Oops, I thought, bad TRIS.

Now might be a good time to look at my preprocessor, which includes the
/INBIT command.  You define what all pins do in one place in the project
include file, and everything is derived from that automatically.  If you
define at pin as /INBIT, the tris bit will be set automatically when you
call the provided PORT_INIT routine.  Similarly the tris bit gets cleared if
the pin is defined with /OUTBIT.

The /INBIT and /OUTBIT commands give their pins names, and the rest of the
code deals only with those names and not the physical port and bit number.
That allows redefining pins as development progresses, with only a single
source line change for each pin change.

> Boy, did I feel dumb!

Most bugs are dumb after the fact.

I ran code just now for the very first time on a 33FJ32GP202 project.  Among
other things, it is suppsed to blink a LED at 1Hz and toggle a test point
every 1ms.  The LED blinks at 1/2 Hz and the test point is toggled at 2ms.
I must have screwed up the clock chain somewhere to be off by a factor of 2..
It will be a dumb mistake when I find it, but that's how it goes.  Actually
I'm pleased it ran at all the very first time.  A 2x clock problem can
probably be found by inspecting the code, but of course I won't know what
exactly the problem is until it's fixed.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000

2011\01\19@165324 by Olin Lathrop

face picon face
> I must have screwed up the clock chain somewhere to
> be off by a factor of 2. It will be a dumb mistake when I find it,

Yup.  I had copied some code and changed the comment to say the divider
value was 2, but neglected to actually change the field value.  Duh.
Probably didn't notice because the field value was 2, which looks right, but
which causes a divide by 4.  To make it divide by 2 the field needs to be 0..
Fixed it, everything fine now.

This is all normal stuff during development.  There will always be little
mistakes.  They are only dumb when it takes too long to find them.

Mistakes happen.  Dumbness happens when you waste a lot of time on them or
don't listen to what the symptoms are telling you the cause is.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000

2011\01\19@170210 by Herbert Graf

picon face
On Wed, 2011-01-19 at 12:58 -0800, Bob Blick wrote:
{Quote hidden}

You shouldn't feel dumb at all! I read this and was impressed that
instead of going into "dead fish" territory, you debugged the problem
and found a solution.

I'm amazed how many engineers I encounter that would have thrown up
their hands and walked away when confronted with this sort of problem.

Yes, setting for the wrong pin was a "dumb" mistake, but it's not
something I'd feel "dumb" about in your shoes.

Congrats on figuring it out.

TTYL

2011\01\19@225328 by Charles Craft

picon face
On 1/19/2011 3:58 PM, Bob Blick wrote:
> <snip>
>
> So the huge amount of crosstalk in the solderless breadboard was the
> only reason it sort of worked.
>
> Boy, did I feel dumb!
>
> Bob
>
>    Haven't there been threads over the years that solderless breadboards are evil?

I'm not about to cast the first stone (or breadboard) - I've got a stack of them. :-)

chuck

2011\01\20@081321 by Olin Lathrop

face picon face
Charles Craft wrote:
> Haven't there been threads over the years that solderless breadboards
> are evil?

Of course, since there are always incompetent people that blame their tools
instead of the real problem.  Solderless breadboards can be quite useful.
Like any tool, they have their limitations, but those shouldn't be a issue
for most ordinary PIC circuits.  Adjacent nodes will have some capacitance
between them, but so do parallel traces on a PC board.  Most of the times a
few pF between nodes is expected and not a big deal for a well designed
circuit.  If you have a very sensitive analog circuit where a pF or two
matters, then you should probably be using guard rings and the like anyway.

I've used these solderless breadboards many times, including for PIC
circuits with 20MHz crystals.  I don't remember any problems due to the
nature of the breadboards, although I thought about the characteristics when
building the circuits.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000

2011\01\20@084128 by jimf

flavicon
face

       I regularly do quick test lashups using the breadboards, also using
PIC at 20mhz,
but don't appear to have had any issues.  I don't know how high a clock I would be comfortable lashing up on
these though,  just as well I am a cheapskate when it comes to performance vs power
consumption,  so I don't think i'll be going high Hz any time soon!  On Thu 20/01/11 1:14 PM , "Olin Lathrop" spam_OUTolin_piclistTakeThisOuTspamembedinc.com
sent:
 Charles Craft wrote:
> Haven't there been threads over the years that solderless
breadboards
> are evil?
Of course, since there are always incompetent people that blame
their tools
instead of the real problem. Solderless breadboards can be quite
useful.
Like any tool, they have their limitations, but those shouldn't be a
issue
for most ordinary PIC circuits. Adjacent nodes will have some
capacitance
between them, but so do parallel traces on a PC board. Most of the
times a
few pF between nodes is expected and not a big deal for a well
designed
circuit. If you have a very sensitive analog circuit where a pF or
two
matters, then you should probably be using guard rings and the like
anyway.
I've used these solderless breadboards many times, including for PIC
circuits with 20MHz crystals. I don't remember any problems due to
the
nature of the breadboards, although I thought about the
characteristics when
building the circuits.
********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
[1]
(978) 742-9014. Gold level PIC consultants since 2000.
--  http://www.piclist.com [2] PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist [3]


Links:
------
[1] http://www.embedinc.com/products
[2] http://www.piclist.com
[3] http://mailman.mit.edu/mailman/listinfo/piclis

2011\01\20@144633 by Vitaliy

face
flavicon
face
Olin Lathrop wrote:
{Quote hidden}

A while back our recently hired junior engineer built a breadboard circuit to test a MOSFET switch, and it just refused to work properly. When we put a scope on it, we found it oscillating at around 90Mhz. So we brought in an FM radio from the breakroom, added a 10-inch piece of wire to the drain, and made the circuit into a theremin.

He later air-wired the circuit, and it worked as intended (boring).

Vitaliy

2011\01\20@150313 by Randy Abernathy

flavicon
face
I have been using solderless breadboards for a good 30+ years (yes they hadn't
been around long at that time).  One thing I have discovered over those years is
that most people who have problems with them tend to make them far too neat..  I
have never had a problem using them, even on PIC circuits.  I do know people
that have had problems trying to operate at the same clock speed as ones I have
done but they were trying make the board look neat and in doing so, they placed
wires in parallel to each other and ended up with problems.  I am assuming the
reference to "air wired" is what I use in that it means you aren't laying the
wires down nice and neat on the breadboard but putting them "up in the air" and
going directly from point to point.  I have found over the years that is the way
to go if you want things to work on a solderless breadboard.


Randy Abernathy
CNC and Industrial Machinery service, repair, installation and design

4626 Old Stilesboro Rd NW
Acworth, GA 30101
Fax: 770-974-5295
Phone: 678-982-0235
E-mail: .....randyabernathyKILLspamspam@spam@bellsouth.net




 _____  
From: piclist-bouncesspamKILLspammit.edu [.....piclist-bouncesKILLspamspam.....mit.edu] On Behalf Of
Vitaliy
Sent: Thursday, January 20, 2011 2:45 PM
To: Microcontroller discussion list - Public.
Subject: Re: [PIC] Dumb PIC mistakes and solderless breadboards


Olin Lathrop wrote:
{Quote hidden}

A while back our recently hired junior engineer built a breadboard circuit
to test a MOSFET switch, and it just refused to work properly. When we put a
scope on it, we found it oscillating at around 90Mhz. So we brought in an FM
radio from the breakroom, added a 10-inch piece of wire to the drain, and
made the circuit into a theremin.

He later air-wired the circuit, and it worked as intended (boring).

Vitaliy

2011\01\20@154439 by jim

flavicon
face

Randy,

My take on what he means by "Air Wire" is that he soldered wires point
to point between components without
having the breadboard at all.  In other words, the components are
laying on the table deadbug style, and
you just solder wires from pin to pin and let the wire hang in air.

I could be wrong, but this is what I interpreted he was saying.

Regards,

Jim

> ---{Original Message removed}

2011\01\20@163848 by Wouter van Ooijen

face picon face
> putting them "up in the air" and
> going directly from point to point.  I have found over the years that is the way
> to go if you want things to work on a solderless breadboard.

And when it does not work this makes it easy to grab all wires, pull them out in one go, and start all over again :)

--
Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products
docent Hogeschool van Utrecht: http://www.voti.nl/hvu

2011\01\20@174309 by Vitaliy

face
flavicon
face
jim@jpes.com wrote:
> My take on what he means by "Air Wire" is that he soldered wires point
> to point between components without
> having the breadboard at all.  In other words, the components are
> laying on the table deadbug style, and
> you just solder wires from pin to pin and let the wire hang in air.
>
> I could be wrong, but this is what I interpreted he was saying.

You are not wrong. :)

2011\01\20@174657 by Adam Field

flavicon
face
On Thu, Jan 20, 2011 at 8:14 AM, Olin Lathrop <EraseMEolin_piclistspam_OUTspamTakeThisOuTembedinc.com> wrote:

> I've used these solderless breadboards many times, including for PIC
> circuits with 20MHz crystals.  I don't remember any problems due to the
> nature of the breadboards, although I thought about the characteristics when
> building the circuits.
>

I too use 20MHz crystals with 18-22pf load caps without a problem on
breadboards. The only real problems I've have with breadboards are
ground loops. If your project is spread out over 4 breadboards, your
ground references can get measurably different. I solved this by
running more ground wires in parallel and trying to make a "star"
ground as best as possible.

I had a noisy multiplex display interfere with a UART once, but I
solved that by using RG-178 to run the "noisy" lines. RG-178 is small
and flexible and works good for jumpers. Attention to layout on the
final PCB made the problem go away (without resorting to shielded
cable).

2011\01\20@180435 by Randy Abernathy

flavicon
face
That may be it too.  Keep in mind I am an oldie here and many of my takes on
descriptions may go back, oh, about 40 years or so.  :-)


Randy Abernathy
CNC and Industrial Machinery service, repair, installation and design

4626 Old Stilesboro Rd NW
Acworth, GA 30101
Fax: 770-974-5295
Phone: 678-982-0235
E-mail: randyabernathyspamspam_OUTbellsouth.net




 _____  
From: @spam@piclist-bouncesKILLspamspammit.edu [KILLspampiclist-bouncesKILLspamspammit.edu] On Behalf Of
RemoveMEjimTakeThisOuTspamjpes.com
Sent: Thursday, January 20, 2011 3:45 PM
To: Microcontroller discussion list - Public.
Subject: RE: [PIC] Dumb PIC mistakes and solderless breadboards



Randy,

My take on what he means by "Air Wire" is that he soldered wires point
to point between components without
having the breadboard at all.  In other words, the components are
laying on the table deadbug style, and
you just solder wires from pin to pin and let the wire hang in air.

I could be wrong, but this is what I interpreted he was saying.

Regards,

Jim

> ---{Original Message removed}

2011\01\20@180628 by Randy Abernathy

flavicon
face
That is exactly what I was talking about, keep the wires up and, if possible,
don't let anymore than possible parallel each other.  At least that is what I
think you are saying.  It is easier to jerk em out and re-wire that way


Randy Abernathy
CNC and Industrial Machinery service, repair, installation and design

4626 Old Stilesboro Rd NW
Acworth, GA 30101
Fax: 770-974-5295
Phone: 678-982-0235
E-mail: spamBeGonerandyabernathyspamBeGonespambellsouth.net




 _____  
From: TakeThisOuTpiclist-bouncesEraseMEspamspam_OUTmit.edu [RemoveMEpiclist-bouncesspamTakeThisOuTmit.edu] On Behalf Of
Wouter van Ooijen
Sent: Thursday, January 20, 2011 4:39 PM
To: Microcontroller discussion list - Public.
Subject: Re: [PIC] Dumb PIC mistakes and solderless breadboards


> putting them "up in the air" and
> going directly from point to point.  I have found over the years that is the
way
> to go if you want things to work on a solderless breadboard.

And when it does not work this makes it easy to grab all wires, pull
them out in one go, and start all over again :)

--

Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products
docent Hogeschool van Utrecht: http://www.voti.nl/hvu

2011\01\20@220154 by Oli Glaser

flavicon
face
On 20/01/2011 22:46, Adam Field wrote:
> On Thu, Jan 20, 2011 at 8:14 AM, Olin Lathrop<olin_piclistEraseMEspam.....embedinc.com>  wrote:
>
>> >  I've used these solderless breadboards many times, including for PIC
>> >  circuits with 20MHz crystals.  I don't remember any problems due to the
>> >  nature of the breadboards, although I thought about the characteristics when
>> >  building the circuits.
>> >
> I too use 20MHz crystals with 18-22pf load caps without a problem on
> breadboards. The only real problems I've have with breadboards are
> ground loops. If your project is spread out over 4 breadboards, your
> ground references can get measurably different. I solved this by
> running more ground wires in parallel and trying to make a "star"
> ground as best as possible.

Same here, no problem with PIC circuits on breadboard with 20MHz crystals. I think as mentioned provided you are aware of the problems that could arise (e.g. the limitations of the tool) then you should be okay.
I am thinking the different results people report maybe (at least) partly to do with breadboards from different manufacturers having quite wide variations in the capacitance between rows. I'm pretty sure (vague, may have imagined it..) I recall ages ago reading the results of someone who measured a few and found quite big differences.





2011\01\20@224310 by peter green

flavicon
face
Randy Abernathy wrote:
> I have been using solderless breadboards for a good 30+ years (yes they hadn't
> been around long at that time).  One thing I have discovered over those years is
> that most people who have problems with them tend to make them far too neat.  I
> have never had a problem using them, even on PIC circuits.  I do know people
> that have had problems trying to operate at the same clock speed as ones I have
> done but they were trying make the board look neat and in doing so, they placed
> wires in parallel to each other and ended up with problems.
Are wires in paralell really any worse than PCB tracks in paralell?

How long do these people make the critical tracks and where they put the crystal and the decoupling capacitors? I've generally put the crystal next to the PIC at an angle in the air with the crystal capacitors (assuming i'm using a board with power rails at right angles to the main connections) taken straight back to the same power rail that powers the PIC but I can visualise someone obssessed with neatness wiring it off to another bit of board so they can put it in straight and flush. Similarlly with PICs on breadboard I always put the decoupling capacitors right next to the chip (other chips aren't as friendly to decoupling capacitors unfortunately but I still try to get them close).

2011\01\21@064643 by Ruben Jönsson

flavicon
face
> Charles Craft wrote:
> > Haven't there been threads over the years that solderless breadboards
> > are evil?
>
I saw part of a movie the other day, I don't remember the name of it but it was a crew on some sort of ship that was drilling down to the earths core to set the magnetic rotation right or something lika that.

Anyway, at some point there was a locked door that someone was trying to open by bypassing the lock electronics. He opened a panel and behind it was a solderless breadboard with lots of wires connected to it. For someone not into electronics, it probably looked very advanced and high tech, but I kind of lost interest in the movie after that scene.

By the way, he couldn't open the door - it was just too complicated.

/Ruben
==============================
Ruben Jönsson
AB Liros Electronic
Box 9124, 200 39 Malmö, Sweden
TEL INT +46 40142078
FAX INT +46 40947388
EraseMErubenspampp.sbbs.se
==============================

2011\01\21@075701 by Olin Lathrop

face picon face
> If your project is spread out over 4 breadboards,

then you should be making a real PCB anyway.

If you need more than one breadboard, then you should be seriously asking
yourself what you're trying to test and what you hope to get out of the
breadboard.  Remember, breadboards are only when you're not that sure about
a circuit.  Of course sometimes you have to experiment, but most of the time
you know what the circuit needs to do and there is little doubt about how it
will work.  The time futzing around with a breadboard can be high compared
to validating a circuit on a PCB, even if that means adjusting a few
resistors or whatever.

For complex projects, I usually plan on 3 revs of the PCB.  The first is the
proposed circuit without the mechanical constraints.  This is usually a
larger board than the final, with parts spaced out, extra test points,
unused pins brought out to labeled pads, extra headers for scope probe
ground clips, etc.  Usually it's a 2 or 4 layer board with rubber feet in
the corners.  This is for validating the circuit, writing the firmware, and
proof of concept for the customer.  The customer will inevitably change some
of the requirements anyway once they get experience with it.

The second spin is done after the firmware and circuit have been shown to
work on the first board.  This is designed as if it were going to be the
final shippable board, but of course it won't be.  The mechanical
constraints, production jig test points, etc, are all taken into account.
This lets the customer play with it in their mockup units.  Even if it works
perfectly, they'll find something they want to change.  Quite often
marketing wants a extra LED or something, or some other part of the overall
design didn't work out quite right and the electronics has to compensate for
it.

The third spin is the final.  You make a small number of prototypes to prove
the board is correct, then the manufacturer uses the same files to build the
pilot run or sometimes first production run.

Solderless breadboards are too time consuming, error prone, and one-off to
be useful in this process unless you really don't know something about the
circuit.  That's rare, so most of the time you don't use a breadboard.

That said, I've got a big one sitting on the bench right now.  It took up 2
solderless breadboards stuck together.  I think it's the first time in 20
years I've had to use two.  It's a RF AM receiver at the fixed frequency of
2MHz.  Datasheets won't tell you everything you need to know about some
parts for that purpose.  For example, we're using a ceramic resonator as a
notch filter around 2MHz.  You can take a good guess how to use a resonator
best in that role from the datasheet, but you have to try it to validate
that, get some idea of the tunable range, etc.  We also didn't have a good
handle on the signal strength entering into the receiver front end, the
signal to noise ratio, the gain needed, etc.

Once we got some of this basic info from the breadboard, we made a 6x4 inch
2-layer PCB that contains the RF receiver with two extra gain stages that
can be jumpered around, a gain control, the demodulator, a small audio power
amp to allow listening to the demodulated signal (humans are very good at
detecting patterns from what looks like noise on a scope), and two PICs that
will eventually process the demodulated signal and pass on the result to
elsewhere.  This is certainly not the final circuit, but it's way easier to
deal with than the breadboard with all the flying leads.  We could also make
two copies, and the customer has one to play with now.  A third is being
partially populated to develop firmware for one of the PICs.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000

2011\01\21@080404 by Olin Lathrop

face picon face
peter green wrote:
> How long do these people make the critical tracks and where they put
> the crystal and the decoupling capacitors?

One nice thing about the solderless breadboards is that most of the time you
let the parts themselves be the jumpers and don't need deliberate leads.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000

2011\01\21@175513 by peter green

flavicon
face
Olin Lathrop wrote:
> peter green wrote:
>  
>> How long do these people make the critical tracks and where they put
>> the crystal and the decoupling capacitors?
>>    
>
> One nice thing about the solderless breadboards is that most of the time you
> let the parts themselves be the jumpers and don't need deliberate leads.
>   I do indeed, what i'm saying is I can well imagine someone obsessed with neatness not doing that.
>
> ********************************************************************
> Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
> (978) 742-9014.  Gold level PIC consultants since 2000.
>

More... (looser matching)
- Last day of these posts
- In 2011 , 2012 only
- Today
- New search...