[Sussex] A Little Hardware Help

Steve Dobson steve.dobson at syscall.org.uk
Sun Jun 7 08:33:51 UTC 2009


-----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