DonTronics Cheap PIC Programmer.

Home | Products | Prices | Directory | Order | Contact | New | Books | Files | Links | Other
Bottom_of_Page

Please Note **** My PIC84PGM board has now been replaced by the DT001 SimmStick Development System.

Instead of supplying the PIC16C84, I  now only supply the PIC16F84.
For programming the F84 with existing programmer software, the Power-up timer is inverted, and if you aren't concerned about code protection, then that's it.

DT001 Board Programs many devices now. See the DT001 page or the Links page for alternative sources of programming software. Nigel Goodwin's software for the F84 can be found on the Files page. The walking LED hex file can be found on the DT001 Rev C assembly Instructions.

The Table of Contents.

PIC16C84 Advantages:
How many times can I re-program an 84?
Walking Led Programs in MicroChip and Parallax Code:
Walking Led Program. Updated for later version MPASM Code:
84 Data example: Setting the 84 data, ID, and fuses:
Some sample code using the output of the PIC Basic Compiler:
Quick-PIC One page Beginners Summary:
View circuits and overlays

What is the Advantage of the 84?

Why is my Programmer better than theirs?

I got my first production PIC84PGM (Fore-runner of the DT001) programmer boards on the 14th of Feb-95, and assembled one. It worked fine, no bugs, no problems. What have I done wrong? I usually have to find the "Gotcha!".

You don't have to spend $275 (AUS) on a PICSTART kit to get into PIC's. The new 84 series has an EEPROM right on board. My PIC84PGM programmer board takes advantage of this by using minimal hardware and a standard IBM PC printer port to program this chip in a socket on the programmer board, or "in-circuit" on a target system.

This chip can be re-programmed around a thousand times, has data retention longer than 40 years, is very cost effective, and prices continue to drop as they become more popular. Being a member of the PIC family, it has the advantages of low power, clock speeds up to 10Mhz (for the 84 only, others are faster), the same CPU instruction set, and 13 I/O lines.

I have put together an 84 Data Pack to overcome the problems of getting manuals and information from chip importers. They don't take too kindly to hobbyists, students, and smaller customers, however this may change. This is detailed elsewhere in these files.

A Zero Insertion Force (ZIF) socket can be used for programming a run of 84's if required, however it isn't essential. The ZIF sockets are expensive, and the 18 pin version is hard to get. An 18 pin "Machine Pin" type socket could be substituted for hobbyist use.

The normal method of programming an 84 with my board, is to use something like my PIGMY board as a target system. The 84 stays in the 18 pin socket on the PIGMY board at all times during programming. You simply flick your 4PDT switch to program, program the device in 2-10 seconds, flick the switch to Run, and the 84 will run your program.

It's a little like my ZLOAD Z80 development system. Almost instant download, via a parallel printer port, and no waiting to erase EPROM's between downloads. The burn, crash, erase cycle is removed. The PICSTART kit will program 84's, but it doesn't offer the "in-circuit" advantages.

This is equivalent to the Parallax 16C5x downloader facilities. No, I don't mean my board is the same as the Parallax 16C5x downloader, my board is to 84's, what the above mentioned Parallax board is to 16C5x's. It allows you to download and run a program in the target system.

If you wish to SIMulate an 84 program for de-bugging purposes, the MicroChip SIMulator will do this for you on a PC. All of the MicroChip files including the MPALC and MPASM Assemblers are on the PIC Disk No#1 that comes with my PIC84PGM board.

Just to point out one or two things, it can run on a plug pack (9-12V AC/DC) and a standard 9 V battery, or two batteries, or a plug pack at 15 to 25 volts. This means that you could burn a chip using a Notebook computer with a battery powered PIC84PGM up a gumtree, down a man-hole, or any inconvenient spot where power is a problem, and isn't that one reason why a lot of you are looking at PIC's.

Summary:

I designed and produced my board in Feb-95. It's still the only Programmer that supports a LOAD/RUN Switch on board for instant program development.
Back to The Table of Contents. 

To Spade a PIC!

How many times can I re-program an 84?

This is a little experiment I conducted in April-95 to see how many times I could re-program a PIC16C84/04/P. The messages were posted on the MicroChip BBS.

Date: Saturday, April 8, 1995 4:55am                   Forum: PIC16CXX
From: Don Mckenzie                                     Msg#: 79526
 To: ** ALL **
 Re: To Spade a PIC...

How do you neutralize a PIC16C84?

Stick it in a programmer for a few hours and watch it fry! Maybe...

I got hold of the 84 that I have been using day after day for
development work, the one I have programmed maybe 100 to 150 times
already, and decided to see how far I could push it.

I made this decision after it had been pointed out to me by several
people that the 1Mb re-program figure in the data sheets related to
EEPROM Data memory, not Program memory. I had read the specs
incorrectly.

I suspect others have done this too. I can't be the only one to
interpret a Data manual incorrectly. A further search found a minimum
figure of 100 and a typical figure of 1000 endurance cycles apply.

OK, I'm about 999K burns short of what I thought. I am really PPPeeved
now. Do I program it 999 times for my development, then get rid of it
by sticking it in a customers final application?

I put my .EXE programmer file in a Basic X=X+1 type loop and waited
for the part to fail. I should add the odd 100 to 150 burns to this
figure which will give me a reasonable guesstimation of the endurance
count of this part.

When I had reached around the 1000 total burn point, I switched from
the program mode to run mode on my in-circuit burner, and tested my
application which is a 2 line by 16 chr LCD in 8 bit mode, a 16 button
keypad and a Piezo Transducer. This uses up lots of I/O lines and all
seemed to work fine.

But what had I proven? The I/O pins seem stable enough.
Has anybody else had a play around with this?

My X=X+1 count still continues as I write this. Will keep you posted!

Don...




Date: Saturday, April 8, 1995 6:23pm                   Forum: PIC16CXX From: Minkey                                           Msg#: 79591  To: Don Mckenzie  Re: To Spade a PIC  (2 replies) Don, sounds intriguing - keep us posted. In actual fact, you've already reached 2000 erase cycles , if as I suspect, you are using PP.BAS for serial programming. That's because PP.BAS always does a bulk erase first. To sqeeze more cycles from my 16C84's, I've modified PP.BAS to only bulk erase when necessary, i.e. when previously code protected. If you are interested, I can send you the minor mod. to David's excellent programme.  Regards, Minkey.
Date: Saturday, April 8, 1995 7:22pm                   Forum: PIC16CXX From: Don Mckenzie                                     Msg#: 79595  To: Minkey  Re: To Spade a PIC  (Reply to #79591) MI>Don, sounds intriguing - keep us posted. In actual fact, you've already MI>reached 2000 erase cycles , if as I suspect, you are using PP.BAS for MI>serial programming. That's because PP.BAS always does a bulk erase MI>first. MI> To sqeeze more cycles from my 16C84's, I've modified PP.BAS to MI>only bulk erase when necessary, i.e. when previously code protected. MI>If you are interested, I can send you the minor mod. to David's MI>excellent programme. MI> Regards, Minkey. 2001, 2002, 2003...
Date: Saturday, April 8, 1995 7:34pm                   Forum: PIC16CXX From: Don Mckenzie                                     Msg#: 79596  To: Minkey  Re: To Spade a PIC  (Reply to #79591) (2 replies) Hi again Minkey, I am using a variant on PP.BAS, a New Zealand Virtual Basic version based on this code. Yes, it does a bulk erase each time before programming. Of course I would welcome your changes. Perhaps a flag could be set in the VB version menu to control the erase. Do you think I should offer a prize for the nearest correct entry? 2028, 2029, 2030... Don...
Date: Sunday, April 9, 1995 3:23pm                     Forum: PIC16CXX From: Don Mckenzie                                     Msg#: 79664  To: Don Mckenzie  Re: To Spade a PIC  (Reply to #79596, Reply to #79591) (1 reply) 7648, 7649, 7650...
Date: Monday, April 10, 1995 4:23am                    Forum: PIC16CXX From: Don Mckenzie                                     Msg#: 79714  To: Don Mckenzie  Re: To Spade a PIC  (Reply to #79664, Reply to #79596, Reply to #79591) (1 reply) 11742, 11743, 11744... I'm starting to think I am not doing something correctly. This 84 continues to program... Don...
Date: Monday, April 10, 1995 11:54am                   Forum: PIC16CXX From: David Tait                                       Msg#: 79764  To: Don Mckenzie  Re: To Spade a PIC  (Reply to #79714, Reply to #79664, Reply to #79596, Repl*) (1 reply) Hi Don, Try programming the inverse pattern (invert each bit that is) every second iteration. David
Date: Monday, April 10, 1995 11:25pm                   Forum: PIC16CXX From: Don Mckenzie                                     Msg#: 79880  To: David Tait  Re: To Spade a PIC  (Reply to #79764, Reply to #79714, Reply to #79664, Repl*) DT>Hi Don, DT>Try programming the inverse pattern (invert each bit that is) every DT>second iteration. Hi David, I felt I was doing something wrong as the burns continued for around 50 hours until I got to 16,578. At this point, I decided that 16C84's are cheaper than hard disks, so I decided to give it away for a while. After a little prompting, I set the code protected, and started burning again. From a new zero count, that is, on top of the 16.5K burns, I logged the following: Burn 1319: Fail Burn 1356: Fail Burn 1372: Fail Burn 2011: Fail That is, is has failed only four times in 2000 burns in code protected mode. This is on top of the original figure. I am still using the same chip for my development. If it fails more often, I'll throw it away. Does this mean that I can program forever using non-protected mode, and 1000+ in protected mode? Either way, I'm happy with the results. I still haven't been able to fully spade this PIC... Don...
Date: Wednesday, April 12, 1995 6:32pm                 Forum: PIC16CXX From: Minkey                                           Msg#: 80196  To: Don Mckenzie  Re: To Spade a PIC  (Reply to #79596, Reply to #79591) (1 reply) Don, here goes - PPC.BAS on its way via e-mail. Hope it's useful There are some other minor (commented) changes to rearrange some of the defaults to suit myself. I wish Microchip would bring out some more chips in the 16C8X series, there's still nothing quite like it worldwide. Regards, Minkey.
Date: Wednesday, April 12, 1995 9:33pm                 Forum: PIC16CXX From: Don Mckenzie                                     Msg#: 80220  To: Minkey  Re: To Spade a PIC  (Reply to #80196, Reply to #79596, Reply to #79591) Thanks very much. I'll have a good look at it. I agree 110%, no make that 120% about the 16C8x series. Don...
I am still programming the same 84 today. It's the one with the little spot of liquid paper on the top of it.
Back to The Table of Contents. 
 

Walking LEDs:

Here is the Source Code for the Walking LED program in both MicroChip and Parallax syntax.
;WL_MPASM.ASM   WALKING LED PROGRAM FOR MPASM MICROCHIP ASSEMBLER
;INVOKED WITH "MPASM WL_MPASM" for PIC16C84!
;BY Don McKENZIE.

W               EQU     0              ;NEEDED FOR MPASM
F               EQU     1

STATUS          EQU     03H
PORTA           EQU     05H
PORTB           EQU     06H
PORTC           EQU     07H

RAM1            EQU     0CH
RAM2            EQU     0DH
RAM3            EQU     0EH
LOOP_8          EQU     0FH
PORTA_COUNT     EQU     10H
PORTB_COUNT     EQU     11H
LED_BYTE        EQU     12H
;
                LIST    P=16C84

                ORG     0
                GOTO    5               ;JUMP TO START AT ADDRESS 5
                ORG     5               ;SETS ORG TO ADDRESS 5
START
                MOVLW   00              ;CLR W
                TRIS    PORTA           ;SET A TO OUTPUTS
                TRIS    PORTB           ;SET B TO OUTPUTS
                MOVWF   PORTA           ;SET PORT A LOW
                MOVWF   PORTB           ;SET PORT B LOW
ENTRY
                MOVLW   08
                MOVWF   LOOP_8          ;DO IT 8 TIMES
                MOVLW   00
                MOVWF   PORTB_COUNT     ;LOAD PORT B COUNT
                MOVLW   0FF
                MOVWF   PORTA_COUNT     ;PORT A TO -1
                BSF     STATUS,W        ;SET CARRY
LOOP
                RLF     PORTB_COUNT     ;WALK PORT B LEFT
                MOVF    PORTB_COUNT,W   ;
                MOVWF   PORTB           ;STORE TO B
                INCF    PORTA_COUNT     ;
                MOVF    PORTA_COUNT,W   ;
                MOVWF   LED_BYTE
                RLF     LED_BYTE
                RLF     LED_BYTE
                MOVF    LED_BYTE,W
                MOVWF   PORTA
                CALL    DELAY1SEC
                DECFSZ  LOOP_8
                GOTO    LOOP
                MOVLW   00
                MOVWF   PORTB
                GOTO    ENTRY
DELAY1SEC
                MOVLW   00
                MOVWF   RAM2
                MOVLW   04
                MOVWF   RAM3
LOOP2
                MOVLW   0F3
                MOVWF   RAM1
LOOP3
                NOP
                DECFSZ RAM1
                GOTO   LOOP3
                DECFSZ RAM2
                GOTO   LOOP2
                DECFSZ RAM3
                GOTO   LOOP3
                RETURN
                END

;WL_PASMX.SRC   WALKING LED PROGRAM FOR PARALLAX ASSEMBLER
;INVOKED BY "PASMX WL_PASMX             ;/S SUPRESSES ADDITIONAL INFO.
;BY Don McKENZIE.     for PIC16C84!

                DEVICE  PIC16C84,XT_OSC,WDT_OFF,PWRT_OFF,PROTECT_OFF

                ID      '1234'

                EEORG   0H
                EEDATA  'ABCD'

                ORG     0CH                     ;START ABOVE SPC. REGISTERS

;RAM STARTS HERE

RAM1            DS      1                       ;USED FOR DELAY
RAM2            DS      1                       ;USED FOR DELAY
RAM3            DS      1                       ;USED FOR DELAY
LOOP_8          DS      1
PORTA_COUNT     DS      1
PORTB_COUNT     DS      1
LED_BYTE        DS      1

                ORG     0
                JMP     5                       ;JUMP TO START AT ADDRESS 5
                ORG     5                       ;SETS ORG TO ADDRESS 5
;
START
                MOV     W,#0H                   ;CLR W
                MOV     !RA,W                   ;SET A TO OUTPUTS
                MOV     !RB,W                   ;SET B TO OUTPUTS
                MOV     RA,W                    ;SET PORT A LOW
                MOV     RB,W                    ;SET PORT B LOW
:ENTRY
                MOV     LOOP_8,#8               ;DO IT 8 TIMES
                MOV     PORTB_COUNT,#0          ;LOAD PORT B COUNT
                MOV     PORTA_COUNT,#0FFH       ;PORT A TO -1
                STC
:LOOP
                RL      PORTB_COUNT             ;WALK PORT B LEFT
                MOV     RB,PORTB_COUNT          ;STORE TO B
                INC     PORTA_COUNT
                MOV     LED_BYTE,PORTA_COUNT
                RL      LED_BYTE                ;ADJ 0/1 TO 2/3
                RL      LED_BYTE                ;.....
                MOV     RA,LED_BYTE             ;STORE TO PORT A
                CALL    DELAY1SEC               ;DELAY 1 SECOND
                DJNZ    LOOP_8,:LOOP            ;DO IT 8 TIMES
                MOV     RB,#0                   ;CLR PORT B
                JMP    :ENTRY

DELAY1SEC       MOV     RAM2,#0                 ;1 SEC DELAY @4MHz
                MOV     RAM3,#4                 ;4 BY 250ms
:LOOP2
                MOV     RAM1,#0F3H
:LOOP           NOP
                DJNZ    RAM1,:LOOP
                DJNZ    RAM2,:LOOP2
                DJNZ    RAM3,:LOOP
                RET
                END
Read the file "picexass.html" for full details on setting up a PIGMY board for In System Programming (I.S.P.) using my PIC84PGM board.

Back to The Table of Contents. 

Walking LEDs program for later MPASM:

It has been pointed out to me that the latest MPASM gave some warnings when assembling my Walking LED program. It still worked, but new syntax in the latest version means that some items will need to be changed in future.

I have left the older version above for comparison. Below is the dis-assembled WLED.HEX file that will re-assemble with MPASM. I won't give a version number here, coz I know it will change before I type it in.

The "P16C84.inc" file must be in the same directory as your souce and aseembler files.

; Generated by DisAsm84, (c) Nigel Goodwin 1995.

                LIST      P=16C84, F=INHX8M
                include "P16C84.inc"
                ORG 0000

                GOTO    Label_0001
                ORG 0005          
Label_0001      MOVLW   TRISA
                MOVWF   FSR
                MOVLW   000
                MOVWF   INDF
                INCF    FSR     ,f
                MOVWF   INDF
                MOVWF   PORTA     
                MOVWF   PORTB     
Label_0004      MOVLW   008       
                MOVWF   0F        
                MOVLW   000       
                MOVWF   11        
                MOVLW   0FF       
                MOVWF   10        
                BSF     STATUS    , C         
Label_0003      RLF     11        , f       
                MOVF    11        , W       
                MOVWF   PORTB     
                INCF    10        , f       
                MOVF    10        , W       
                MOVWF   12        
                RLF     12        , f       
                RLF     12        , f       
                MOVF    12        , W       
                MOVWF   PORTA     
                CALL    Label_0002
                DECFSZ  0F        , f       
                GOTO    Label_0003
                MOVLW   000       
                MOVWF   PORTB     
                GOTO    Label_0004
Label_0002      MOVLW   000       
                MOVWF   0D        
                MOVLW   004       
                MOVWF   0E        
Label_0006      MOVLW   0F3       
                MOVWF   0C        
Label_0005      NOP               
                DECFSZ  0C        , f       
                GOTO    Label_0005
                DECFSZ  0D        , f       
                GOTO    Label_0006
                DECFSZ  0E        , f       
                GOTO    Label_0005
                RETURN            

                END
Back to The Table of Contents. 

84 Data:

Setting the 84 EEPROM data, ID, and Fuses.
   LIST P=16C84
   ORG 2100h  ;Set EEPROM data
   DATA 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07
   DATA 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F
   DATA 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17
   DATA 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F
   DATA 'N','i','g','e','l'

   ORG 2000h  ;Set ID locations
   DATA  0x00, 0x01, 0x02, 0x03

   ORG 2007h  ;Set config fuses
   DATA 0x03
   END
Home | Products | Prices | Directory | Order | Contact | New | Books | Files | Links | Other
Top_of_Page
DonTronics_ US Home Page.      DonTronics Australian Home Page.
mailto: don@dontronics.com Copyright © 1997 DonTronics