[Sussex] A Little Hardware Help

George Chamberlayne george at kingsley-electronics.co.uk
Mon Jun 8 21:07:59 UTC 2009


Hi Steve,

The Microchip AN607 application note below may help. 

AN607 - Power-up Trouble Shooting - Application Notes - Details
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1824&appnote=en01111

I have not used the PIC16F628, but have used the similar PIC18FXXX
chips.

Further to your other helpful replies:-

Your PIC18F628 needs a PSU input voltage between 3 and 5.5V volts to
operate. Normally a 3.3 volt or 5 volt dc PSU is used.

A local 7805 +5 volt voltage regulator is no bad idea, but not
essential.

Your Bandridge BE-516 mains transformer (regulated) should be OK.
I see from the data sheet the useful regulated output voltage selections
are 3, 4.5 and 6 volts.  You appear to be using the 4.5 volt output
selection - which is the best choice for this PSU and should be OK.

I suggest you ensure the 'Brown-out-detect' is disabled, during your
initial debug phase. (The is disabled by clearing the PIC18F628 'BORDEN'
configuration bit at the start of your code, because you are using a 4.5
volt dc PSU and not the normal +5 volt PSU)

Don't overlook a simple 'poor circuit connection' to the PIC16F628 PSU
and reset pins. (Use your DVM to check the connections to the actual PIC
IC pins) Breadboard connections can give problems, even if they look OK.

I always consider it good practise to connect a 100nF ceramic capacitor
'diectly' across the PSU pins of any digital IC, especially a uP chip.
(NB. Keep the electrolytic capacitor you have got connected across the
PSU input and add the 100nF ceramic capacitor in parallel)


I hope this helps and good Luck.


George Chamberlayne


> 
>    1. A Little Hardware Help (Steve Dobson)
>    2. Re: A Little Hardware Help (Desmond Armstrong)
>    3. Re: A Little Hardware Help (Al Bennett)
>    4. Re: A Little Hardware Help (Alan Perry)
>    5. Re: A Little Hardware Help (Desmond Armstrong)
>    6. Re: A Little Hardware Help (Steve Dobson)
>    7. Re: A Little Hardware Help (Steve Dobson)
> email message attachment
> > -------- Forwarded Message --------
> > From: Steve Dobson <steve.dobson at syscall.org.uk>
> > Reply-To: Sussex LUG <sussex at mailman.lug.org.uk>
> > To: Sussex LUG <sussex at mailman.lug.org.uk>
> > Subject: [Sussex] A Little Hardware Help
> > Date: Sat, 06 Jun 2009 17:43:30 +0100
> > 
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> > 
> > Hi All
> > 
> > I've been a software engineer for the 30 years, but I now find that I
> > want to learn a little hardware too complement it.  Computers are only
> > useful (fun) when the are doing something.  And being able to physically
> > interact with the world around them is an area I would like to explore -
> > just for fun you understand.
> > 
> > To that end I've started playing around with the PIC16F628 [1]
> > micro-controllers - a small but complete computer on an IC.  I also
> > found a nice set of hardware & software tutorials [2] to learn from and
> > have bought some breadboarding hardware to play with.  My first goal is
> > to get the PIC to control a seven segments display (common anode) and to
> > that end I have built a simple circuit[3] based on the main board [4].
> > Unfortunately my first attempt doesn't work!  :-(
> > 
> > If I remove the IC and jumper the -ve line to the seven-segment display
> > lines then the LEDs light up - so that part appears correct - and it
> > matches the circuit in the tutorial [5], although as I have a single
> > digit seven-segment display I have connected the 8 pins of the PIC to
> > the 8 inputs (seven segments + decimal point) of the display and omitted
> > the transistor parts.
> > 
> > I guess that the problem lies in the power input to the chip.  I'm using
> > a Bandridge BE-516 mains transformer (regulated) to provide the power,
> > but do I need any form of circuit on this supply, and if I do what?  Of
> > course I am completely clueless at this point as to how to find out what
> > is wrong.  I know the PIC isn't blown because if I place it back in the
> > programming/test board it works there perfectly.
> > 
> > Any and all help gratefully welcomed.
> > 
> > Steve
> > 
> > [1] http://ww1.microchip.com/downloads/en/DeviceDoc/40300C.pdf
> > [2] http://www.winpicprog.co.uk/pic_tutorial.htm
> > [3] http://www.syscall.org.uk/simple-circuit.jpg
> > [4] http://www.winpicprog.co.uk/pic_tutorial_main_board.htm
> > [5] http://www.winpicprog.co.uk/pic_tutorial_7seg_board.htm
> > [6] http://www.superfi.co.uk/index.cfm/page/moreinfo.cfm/Product_ID/1023
> > 
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.4.9 (GNU/Linux)
> > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> > 
> > iD8DBQFKKpyxu7HOw0Q66oERAsheAJ4m0QuYDmiAkRd2D3mDtC+O7kPh8gCeJW2j
> > c+Q96AWQujnNZsjDqwLlie8=
> > =ov8U
> > -----END PGP SIGNATURE-----
> > 
> > 
> email message attachment
> > -------- Forwarded Message --------
> > From: Desmond Armstrong <desmond.armstrong at gmail.com>
> > Reply-To: desmond.armstrong at gmail.com, Sussex LUG
> > <sussex at mailman.lug.org.uk>
> > To: Sussex LUG <sussex at mailman.lug.org.uk>
> > Subject: Re: [Sussex] A Little Hardware Help
> > Date: Sat, 06 Jun 2009 18:51:22 +0100
> > 
> > > I guess that the problem lies in the power input to the chip.  I'm using
> > > a Bandridge BE-516 mains transformer (regulated) to provide the power,
> > > but do I need any form of circuit on this supply, and if I do what?  Of
> > > course I am completely clueless at this point as to how to find out what
> > > is wrong.  I know the PIC isn't blown because if I place it back in the
> > > programming/test board it works there perfectly.
> > >
> > >   
> > 
> > Do be careful, you should use a regulated power supply ideally one of 
> > those 3 pin regulator ICs on your board such as TK11320 78L02.
> > If you are overvolting or undervolting although you might not damage the 
> > device, it might not work. They are not very tolerant of supply voltage 
> > variations.
> > 
> > 
> email message attachment
> > -------- Forwarded Message --------
> > From: Al Bennett <al at plasticfish.co.uk>
> > Reply-To: Sussex LUG <sussex at mailman.lug.org.uk>
> > To: Sussex LUG <sussex at mailman.lug.org.uk>
> > Subject: Re: [Sussex] A Little Hardware Help
> > Date: Sat, 06 Jun 2009 19:16:25 +0100
> > 
> > Hi Steve
> > 
> > (If you'll forgive an interruption from an ex-regular now north of the 
> > border!)
> > 
> > The 16F628 is a good choice to start with, I've played with them in the 
> > past (but if you're not too invested in PICs my personal favourite is 
> > the Atmel AVR series as there's excellent open source compiler (eg GCC) 
> > and toolchain support).
> > 
> > Do you have a multimeter?  If so, check your supply is giving +5 (+/- 
> > half a voltish) with respect to ground.  If it's ok then you've excluded 
> > that problem, just make sure you have the polarity right.  If not (or 
> > you don't have a meter and want to guarantee a good supply), a 7805 is 
> > the bullet proof, old school, piece of cake solution.  The circuit on 
> > this page is what you need:
> > http://www.tkk.fi/Misc/Electronics/circuits/psu_5v.html
> > 
> > You may find the 7805 advertised with extra letters in the part number 
> > (LM7805, 78S05 etc) but it should be widely available (Maplin, Rapid 
> > Electronics et al).
> > 
> > Start with illuminating an LED using the micro, then flash it on and off 
> > (the microcontroller "hello world") before moving on.
> > 
> > Basic things to check:
> > - Fuses / oscillator configuration (if you're using the internal osc 
> > make sure it's enabled via the fuses, if you're using an external 
> > resonator make sure it's hooked up correctly (with caps for two pin 
> > resonators))
> > - Check your reset pin (MCLR) is pulled high (through a 10k should do)
> > - Port direction settings (make sure your outputs are outputs)
> > - Output port set to whatever "on" is (if you're sourcing current it 
> > needs to be high, sinking current low)
> > 
> > The struggle is always getting an LED to blink, once you're that far 
> > things become a lot easier!
> > 
> > Hope this helps, feel free to contact me offlist if you want.
> > 
> > Al
> > 
> > 
> > Steve Dobson wrote:
> > > -----BEGIN PGP SIGNED MESSAGE-----
> > > Hash: SHA1
> > >
> > > Hi All
> > >
> > > I've been a software engineer for the 30 years, but I now find that I
> > > want to learn a little hardware too complement it.  Computers are only
> > > useful (fun) when the are doing something.  And being able to physically
> > > interact with the world around them is an area I would like to explore -
> > > just for fun you understand.
> > >
> > > To that end I've started playing around with the PIC16F628 [1]
> > > micro-controllers - a small but complete computer on an IC.  I also
> > > found a nice set of hardware & software tutorials [2] to learn from and
> > > have bought some breadboarding hardware to play with.  My first goal is
> > > to get the PIC to control a seven segments display (common anode) and to
> > > that end I have built a simple circuit[3] based on the main board [4].
> > > Unfortunately my first attempt doesn't work!  :-(
> > >
> > > If I remove the IC and jumper the -ve line to the seven-segment display
> > > lines then the LEDs light up - so that part appears correct - and it
> > > matches the circuit in the tutorial [5], although as I have a single
> > > digit seven-segment display I have connected the 8 pins of the PIC to
> > > the 8 inputs (seven segments + decimal point) of the display and omitted
> > > the transistor parts.
> > >
> > > I guess that the problem lies in the power input to the chip.  I'm using
> > > a Bandridge BE-516 mains transformer (regulated) to provide the power,
> > > but do I need any form of circuit on this supply, and if I do what?  Of
> > > course I am completely clueless at this point as to how to find out what
> > > is wrong.  I know the PIC isn't blown because if I place it back in the
> > > programming/test board it works there perfectly.
> > >
> > > Any and all help gratefully welcomed.
> > >
> > > Steve
> > >
> > > [1] http://ww1.microchip.com/downloads/en/DeviceDoc/40300C.pdf
> > > [2] http://www.winpicprog.co.uk/pic_tutorial.htm
> > > [3] http://www.syscall.org.uk/simple-circuit.jpg
> > > [4] http://www.winpicprog.co.uk/pic_tutorial_main_board.htm
> > > [5] http://www.winpicprog.co.uk/pic_tutorial_7seg_board.htm
> > > [6] http://www.superfi.co.uk/index.cfm/page/moreinfo.cfm/Product_ID/1023
> > >
> > > -----BEGIN PGP SIGNATURE-----
> > > Version: GnuPG v1.4.9 (GNU/Linux)
> > > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> > >
> > > iD8DBQFKKpyxu7HOw0Q66oERAsheAJ4m0QuYDmiAkRd2D3mDtC+O7kPh8gCeJW2j
> > > c+Q96AWQujnNZsjDqwLlie8=
> > > =ov8U
> > > -----END PGP SIGNATURE-----
> > >
> > > __ 
> > > Sussex mailing list
> > > Sussex at mailman.lug.org.uk
> > > E-mail Address: sussex at mailman.lug.org.uk
> > > Sussex LUG Website: http://www.sussex.lug.org.uk/
> > > https://mailman.lug.org.uk/mailman/listinfo/sussex
> > >   
> > 
> > 
> email message attachment
> > -------- Forwarded Message --------
> > From: Alan Perry <alanfredperry at googlemail.com>
> > Reply-To: Sussex LUG <sussex at mailman.lug.org.uk>
> > To: Sussex LUG <sussex at mailman.lug.org.uk>
> > Subject: Re: [Sussex] A Little Hardware Help
> > Date: Sat, 6 Jun 2009 22:28:17 +0100
> > 
> > 
> > 
> > And if the pin is multifunctional it's set to digital (some can be
> > analog inputs etc)
> > 
> > I have old kit for using the PIC chips... best computer in the
> > world... 
> > 
> > Cheers
> email message attachment
> > -------- Forwarded Message --------
> > From: Desmond Armstrong <desmond.armstrong at gmail.com>
> > Reply-To: desmond.armstrong at gmail.com, Sussex LUG
> > <sussex at mailman.lug.org.uk>
> > To: Sussex LUG <sussex at mailman.lug.org.uk>
> > Subject: Re: [Sussex] A Little Hardware Help
> > Date: Sat, 06 Jun 2009 23:17:30 +0100
> > 
> > Al Bennett wrote:
> > > Hi Steve
> > >
> > > (If you'll forgive an interruption from an ex-regular now north of the 
> > > border!)
> > >
> > > The 16F628 is a good choice to start with, I've played with them in the 
> > > past (but if you're not too invested in PICs my personal favourite is 
> > > the Atmel AVR series as there's excellent open source compiler (eg GCC) 
> > > and toolchain support).
> > >
> > > Do you have a multimeter?  If so, check your supply is giving +5 (+/- 
> > > half a voltish) with respect to ground.  If it's ok then you've excluded 
> > > that problem, just make sure you have the polarity right.  If not (or 
> > > you don't have a meter and want to guarantee a good supply), a 7805 is 
> > > the bullet proof, old school, piece of cake solution.  The circuit on 
> > > this page is what you need:
> > > http://www.tkk.fi/Misc/Electronics/circuits/psu_5v.html
> > >
> > > You may find the 7805 advertised with extra letters in the part number 
> > > (LM7805, 78S05 etc) but it should be widely available (Maplin, Rapid 
> > > Electronics et al).
> > >
> > > Start with illuminating an LED using the micro, then flash it on and off 
> > > (the microcontroller "hello world") before moving on.
> > >
> > > Basic things to check:
> > > - Fuses / oscillator configuration (if you're using the internal osc 
> > > make sure it's enabled via the fuses, if you're using an external 
> > > resonator make sure it's hooked up correctly (with caps for two pin 
> > > resonators))
> > > - Check your reset pin (MCLR) is pulled high (through a 10k should do)
> > > - Port direction settings (make sure your outputs are outputs)
> > > - Output port set to whatever "on" is (if you're sourcing current it 
> > > needs to be high, sinking current low)
> > >
> > > The struggle is always getting an LED to blink, once you're that far 
> > > things become a lot easier!
> > >
> > > Hope this helps, feel free to contact me offlist if you want.
> > >
> > > Al
> > >
> > >
> > > Steve Dobson wrote:
> > >   
> > >> -----BEGIN PGP SIGNED MESSAGE-----
> > >> Hash: SHA1
> > >>
> > >> Hi All
> > >>
> > >> I've been a software engineer for the 30 years, but I now find that I
> > >> want to learn a little hardware too complement it.  Computers are only
> > >> useful (fun) when the are doing something.  And being able to physically
> > >> interact with the world around them is an area I would like to explore -
> > >> just for fun you understand.
> > >>
> > >> To that end I've started playing around with the PIC16F628 [1]
> > >> micro-controllers - a small but complete computer on an IC.  I also
> > >> found a nice set of hardware & software tutorials [2] to learn from and
> > >> have bought some breadboarding hardware to play with.  My first goal is
> > >> to get the PIC to control a seven segments display (common anode) and to
> > >> that end I have built a simple circuit[3] based on the main board [4].
> > >> Unfortunately my first attempt doesn't work!  :-(
> > >>
> > >> If I remove the IC and jumper the -ve line to the seven-segment display
> > >> lines then the LEDs light up - so that part appears correct - and it
> > >> matches the circuit in the tutorial [5], although as I have a single
> > >> digit seven-segment display I have connected the 8 pins of the PIC to
> > >> the 8 inputs (seven segments + decimal point) of the display and omitted
> > >> the transistor parts.
> > >>
> > >> I guess that the problem lies in the power input to the chip.  I'm using
> > >> a Bandridge BE-516 mains transformer (regulated) to provide the power,
> > >> but do I need any form of circuit on this supply, and if I do what?  Of
> > >> course I am completely clueless at this point as to how to find out what
> > >> is wrong.  I know the PIC isn't blown because if I place it back in the
> > >> programming/test board it works there perfectly.
> > >>
> > >> Any and all help gratefully welcomed.
> > >>
> > >> Steve
> > >>
> > >> [1] http://ww1.microchip.com/downloads/en/DeviceDoc/40300C.pdf
> > >> [2] http://www.winpicprog.co.uk/pic_tutorial.htm
> > >> [3] http://www.syscall.org.uk/simple-circuit.jpg
> > >> [4] http://www.winpicprog.co.uk/pic_tutorial_main_board.htm
> > >> [5] http://www.winpicprog.co.uk/pic_tutorial_7seg_board.htm
> > >> [6] http://www.superfi.co.uk/index.cfm/page/moreinfo.cfm/Product_ID/1023
> > >>
> > >>     
> > Do remember that your chosen PIC requires 2.0 volts not 5v so hence my 
> > recommendation of 7802 or 78L05 (low power)
> > 
> > 
> email message attachment
> > -------- Forwarded Message --------
> > From: Steve Dobson <steve.dobson at syscall.org.uk>
> > Reply-To: Sussex LUG <sussex at mailman.lug.org.uk>
> > To: desmond.armstrong at gmail.com, Sussex LUG
> > <sussex at mailman.lug.org.uk>
> > Subject: Re: [Sussex] A Little Hardware Help
> > Date: Sun, 07 Jun 2009 09:11:56 +0100
> > 
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> > 
> > Hi Desmond
> > 
> > Thanks for your help but you now have me confused.
> > 
> > Desmond Armstrong wrote:
> > > Do remember that your chosen PIC requires 2.0 volts not 5v so hence my 
> > > recommendation of 7802 or 78L05 (low power)
> > 
> > All the 78L05s on Maplin's site are rated at 5v.  The datasheet on the
> > PIC16F627/8 has it rated at 3.0v - 5.5v.  So where does your 2.0v
> > requirement come from and/or refer to?
> > 
> > Ta
> > Steve
> > 
> > 
> > 
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.4.9 (GNU/Linux)
> > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> > 
> > iD8DBQFKK3ZLu7HOw0Q66oERAhW9AKCfH06qrdG1nW07n9mxNpKT7cLWXgCfb5+E
> > f5m2HLW6jJuYbsBcHQ0PEp4=
> > =RTqs
> > -----END PGP SIGNATURE-----
> > 
> > 
> email message attachment
> > -------- Forwarded Message --------
> > From: Steve Dobson <steve.dobson at syscall.org.uk>
> > Reply-To: Sussex LUG <sussex at mailman.lug.org.uk>
> > To: Sussex LUG <sussex at mailman.lug.org.uk>
> > Subject: Re: [Sussex] A Little Hardware Help
> > Date: Sun, 07 Jun 2009 09:33:39 +0100
> > 
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> > 
> > Hi Al
> > 
> > Many thanks for your advice.
> > 
> > Al Bennett wrote:
> > > (If you'll forgive an interruption from an ex-regular now north of the 
> > > border!)
> > 
> > I'll take helpful advice from where ever it comes.  :-)
> > 
> > > The 16F628 is a good choice to start with, I've played with them in the 
> > > past (but if you're not too invested in PICs my personal favourite is 
> > > the Atmel AVR series as there's excellent open source compiler (eg GCC) 
> > > and toolchain support).
> > 
> > As I already have a PIC programmer I'll probably stick with it.
> > 
> > > Do you have a multimeter?
> > 
> > Yes, but that doesn't mean I can use it.  :-)
> > 
> > >                            If so, check your supply is giving +5 (+/-
> > > half a voltish) with respect to ground.  If it's ok then you've excluded 
> > > that problem, just make sure you have the polarity right.
> > 
> > The regulated adaptor I am using is putting out 4.47 as read by my
> > meter.  However the last digit does dance a bit.  As the PIC16F627/8
> > data sheet says that the "voltage range" is 3.0 - 5.5 I assume that this
> > would be enough to drive the chip.
> > 
> > >                                                            If not (or
> > > you don't have a meter and want to guarantee a good supply), a 7805 is 
> > > the bullet proof, old school, piece of cake solution.  The circuit on 
> > > this page is what you need:
> > > http://www.tkk.fi/Misc/Electronics/circuits/psu_5v.html
> > 
> > I am thinking that this is a good idea, but as my local Maplin is out of
> > the 7805s it looks like this project is going to be put on hold while I
> > order over the net.
> > 
> > > Start with illuminating an LED using the micro, then flash it on and off 
> > > (the microcontroller "hello world") before moving on.
> > 
> > On the programmer/test board I have achieved this.  It is only when the
> > PIC is in my own circuit that I am having problems.
> > 
> > > Basic things to check:
> > > - Fuses / oscillator configuration (if you're using the internal osc 
> > > make sure it's enabled via the fuses, if you're using an external 
> > > resonator make sure it's hooked up correctly (with caps for two pin 
> > > resonators))
> > 
> > Using the KISS principle I was going for the internal OSC as this
> > requires the simplest of circuits - a line to ground for a 10.5MHz
> > clock.  Later I was going to add an external clock but I want to start
> > with the simplest configuration possible to begin with.
> > 
> > > - Check your reset pin (MCLR) is pulled high (through a 10k should do)
> > 
> > This I didn't do.
> > 
> > > - Port direction settings (make sure your outputs are outputs)
> > 
> > Of this I am sure as the PIC flashes the LEDs on the programmer/test
> > board okay.
> > 
> > > - Output port set to whatever "on" is (if you're sourcing current it 
> > > needs to be high, sinking current low)
> > 
> > Here I may have a problem.  Comparing the programmer board's circuit
> > with the tutorial I based by circuit on I see that they are very
> > different.  The test board connects the LEDs to ground and the tutorial
> > (and my circuit) to +ve.  So I'll need to modify something.
> > 
> > > The struggle is always getting an LED to blink, once you're that far 
> > > things become a lot easier!
> > 
> > I bet, as you have all the bases covered at that point.  The PIC has to
> > be working.  :-)
> > 
> > > Hope this helps, feel free to contact me offlist if you want.
> > 
> > It's been very helpful and I may well take you up on that offer.
> > 
> > Steve
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.4.9 (GNU/Linux)
> > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> > 
> > iD8DBQFKK3tju7HOw0Q66oERAniEAJsHt8xpRL+XqEZk6sFyHhavsSXD+QCgkRpH
> > mOl9OmQNag9VYmtwuUQznqY=
> > =SFis
> > -----END PGP SIGNATURE-----
> > 
> > 




More information about the Sussex mailing list