PIC16F84A DIY Development board.

Post
BigglesPiP
New Member
2007/12/11 18:41:18
Hi there,
I was intruduced to the PIC in Uni, where we programmed them initially with Flowcode, then with Assembly code (which I think is easier). I consider the PIC the best component ever to come in an 18pin DIP, and want one in my life! grin

I looked at buying a development board, then looked away when I saw the price! So I'm going to make one myself, I've done a few electronic projects before, how hard can it be?

I started with this design for a programmer: http://www.kmitl.ac.th/~kswichit%20/f84/f84.htm

And I've modified it to include a 3Mhz Xtal (the speed that boards in Uni use) with option for an external clock (so I can overclock the PIC one day). There is an LED and microswitch on each port.

Here is the design: http://img339.imageshack.us/img339/9853/programmerqz1.gif

Please do Poke holes, what concerns me the most is:
-My handling of the "NOT MCLR" pin, in Test mode the pin is kept at 5V and returned to 0V momentarily to reset the program?
-Powering the LED's directly off the ports, each LED and resistor draws 10mA at most, so I won't exceed the maximum current sunk through port A and B, even if all the LEDs are on at once, but If all this current has to originate at the Vss Pin (does it?) it's getting close to the 150mA limit, how much current can the Chip itself draw?

Feel free to poke any other holes.



As for software, I plan to Wite the Assembly code in Notepad++, then copy and paste it into WinPicProg ( http://www.winpicprog.co.uk/ ) to compile this to a HEX file and write to the PIC.

Is there a free Simulator for the PIC16F84A, or a better free software solution?

Thanks in advance for your help.
post edited by BigglesPiP - 2007/12/11 18:46:50
Graham2107
Senior Member
RE: PIC16F84A DIY Development board. 2007/12/11 19:26:55
The PIC16F84A is no longer "in fashion" for new designs. I use the PIC18F2520 (28-pin skinny DIP) or a similar 18-pin device and you dont have to worry about bank and page bits. It has its own built-in oscillator and so you won't have to worry about external crystals. I use the 4MHz option as then timing is easier as each instruction takes 1uS (or multiples). You can even the write the program in C. The 2520 even has a RS-232 port for you to play with ! There are probably newer PICs than the 2520 with more facilities.  Depends on what your stockist holds.
 
Download MPLAB version 8 from Microchip and you will get the assembler writing editor built in, HEX compiler and also a SIM.
 
PIC draws very little on its own. See datasheet for more details. Keep LED limiting resistors high enough to keep the pin current as low as possible. I think 25mA is max.
 
!MCLR is normally held high by an external 22K (or whatever) and the programmer normally pulls this pin to Vpp (13Vdc I think) to program.
 
If you can afford and ICD2 then you can use ICSP to program your PIC on-board and it interfaces with MPLAB 100%.
BigglesPiP
New Member
RE: PIC16F84A DIY Development board. 2007/12/12 10:56:53
I'm planning on sticking to a chip with an external Xtal as I want to try some overclocking in the future.

I descovered MPLAB last night, had a quick play, the SIM is quite poor (I couldn't change PortA manually, even when it's set to input).

But I'll probably use it's compiler.

Could I hold the !MCRL pin at 14V when running the program, instead of the 5 I have right now, that way I could do away with the switching between Programming and Testing modes.
DarioG
Scheisse Menschen
RE: PIC16F84A DIY Development board. 2007/12/12 11:03:07
ORIGINAL: BigglesPiP
I descovered MPLAB last night, had a quick play, the SIM is quite poor (I couldn't change PortA manually, even when it's set to input).


Hmm, no, using its Stimulus capability, you should definitely be able to. I even simulated interrupts on Pin Change.


Could I hold the !MCRL pin at 14V when running the program, instead of the 5 I have right now, that way I could do away with the switching between Programming and Testing modes.



No, I suppose not. Rising MCLR causes Programming Mode.
Ron Hayes
Super Member
RE: PIC16F84A DIY Development board. 2007/12/12 11:05:55
the SIM is quite poor (I couldn't change PortA manually, even when it's set to input).


Have a look at the stimulus section of the sim.

Could I hold the !MCRL pin at 14V when running the program, instead of the 5 I have right now, that way I could do away with the switching between Programming and Testing modes.


Nope, this is how you get into programming mode.

Ron


BigglesPiP
New Member
RE: PIC16F84A DIY Development board. 2007/12/12 11:09:35
Thanks all, I think I'm ready to go to breadboard, I'll let you know how it goes.

Oh, does anyone know where I can get a cheap 18Pin DIP ZIF socket? They're all over £10 on RS and Farnell.

And what are these called:


Most sites seem to say "microswitch", but as far as I can tell, a microswitch is something else.
Olin Lathrop
Super Member
RE: PIC16F84A DIY Development board. 2007/12/12 11:11:35
I'm planning on sticking to a chip with an external Xtal as I want to try some overclocking in the future.

And then if things don't quite work right you won't know if you did something wrong or the chip is acting flaky because it's out of spec.  The worst case is that all will appear to work right.
 
the SIM is quite poor

I find the simulator a very useful tool.  Yes, the whole stimulus thing is unintuitive and needlessly complex, but it's still a nice tool.
 
I couldn't change PortA manually, even when it's set to input.

Don't blame the tools until you're really sure you haven't screwed up.  As a newbie, always assume you screwed up.  In this case most likely you were using a PIC with a analog peripheral and forgot to make the analog inputs digital.  If so, the simulator was doing exactly what it was supposed to do, which is act like the real chip.
 
Could I hold the !MCRL pin at 14V when running the program, instead of the 5 I have right now, that way I could do away with the switching between Programming and Testing modes.

No, because then how are you going to switch between programming and running modes.  Also 14V is too high for many (all?) PICs.  Some allow up to 13.5V, but I don't remember one that tolerates 14V.  You may be damaging the PIC.  Check the programmin spec for your PIC.
 
As for switching modes, you should be in run mode except when the programmer explicitly sets MCLR to the programming voltage to enter programming mode.  It should let go of MCLR again when done, so this shouldn't be a issue.
Olin Lathrop
Super Member
RE: PIC16F84A DIY Development board. 2007/12/12 11:13:29
And what are these called:

I'd call that a "pushbutton".
P Lameijn
Super Member
RE: PIC16F84A DIY Development board. 2007/12/12 11:29:10
>> And what are these called: 

Most sites seem to say "microswitch", but as far as I can tell, a microswitch is something else.


It's called a key(board)switch. Example is the Omron B3F series.
 
 
>> Oh, does anyone know where I can get a cheap 18Pin DIP ZIF socket? They're all over £10 on RS and Farnell.
 
If you plan using it frequently, then stick to a good quality socket. Believe me, cheap ZIF sockets can give you a lot of trouble... (been there... grin )
post edited by P Lameijn - 2007/12/12 11:32:31
violin
Super Member
RE: PIC16F84A DIY Development board. 2007/12/12 11:38:42
Oh, does anyone know where I can get a cheap 18Pin DIP ZIF socket? They're all over £10 on RS and Farnell.


Hi. Yes, they are not cheap. I did find a few (not 18-pin) in a second hand electronic shop near in which bought up at a good price. I was lucky. Other than that I do all my shopping at Farnell.

And what are these called:

Most sites seem to say "microswitch", but as far as I can tell, a microswitch is something else.


Tactile push button,
BigglesPiP
New Member
RE: PIC16F84A DIY Development board. 2007/12/12 18:37:35
As for the ZIF, I found 26 for £2.50: http://rswww.com/cgi-bin/bv/rswww/searchBrowseAction.do?N=0&Ntk=I18NRSStockNumber&Ntt=6128182&Nty=1&D=6128182&callingPage=/order/Order.jsp&BV_SessionID=@@@@1495650933.1197509104@@@@&BV_EngineID=ccdladdmkdmhfjecefeceeldgkidhgg.0&cacheID=uknetscape&Nr=avl:uk

14V is ok according the the datasheet. Will 12V be enough to cause Programming mode? I'm thinking of redesigning the PSU, I took it from the programmer design and I've never really liked it.

Olin Lathrop
Super Member
RE: PIC16F84A DIY Development board. 2007/12/13 05:47:10
Will 12V be enough to cause Programming mode?

I don't know, but if I needed to I'd look in the programming spec.  So can you.
BigglesPiP
New Member
RE: PIC16F84A DIY Development board. 2007/12/13 09:14:40
Found the Programmind Spec, eventually.

After reading most of it I found a small table, and apparently 12-14V is needed to program, doesn't say what's needed for readback/normal running, but I assume that Vss will do.

Almost sourced all my parts now, just need:
-Mini PCB mount toggle switch.
-Momentary Keyboard Switch: but one that's open when pressed, not closed. Struggling to extract that info from RS.




Also, I've figured out Stimulus in SIM, but in the process I've made a mess of the program, I've lost the yellow arrow and now all it does when I press go, or start stepping into, is run through all 1024 instructions (only 76 in my program) and stop. :(

Edit: NVM, I was using an ASM file with far too big an address. Moving to C helps, stimulus worked, but like all other simulators I've used it won't simulate the internal timer, I take it I have to operate that in Stimulus too.
post edited by BigglesPiP - 2007/12/13 09:46:06
DarioG
Scheisse Menschen
RE: PIC16F84A DIY Development board. 2007/12/13 11:52:45
ORIGINAL: BigglesPiP

After reading most of it I found a small table, and apparently 12-14V is needed to program, doesn't say what's needed for readback/normal running, but I assume that Vss will do.



Am not sure, but if you're talking about MCLR pin, it will have to be VPP (12-14) in order to read back.
And, for normal run, it will have to be 5V - a VSS will cause PIC reset. UNLESS you disable the RESET function on that pin, using your PIC's configuration WORD.
Ldanielrosa
Super Member
RE: PIC16F84A DIY Development board. 2007/12/13 13:41:46
A development board will help with setup and reduce the number of wiring faults.
 
Instead of designing around the '84, I recommend a more open design.  Nearly all of the chips in a given package size are pin compatible, so a socket for each of the major footfprints should have you covered.
 
Also, I like the idea of being able to select between two or more crystals- some applications require a specific one.
 
As for the current on the LEDs, 10mA is not dangerously excessive.  You may have some complications if you turn several on or off at the same time.  I would be happy with 2mA.
 
Try to put the Vpp as close to the recommended target as you reasonably can.  I've burned a couple by letting it wander.
 
One thing I might include if I were making one is a variable supply voltage.  Some end applications are a far cry from 5.0 volts.
BigglesPiP
New Member
RE: PIC16F84A DIY Development board. 2007/12/15 00:44:51
Have located all the bits, I just need a breadboard and some single core.

Cost is a bit over £50 (lots of excess parts due to minimum order quantities), does that sound too much for a PIC development board?
violin
Super Member
RE: PIC16F84A DIY Development board. 2007/12/15 06:41:30
Have located all the bits, I just need a breadboard and some single core.

Cost is a bit over £50 (lots of excess parts due to minimum order quantities), does that sound too much for a PIC development board?

 
 
Yes, It does sound a lot for a just a Breadboard and some single core cable. Farnell only have a £20 minimum order cost. I take it that you are a UK member, to use Farnell as your supplier. OR you could try Maplins just for these bits, a breadboard and some ready made up jumpers. £15 to £20, depending on the size of the breadboard and the amount of jumpers required. Also, I don’t use breadboards for prototyping. I find myself, that they are more trouble than they are worth for microcontrollers projects. Regards
Olin Lathrop
Super Member
RE: PIC16F84A DIY Development board. 2007/12/15 07:24:14
Cost is a bit over £50 (lots of excess parts due to minimum order quantities), does that sound too much for a PIC development board?

That's over $100, so yes, that sounds like a lot depending on what you get with it though.  Check out my ReadyBoard-01.  Three of them with shipping will cost you only $75 each.  They support the common 28 pin PIC footprint, like 16F886, 18F252, 18F2620, and many others.  All the support stuff like power supply with wide input voltage range, RS-232 interface with DB-9 connector, debug LEDs, and other stuff is taken care of.  It then gets out of your way and gives you a large breadboard area to add your own circuit around the PIC.  Since everything including your stuff is nicely soldered down and the board has a ground plane, these make for robust one-off projects.
BigglesPiP
New Member
RE: PIC16F84A DIY Development board. 2007/12/15 11:24:57
ORIGINAL: Olin Lathrop

Cost is a bit over £50 (lots of excess parts due to minimum order quantities), does that sound too much for a PIC development board?

That's over $100, so yes, that sounds like a lot depending on what you get with it though.  Check out my ReadyBoard-01.  Three of them with shipping will cost you only $75 each.  They support the common 28 pin PIC footprint, like 16F886, 18F252, 18F2620, and many others.  All the support stuff like power supply with wide input voltage range, RS-232 interface with DB-9 connector, debug LEDs, and other stuff is taken care of.  It then gets out of your way and gives you a large breadboard area to add your own circuit around the PIC.  Since everything including your stuff is nicely soldered down and the board has a ground plane, these make for robust one-off projects.


I'd have to spend over $15 on that getting it up to the standard of my planned board.

That $100 price is all the bits (including copper strip board), the breadboard and single core wire are just to test the curcuit before I start soldering (That's soldering, not "sodering" grin ).

My design includes an, for each port pin: LED, keyboard switch, and wire terminal. And I'll have the multiple Xtal feature. It should be compatiable with most 18pin chips too.

I think my board is just about on the ball as price goes.
algol
Super Member
RE: PIC16F84A DIY Development board. 2007/12/15 11:32:11
So,
You ask the world if fifty quid is too much, someone kindly offers you a less expensive alternative
and your'e instantly convinced of your original price point. No wonder someone claims to be doing
psychology research on this forum.
BigglesPiP
New Member
RE: PIC16F84A DIY Development board. 2007/12/15 15:02:32
My board is $100 in parts.

The "cheaper" altenative is $75 (If i buy 3 of them), but iut has no LEDs Keyboard Switches or terminals. I'd have to spend that $75 plus 13 LEDs, 13 keyboard switches, and 3 3way terminal blocks. Just to get what I want.

It's not cheaper when you do the maths.

Edit: And to cap it off, that board doesn't appear to support the PIC I use.
post edited by BigglesPiP - 2007/12/15 15:04:31
Flat Reading Mode Thread Reading Mode