[sdiy] PIC basic setup?

rburnett at richieburnett.co.uk rburnett at richieburnett.co.uk
Thu Jan 9 20:38:02 CET 2014


Tom is right, configuring the peripherals and initialising the processor 
at the top of your program are vitally important.  Otherwise the rest of 
the program is doomed to fail.

Persistent watchdog resets from an enabled but not "kicked" watchdog 
timer, _OR_
writing to I/O lines that are left configured as analogue inputs seem to 
be the favourite newbie mistakes of my PIC students these days!  So, be 
sure not to do either of the two ! ;-)

-Richie,

On 2014-01-09 16:53, Tom Wiltshire wrote:
> Hohoho. Yep, been stung by that one too. O'scope is your friend.
> 
> The worst part of getting started with PICs is doing the initial
> set-up when you've no idea what's what, or what's going on. It's
> impossible to debug a chip that isn't even running!
> Once you've got even some basic boilerplate code that gets the chip
> awake and running, then you can start to tweak and if it breaks, you
> know not to tweak *that* bit again! I'd recommend finding some simple
> code example and seeing if you can start from there, rather than
> starting from absolute scratch, even if there's plenty of stuff in it
> that you don't understand. Gradually as I've gone along I've been able
> to fill in more of the blanks, but I had no clue at first.
> 
> HTH,
> Tom
> 
> PS: Jack, if you have any specific questions when you get to my
> VCADSR, drop me a line.
> 
> On 8 Jan 2014, at 16:12, rburnett at richieburnett.co.uk wrote:
> 
>>> Any good ideas/tutorials for getting a PIC working with just a basic 
>>> setup
>>> (pic, xtal, maybe 5v regulator), making it blink an LED, respond to a 
>>> pot,
>>> etc?
>> 
>> Also when you get to programming the LED to flash on and off, make 
>> sure you include delays that wait long enough for the on and off 
>> times, so that the overall flashing speed is slow enough for you to 
>> actually see!
>> 
>> With a micro that can execute tens of millions of instructions per 
>> second it's easy for beginners to end up with the LED flashing at many 
>> kHz where it just looks like it is always on.
>> 
>> You can always check the I/O pin activity with an oscilloscope to see 
>> if it is toggling, but it's best to aim for a flash rate of around 1Hz 
>> from the outset.  If you end up getting something slightly faster or 
>> slower you can always measure it with a stopwatch and then try to work 
>> out where you went wrong!
>> 
>> Good luck,
>> 
>> -Richie,
>> _______________________________________________
>> Synth-diy mailing list
>> Synth-diy at dropmix.xs4all.nl
>> http://dropmix.xs4all.nl/mailman/listinfo/synth-diy
> 
> _______________________________________________
> Synth-diy mailing list
> Synth-diy at dropmix.xs4all.nl
> http://dropmix.xs4all.nl/mailman/listinfo/synth-diy



More information about the Synth-diy mailing list