gmc wrote:
I've checked around on the interwebs and cannot find any examples of someone doing this so either
a) There is some reason why it won't work
b) No one is crazy enough to do this.
I suspect the latter...
But I don't see why not...
Things that I'd b thinking about...
The clock - Sure, trivial to output a free-running clock from the ATmega, but is that what you want? The reality is that you'll have to synchronise the other signals to the clock, so here I'm wondering if the 6532 might have a fully static design or does it need a clock to wiggle away to keep some internal registers refreshed - data sheet says the RAM is static, but what about the data direction registers - the output register and maybe the clock/timer registers (although personally I might just quietly ignore those - at least to start with).
If it can work statically then it becomes quite easy. From the ATmega side: Keep clock (ph2) output low, Keep R/W High. You can hard-wire CS1 and CS2, RS Low, send it a reset pulse (from the ATmega) then you can test reading/writing the internal RAM:
Output address
Output Data
Set R/W output Low
Pulse Clock from Low to High then to Low again - High time must be at least 10µS.
Repeat that with a different data pattern (e.g. the inverse of the address).
Then read it back in a similar manner
So you can then do a simple RAM test with the device effectively running in a static mode.
You can do similar to write and read the IO ports, again with an effective static clock.
And if that works, well, you have a GPIO expander for the ATmega - although one that needs some 20 IO pins on the ATmega to give you 16 output bits, but that's progress for you
Might actually make a good RIOT tester device - maybe that's your aim?
Of-course if it all just doesn't work because it needs a dynamic clock then you might have to formulate a plan B - I'd be looking at a timed ISR on the ATmega side to wiggle the clock and look for commands passed in via some shared RAM so the ISR can set the right data/address/RS/RW just before it sets the clock high...
-Gordon
_________________
--
Gordon Henderson.
See my
Ruby 6502 and 65816 SBC projects here:
https://projects.drogon.net/ruby/