PIC + stripboard = no go.

Status
Not open for further replies.

Blueteeth

Well-Known Member
Hi,

I recently prototyped a LCD/SPI interface, both on breadboard, and on stripboard. I decided to use an old basic stripboard 'breakout' baord for 18 pin PIC's I had, all good, its worked many times before. Although I realise that stripboard isn't as good as a solid FR4 etched PCB, its better than a breadboard, this circuit wouldn't work on either. Does now, but I'll explain.

I used a PIC18F819, so I set the internal oscillator and very strange things happening...finally wrote a test program and the PIC was constantly reseting itself. The voltage on MCLR was 4.8V via a 10K resistor. However, whenever I brought my hand near the board, the LED I connected, to be turned on as soon as it powered up flickered, until it was of. The closer I got my hand to the board, to slower it flickered...we're talking about 4 inches from any track/pin...on any part of the circuit, including both power rails.

I used a different config setting at the top of the code:
__CONFIG _CP_OFF & _WDT_OFF & _PWRTE_ON & _INTRC_IO & _LVP_OFF & _BODEN_OFF

Before it was:
__CONFIG _CP_OFF & _WDT_OFF & _PWRTE_OFF & _INTRC_IO

Now, I'm thinking two things...either it defaults to LVP (didn't know this), and when I connected up RB3 to a CMOS chip, it entered programming mode....or the brownout detector went gaga...even though the supply was a healthy 4.9V, with a 10uF cap, and a 0.1uF cap. Or perhaps the powerup timer was doing its thang? I know I'm a big antenna, and I'll provide noise to the power supply by touching it...but enough for a reset??

has anyone else had real issues with PIC's on stripboard? I'm sure I've seen some complaints somewhere, but I couldn't find any. Its no biggie now, I'll just have to remember this config, as I tend not to use many of the options there, just internal osc.

Blueteeth
 
Last edited:
Blueteeth said:
has anyone else had real issues with PIC's on stripboard?

Yes. They always worked and as such I don't have the desire or need to bother with a FR4 circuit board for an one off project.

All PICs with LVP capability comes with that feature enabled, or the feature is defaulted to enable after the configuration fuses of the chip is erased. Bet you don't know that.

In order for LVP not to affect normal operation, user have to connect the LVP enable pin(PGM) to 0V via resistor, thus losing one valuable port pin OR include the LVP_OFF option during configuration as you have done.
 

Stripboard works perfectly with PIC's, it's no different to a proper PCB, check my tutorials - all of which are built on Veroboard.
 
eblc1388 said:
Yes. ..................
In order for LVP not to affect normal operation, user have to connect the LVP enable pin(PGM) to 0V via resistor, thus losing one valuable port pin OR include the LVP_OFF option during configuration as you have done.
Hi Eblec,
I feel that during normal workong, one could use the LVP pin also.
it is only during programming, you have to pull downfor normal programming
 
I've built plenty of PIC circuits on stripboard without any major problems.

The only thing to watch out for, and I only made the mistake once, is that you mount the clock crystal as close as possible to the PIC. The only time I placed it further away than usual, it wouldn't oscillate. Rearranging other components to allow me to move the crystal closer to the PIC cured the problem.
 
Hi,

Thanks for the replies everyone. You see this is what I thought...I have built many prototypes on stripboard, its great stuff. I have had issues sometimes, with the crystal....even when mounted very close to the PIC. When I get PCB's made up, I alway s have a ground plane...at least surrounding the Xtal, so I'm guessing that an osc is more reliable with such a ground plane, and without any 'jumper wires' in the clocks path...but still works more or less on ye olde stripboard.

Its weird to hear about the LVP pin though. I've never pulled it low diring programming, or high, using either the JDM prog, or the PICkit2...and its worked like a charm, with it usable as a standard I/O. The ONLY change I made, was with the config header, so I'll just remove them one by one to see which one was the config that stopped it being arsey.

Considering my new found appreciation of stripboard, good to hear that PIC's generally don't have issues being mounted on it, as long as I don't go hardcore and try to build a 900Mhz transciever on it

Thanks.

Blueteeth
 
eblc1388 said:
In order for LVP not to affect normal operation, user have to connect the LVP enable pin(PGM) to 0V via resistor, thus losing one valuable port pin OR include the LVP_OFF option during configuration as you have done.

It seems there is still some confusions about the LVP(PGM) pin.

If one wants to use the PGM pin for I/O purposes, one must disable the feature of Low voltage programming by setting a bit in the config. word. If this feature is disabled, one cannot program the PIC using 5V only.

If one wish to keep the 5V programming capability, then one must pull PGM pin to 0V during normal use(and cannot use the pin as an I/O pin) otherwise the PIC will enter programming mode.
 
Ahh well, I guess that would be the case if it was enabled by default....its enabled. That was probably it then...and given that, if it was in LVP mode (first code didn't reference LVP at all) the RB3 pin connected to the input of a cmos IC...maybe it wasn't quite enough to pull it low/high for programming, so when I touched part of the circuit, the noise from me was enough to push it over/under the threshold. Interesting. At least the problem is solved now.

I might do something with LVP, like a portable programmer for PIC's that don't have self programming ability, but with my PICkit2 and the programming headers I have on all my projects, I doubt it'll come in useful. Thanks for clearing that up L.Chung.

Blueteeth
 

Thanks for the info.i got the point
 
ANY crystal oscillator is going to be finicky at best on that stuff, to many parasitics. I would recommend if you are trying to use that stuff with a crystal to hand wire it over the top of the part with it's load caps after all else is done, AND keep the wires as short as possible.

Dan
 

There are no problems at all with micro-controller crystals on veroboard, fundamental crystals don't go high enough to cause any problems. Just as with a PCB though, keep the connections as short as possible.
 
Hi again.

Well a little more experimentation, turns out it was the LVP that was causing trouble, without it turned off in the config, it programs in system, but the PIC just resets almsot constantly. But that threw up a new problem....the oscillator. Programs and works fine with internal osc, on both the stripboard carrier board, and breadboard..but XT, and HS modes causes programming errors. The checksum is different for the verify, and the last lot of data in the program memory on the PIC is different.

I've never been able to use the crystal osc on the stripboard carrier board, but I'm pretty sure I've done ICSP on breadboard with an xtal connected, and it went fine. The stripboard has two 22pf caps, and a machined sil socket for the crystal, as close to the PIC as possible. Tried xtal values from 2-20Mhz, using XT and HS for each one, just to check if it was a driving problem.

At first I thought it was the use of a socket, adding parasitic capacitance (or inductance?) but after reading a couple of app notes from microchip about osc design, it could well be that the caps' values are too high for it to oscillate properly, especially on stripboard. Even if it is the socket causing issues, thats a bummer, as I like the option of being able to change the crystals value.

Only tried two PIC's on that board, the 628A, and 819. Both fine with internal osc, and LVP off but external crystal osc's on both give programming errors using the PICkit2.


Any idea's? I've never had trouble with the osc before, just used 15-22pf caps with any crystal and its been dandy, up until now. Although, because I used to use a shoddy DIY JDM programmer, I never used to program in system.

Blueteeth.
 
Blueteeth said:
Any idea's? I've never had trouble with the osc before, just used 15-22pf caps with any crystal and its been dandy, up until now. Although, because I used to use a shoddy DIY JDM programmer, I never used to program in system.

Blueteeth.
Crystal oscillators are very picky. You can check the specs on the crystal and the recommendations in the micro data sheet. The wrong load WILL cause it to fail, and the various experimenter systems add capacitance and noise to the oscillator. Noise, within reason, will not be noticed accept for causing any on board A/Ds to be noisy.

Try removing the load caps or cutting them in half. Also check the drive level recommendation on the crystal you are using...you might need a series resister to meet the spec and to be sure you are not damaging the crystal.

Dan
 
How about posting a picture of your layout?, or check my 16F876/7 tutorial boards which use 20MHz crystals.
 
Hey, thanks again.

Heres the layout, pretty easy considering I had designed it with eagle anyway (on stripboard), so I just used eagle3d again.

I know that during programming, if the crystal osc starts very quickly it can causing the program counter to 'skip'. At least thats what I've read, so that its programmed with the wrong data in the wrong area's. This really doesn't bother me for this little project, I just don't want to make a nice PCB (or stripboard) in future, only to be restricted to the internal osc. Its weird, it's always worked on stripboard, with or without the crystal actually plugged in during programming! So maybe this is a PICkit2 issue......as it compiles perfectly.

As you can see by the layout, nothing special, just the usual, plus a 2x8 LCD header for debugging. There is a link

Blueteeth
 

Attachments

  • 1350635674.jpg
    105.8 KB · Views: 233
  • 1350635676.jpg
    57.3 KB · Views: 187
Ummm... that is not a crystal, it is a ceramic resonator. Programming is probably using the internal oscillator. You should look up the recommendations for that part and what PIC says about driving it.

Dan
 
Nope, tis a crystal, well, its not shown, but its a 3-way sil socket, centre is gnd, outer two are directly connected to the osc pins, and two caps, both to gnd. I like to keep my options open, so I *could* use a resonator if needs be (probably have to remove the caps though) it was just a test board anyway, for 18-pin pics, stripboard layout, and techniques.

So I've been pluging in crystals. The addition of a 'Gnd' socket in the middle makes no difference as far as I'm concerned. So my guess is, its the socket, or just a crappy layout, it is rather crowded there.
Blueteeth
 
Well I'll take your word for it then. I have only ever seen resonators in the package in your piccy, unless I am looking at the wrong thing.

Dan
 
I once had problems with a PIC (on a PCB) which was doing some strange erratic and unpredictable things.

The problem turned out to be a couple of unused inputs which I had left floating.
Grounding the inputs via a 10k resistor cured the erratic behaviour.

JimB
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…