
To start, we need following equipment:
First choise for texteditor is cooledit. With that you can easily do script that compiles assembly, erases PIC and burns .hex file to chip with just one click (or button press). Also there is support for C/C++/HTML/PERL /JAVA ... languages ! I have made Cooledit to understand PIC-assembly, so it can "highlight" different parts of our asm-files in different colors. You can view it from here... This is made with pic.syntax file.
Much can be done with Emacs, in fact I use it many more times than cooledit. There is strong support for external commands, so it can also compile & burn PICs with just one key-combination.
And of course there is tools like vi and pico. Just any editor is sufficient to write it. Choose our own and learn to use it. ;)
or
The "thing" about console is virtual-consols. For example, in one console we can edit asm-source, while another is grabbing data from our pic. And so on... And this works in our 386 box ;)
To use virtual consols, just press Alt+function key. For example, first console is Alt+F1, second is Alt+F2 and so on... Alt+F7 is by default our "first" X-windows (GUI) session.
Step by step:
#ifdef LINUX
if (getuid()!=0) {
puts("pp: must be root to run pp (needs I/O access)");
exit(1);
}
#endif
.
And do 'make again to compile it.
Notice !!!! This is security-hole in multi-user system ! After this change 'pp' can be starter by any user !
Also there must be write-access for user to /dev/lp* -device. It's chmod a+rw /dev/lp0 Notice, that with this you give everyone write acces to your paraller port !!!! (and maybe even remove it...) Another option is to put 'pp' suid-root like 'chmod +s pp' ... I don't use this method, but it should work (anyone want to comment ????). It's up to you what method you use ;)
UPDATE:I got information from Turo Jänkä, tjATjymyDOTkaseDOTfi that he uses sudo to get root-rights for pp. Just add "username ALL=NOPASSWD: /usr/bin/pp" to your /etc/sudoers (this is usually done by issuing visudo command). After that you can use sudo pp to execute pp with super-user rights. This is the recommended way to do this. Thanks for Turo for providing us with this tip.
My machine uses following setup:
#!/bin/bash export PPSETUP=3 export PPDELAY=1 export PPLPT=0 /home/henkka/bin/pp $*
And with this setup, pp prints out followin text:
Hardware setup: 7407/PNP using LPT1 at 0378 (delay = 1)So I use 7407 chip-based prommer. You can try different options with "PPSETUP"-parameter. If you are interested what programmer i use, you can also download drawings if you wish. I guess they are the same prommer what i'm using. I'm not so sure because i bought (uh, shame on me...) my prommer from nearby store...
Step by step:
Usage: picasm [-o<objname> ] [-l <listfile> ] [-s] [-ihx8m/ihx16]
[-pic device] [-w[n]] <filename>
At left is Win9x instruction and in right is picasm instruction.
Mbasm instruction |
picasm instruction |
| LIST p=16c84 | device pic16f84 |
| __CONFIG 11h | CONFIG CP=off,WDT=off,PWRT=on,OSC=xt |
| #include <c:\mplab\p16c84.inc> | INCLUDE "pic16c84.h" |
| CONSTANT DATA_PIN=0 | DATA_PIN SET 0 |
| " " (so MOVLW "#") | ' ' (so MOVLW '#') |
| .120 | 120 |
| MOVFW I_BYTE | MOVF I_BYTE,W |
You can use sed, awk or similar to find and replace those instructions.
; first.asm
; flashes LED connected to RA0
device pic16f84
; configuration
config CP=off,WDT=on,PWRT=on,OSC=xt
;equals
porta equ 0x05
ncount equ 0x0d
mcount equ 0x0e
f equ 1
;startpoint in memory
org 0x000
;program start
start movlw 0x00
tris porta
clrf porta
;loop start
go bsf porta,0
call delay
call delay
call delay
bcf porta,0
call delay
goto go
;loop end
;delay loop
delay movlw 0xff
movwf mcount
loadn movlw 0xff
movwf ncount
repeat decfsz ncount,f
goto repeat
decfsz mcount,f
goto loadn
return
end
You can write that with any text-editor, pico is just fine. After writing,
you compile it with
'picasm first.asm'
After that you should have 'first.hex' file in you directory. And it should look like this:
:1000000000306500850105140A200A200A20051029 :100010000A200328FF308E00FF308D008D0B0E2844 :060020008E0B0C28080005 :02400E00F53F7C :00000001FF
And command to burn it to PIC:
'mypp -e! first.hex'
assuming that 'mypp.sh' is in your PATH-variable. (If it's not, you can copy it to 'bin'-directory in your home-dir.
In that command '-e' erases PIC's data-space, and '!' tells that no comfirmation is wanted from user. Here is my prommer... It is connected to first paraller port, so device is /dev/lp0.
[henkka@kotkapoika ex]$ c2c ex.c C2C-plus 3.27.6e C-compiler. Copyright(c) 1998-99 by Pavel Baranov. pavel@worldonline.nl Free copy for non-profit use Shareware copy for commercial use ex.c Optimized 9 instruction Finished.
include "pic16c84.h"to beginning of file.
; movwf OSCCAL
[henkka@kotkapoika ex]$ ls *.hex ex.hex [henkka@kotkapoika ex]$ cat ex.hex :1000000008288207013402340434083410342034C0 :100010008B018B1383160030660083120B088B0A4A :100020008700070801208600053087000B080702BB :10003000013003180001FF39031D8B0120200E2819 :10004000890196300902013003180001890AFF393D :10005000031937288A01C8300A0201300318000149 :100060008A0AFF390319212800002B28212800348F :00000001FF [henkka@kotkapoika ex]$
And for reference:
Pic'n Technicues book source.
Pic'n Up the Space book source.
Serial Pic'n book source.
Those are from www.sq-1.com

You may also want to view my another documents. They describe how i measure temperature from sauna, how it's possible to put temperature to gkrellm-panel at desktop and another stuff i have found interesting enought to make www-pages from them.
I would like to have comments about this page.
History: 29.10.2003 added sudo recommendation to pp's instructions 20.3.2002 updated link to Jaakko Hyvätti's programmer 28.11.2000 added link Jaakko Hyvätti's serial programmer 29.9.2000 added instructions to compile c2c programs 2.8.2000 added link to my wife's page 22.3.2000 added link to gpsim simulator 12.2.2000 added link to prommer-pcb. Took away that counter. 18.9.1999 added link to eagle pcb-software. 18.9.1999 added "links" page because of many queries about authors homepages. 25.7.1999 added link to gnupic-page. 25.7.1999 changed layout a lot & added emacs / enlightenment links. 18.7.1999 added links to source code from books. 25.6.1999 cooledit-patch file added. Link to linux-page was added. Guestbook was added. 23.6.1999 pcb-link was added 4.6.1999 cooledit-link was added 23.5.1999 document was created

[Skip Prev] [
Prev]
[
Next]
[
Skip Next]
[
Random] [
Next 5] [
List Sites] [
Join Ring]