> Doesn't matter now, anyway. I've almost got all the parts to
> build my own 512K Flash + 128K ram interface. I just got to
> sit down and make the thing. Well, I will do after I make
> my PIC programmer + assembler in Pro-DOS. (I promised to
> make a MIDI-filter for a friend of mine)
>

I duuno why there's no twelve vots on the expainsion port (there
is on the scart connector, though) but if you were thinking for
your PIC programmer, then what I did was "sit" a 9v battery on
top of the 5volt supply, and take the result (approx. 14volts)
through a diode to the PIC pin - The diode drops about a volt,
and the battery can be around 10v when new, but everything
seems to work fine. I've got a simple PIC programmer for the
SAM which connects to the printer port, takes 5volts from the
joystick port, and uses the battery for the programming voltage
- and it only has one chip (an ls05), a few resistors, and a switch!

I'll try and put it on NVG sometime....

The assembler is dead easy too - you type the pic program in
as a BASIC program, and each PIC instruction is a BASIC procedure 
- it's a little slow, but it's fine for the short programs most
PICs are used for. There's a slight problem between the PIC
commands goto and call, and the BASIC keywords, so I renamed
them ggoto and ccall. So, for example, here's a short piece of
useless PIC code, and what it looks like with my assembler:

       ORG 0
       BCF $10,4
       BTFSS $14,5
       GOTO skip 
       BSF $10,4
skip   NOP
loop1  GOTO loop1


becomes......

1 LET skip=-1 : LET loop1=-1 : REM give all labels values to
                              prevent "undeined variable error" for
                              forward jumps on first pass
10 LET pc=0
20 pass1           : REM assembler procedures don't produce any output
                         any output on first pass
21 :
30 bcf &10,4
40 btfss &14,5
50 ggoto skip       : REM if we didn't have LET skip=[a value] in line 1
                          then we would get an error here on the first pass
60 bsf &10,4
70 LET skip=pc
80 bsf &10,4
90 LET loop1=pc    : REM this is a forward branch, so we could get away
                         with not puttine LET loop1=[a value] in line 1
100 ggoto loop1    : REM note "ggoto" not "goto"
110 :
120 IF pass=1 THEN pass2 : GOTO 30
130 STOP
140 :
150 ....all the assembler routines 


The only rule is: make sure you save before running (assembling)
your code - typing "call xxx" instead of "ccall xxx" can be disatrous!

I also ran into problems with the SAM BASIC "edit your program one-too-many-
times bug" - but found you can get round it by LISTing your program to a 
section of memory and KEYINing it all back in again - very fiddly!

Still, it's a lovely tool, and once you get used to it, it's quite a
bit more flexible than a standard assembler - for example, you can
create an 80 cycle delay with: FOR i=1 TO 20 : nop : NEXT i
and an 18-entry sine wave look-up table with:
FOR i=0 TO 17 : retlw SIN(i*20*6.28/360) : NEXT i

Simple!

I'll put the code up a.s.a.p.

Cheers,

Andy






Reply via email to