*.hex
*.cod
*.lst
+idlocs*.asm
gpsim.log
nmra-stream nmra-stream,slow
# booster-output-low -disabled because you forgot to cvs add it
+PICNOS= 0 1 3
+
+TARGETS= $(foreach i, $(PICNOS), perpic$i.hex)
+
include ../pic.make
clean: pic-clean
+ rm -f idlocs*.asm
%,slow.o: %.asm
$(ASSEMBLE) -D SLOW_VERSION -c -o $@ $<
-%-full.hex: %.o config.o
+idlocs%.asm: make-idlocs
+ ./$< $* >$@.new && mv -f $@.new $@
+
+perpic%.hex: config.o idlocs%.o
$(LINK)
+
+%-entire0.hex: %.o config.o idlocs0.o
+ $(LINK)
+
+.PRECIOUS: idlocs%.asm
8n1
-Flash memory
-============
+Flash memory ID locations
+=========================
-Byte 20 0000h bit 0 is 1 for the main PIC and 0 otherwise
+Byte 20 0000h
+ bit 0 1 for the main PIC (#0)
+ 0 otherwise
+ 1-7 currently unused, set to 0
+Byte 20 0001h
+ PIC number (guaranteed to be in range 0..63 inclusive)
I2C
===
--- /dev/null
+#!/usr/bin/perl
+
+@ARGV==1 or die;
+$_=shift @ARGV;
+m/^\d+$/ or die;
+$_<32 or die;
+
+push @a, $_ ? '0x00' : '0x80';
+push @a, sprintf "0x%02x", $_;
+
+printf "; automatically generated - do not edit\n" or die $!;
+for ($i= 0x200000;
+ @a;
+ $i++) {
+ $_= shift @a;
+ printf "\t __idlocs \t 0x%06x, %s\n", $i, $_ or die $!;
+}
+print "\t end\n" or die $!;
+# recommended programming order
+# one test on PIC#0
+# first time: erase, write FOO-entire0.hex
+# subsequently if only FOO.asm changed: update FOO.hex
+# for all pics
+# first time: for each individually erase, write perpicNUM.hex
+# subsequently: for all update FOO.hex
+# other possibilities are not ruled out
+#
+# filename conventions - contents of hex files
+# FOO.hex FOO.o (only)
+# FOO-withcfg.hex FOO.o config.o
+# FOO-entire0.hex FOO.o idlocs0.o config.o
+# perpicNUMBER.hex idlocsNUMBER.o config.o
PROGRAM_HEXES= $(addsuffix .hex, $(PROGRAMS)) \
- $(addsuffix -full.hex, $(PROGRAMS))
+ $(addsuffix -withcfg.hex, $(PROGRAMS))
all: $(TARGETS) $(PROGRAM_HEXES)
LINK= gplink -o $@ $^
ASSEMBLE= gpasm -p 18f458
-%-full.hex: %.o config.o
+%-withcfg.hex: %.o config.o
$(LINK)
%.hex: %.o