Sam's little editor was written in the '80's by Sam Willmont.
Only 17K in size, it is free. get it at:
ftp://ftp.funet.fi/pub/msdos/Simtel/editor
download the file sled11.zip ,(31K)
You will be amazed at the capability of this little editor. It will hold many separate text files at once with the capability to cut and paste between them. Take some time to play with the editor and become familiar with its use. Especially note operations using the keys F3, F4, F7, F8, alt-x, alt-c and alt-y.
You use the editor to write a program of instructions which you feed to
the assembler, (MPASM). Instructions occur one to a line and are made
of short abbreviations that indicate what the instruction does. One of
these is NOP which stands for "no operation".
MPASM
MPASM, Microchip's assembler can be found at:
http://www.microchip.com/10/Tools/Picmicro/code/MPASM/asm2300/index.htm
Once you unzip the file, throw away all files except mpasm.exe and
p16f84.inc.
The manual can be found at:
http://www.microchip.com/10/Tools/PICmicro/code/MPASM/33014g/index.htm
But it is in computerese. Probably best to wait until you really need
it.
In what follows, I will assume you are using SLED. The operations may be slightly different if you are using another editor.
Check out MPASM by trying to assemble just one line with the instruction nop, ( capitals or lower case, doesn't matter). Create this one line file in the text editor. Name this file 'nop.asm'. You can run MPASM from the editor by using alt-y, (send DOS command). When you type 'mpasm nop' you will probably get 2 errors. A further explaination of errors is found in the error file 'nop.err',which is created when you run MPASM.
Hit the spacebar until you return to the program you were editing, ( nop.asm ), and load nop.err using F3. One of the errors complains of no end statement, the other says you haven't identified the PIC you are using. Hit F8 to return to nop.asm and add lines to make it read:
list p=16F84 nop end
Save the file, (F4), and re-assemble, (alt-y, mpasm nop). This time you will probably get no errors but 3 warnings. Warnings can be ignored if you know what they mean and can ignore the consequences. Errors always have to be fixed. Using F3 you can load the new 'nop.err' file, (the old one is also still there). The warnings state that each of the three lines started in column one. Column one is reserved for 'labels' which identify the location in the program of the next instruction.
Since we don't really need any labels, put a space or three at the beginning of each of the lines and re-compile. This time you should get no errors or warnings. If you use alt-y and type 'dir nop.*' you will see there are 5 files with names beginning with 'nop'. If you load the latest 'nop.err' you will find it blank, (get rid of the other 2 with F7).
Some of the other files are quite interesting. The file 'nop.lst' contains much useful information. Load it using F3 and look it over.
You will find the program lines we just entered with a line number, in decimal, under 'LINE'. For one line you will also find two 4 digit hexidecimal numbers. These are the actual numbers and locations they will be entered in the PIC's program memory. Each program memory location is 14 bits in size so it takes 4 hex digits to specify what goes in there, (under OBJECT CODE). There are 1024 program memory locations so it also takes 4 hex digits to specify the location, (under 'LOC'). You will also find the number of program memory words used, (1), and the number left, (1023).
You follow this same process: edit source - assemble - check and correct
errors in the source - re-assemble, until you get no errors on assembly.
When you finally get no errors you 'burn' the '.HEX' file, 'nop.hex' into
a PIC with the programmer. You then take the PIC, place it in an actual
circuit and start it up. It may not do what you want, or nothing at
all. You then try to guess what is wrong, go back to the original
source and do it all over again. Fun huh?
PIX
PIX can be found at:
http://home5.swipnet.se/~w-53783
download the latest version pix113b.zip
A file called PIX.CFG has to be edited to work with this programmer. Put
in or remove semicolons to decide which options are active. Choose
'Port=Com4',(change to the COM port # you use). Use 'Programmer=Ludi' for
the programmer. I found few directions on how to use the programmer,
but it seems pretty straight forward. Load the file using F3, (sometimes
the command line seems to work also). Burn the program into the PIC with
F9.
PIC
The data sheet for the 'F84' can be found at:
http://www.microchip.com/10/Lit/PICmicro/16F8X/index.htm
click on 30430c.pdf
One of the cheapest sources for the PIC16F84, (4mHz), and also the 78L05
used in the programmer is:
http://www.phanderson.com/ordering.html
Professor Anderson does this as a labor of love. Understandably, he closes
down for some of the summer.