Dr Jefyll wrote:
Thanks for linking to that, Paganini.
That's the trouble with forums that have been running so-long - so much there if you know the right search runes...
Dr Jefyll wrote:
drogon wrote:
I have 25 bytes spare in page 0 I can use that to map in the VIA (only 16 bytes, so I still have 9 bytes free for subsequent data and I know I'll need at least 4 for some serial code I've yet to write)
Yikes, that does sound uncomfortably close to the limit.
Still in the spirit of keeping an open mind to all options on the table, perhaps you should consider having half of the VIA registers in z-pg and the other half not! Unless I'm missing something, the hardware changes would be minimal. And, importantly, you'd have more headroom -- an "oh no!" cushion
-- for the code that's yet to be written.
-- Jeff
Things are changing fast and I've almost sorted it out...
So moving data in/out of ZP - that's actually easy for this application (Squeezing my TinyBasic into a minimal system) as I'm fully embracing the facilities of the linker in ca65 and editing the data files lets me move data trivially - obviously the more I can store in ZP the faster TinyBasic will run and the more program code for Basic programs is left available but another little thorn lurks there and that's serial IO. I'm going to have to bit-bang serial out of the VIA so having that in ZP may be to my advantage.
Splitting the registers over the boundary - I could do that if I ran another address line into the decode GAL to give me 8-byte resolution - right now it has A[4:12] giving me 16-byte boundaries.
The 2nd thorn concerns a 3-bit register I need for the EEPROM banks - it's a 32KB device in a 4KB address space, so being able to control the top 3 address bits would give me 8 banks so I need a latch somewhere - and that was going to be the VIA, but if I can use the GAL for this too then I need a 2nd block to use as the address for the bank select register..
I could use the GAL as a polled 1-bit input register and latched 1-bit output register for serial but then the EEPROM bank would have to be in the VIA.
Or I do away with the VIA and put in a simple latch - 3 bits for the EEPROM and 5 bits spare...
Or do that AND have a VIA.
Almost too many choices now..
At least that's the theory, anyway. I'm still bouncing ideas round my head but what I have decided is to NOT map hardware at $00 but at $F0 instead - I feel there's less chance of a hardware crash then if some random program writes to 0 by accident. (Which is ORB/IRB in a VIA)
I also promised myself I'd not start this until the solstice.. but I already have the PCB half laid out... Oh well.
Making the VIA optional might be nice too... Oh well... Going to start breadboarding it next week...
Cheers,
-Gordon
_________________
--
Gordon Henderson.
See my
Ruby 6502 and 65816 SBC projects here:
https://projects.drogon.net/ruby/