AndersNielsen wrote:
Alternatively it's possible to make the "dance" by connecting A10->A12->A14 and A11->A13 ... if you're willing to sacrifice even more ROM space of course. It'll look strange if you dump the ROM but you should still have the "full" 4096 bytes of ROM space.. And of course it'll have to be programmed with that in mind initially.
If I understand correctly, this method is actually "genius". It eliminates the need for any RIOT I/O pins (yay!) and should significantly reduce ICSP code 'overhead'. As for programming... all write operations go into ROM address space ($1000..$1FFF) or shadows ($3xxx, $5xxx,...$Fxxx). Write to $1AAA for $2AAA and write to $1555 for $5555. Do not try to write to $2AAA because that address is a shadow of the 4K RIOT address space (decodes to $0AAA).
Cheerful regards, Mike
<added>
BTW, revised code is 99 bytes which is kinda' cool but the fragmented ROM is a bit too exotic for me.
Please don't get carried away trying that code. I exit the serial Rx routine after sampling the middle of the 8th bit and I need to make sure that a little more than another half-bit time elapses before re-entering that routine. Some other subtle considerations, too. I apologize. I was initially just interested to see if example code could fit in 128 bytes. The program will need more work if someone actually wants to try and use it.
Code:
; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
; Ander's suggestion to connect A10->A12->A14 and A11->A13
; reduces 'overhead' considerably by spreading the 4kB ROM
; address space across 4 ROM sectors ($0XXX, $2XXX, $5XXX,
; and $7XXX) in a way that allows the ROM to recognize the
; $2AAA and $5555 command addresses by writing to $1AAA &
; $1555 in normal decoded ROM address space (or shadows).
;
; ---ADDR--- A14 A13 A12 A11 A10 A09 A08 -ROM SEES-
; 1000..13FF 0 0 0 0 0 x x 0000..03FF
; 1400..17FF 1 0 1 0 1 x x 5400..57FF
; 1800..1BFF 0 1 0 1 0 x x 2800..2BFF
; 1C00..1FFF 1 1 1 1 1 x x 7C00..7FFF
;