Can a propeller be used to drive a Z80 at 4 MHz?
cbmeeks
Posts: 634
I was thinking of using a propeller to drive a Z80 based computer. The prop would be responsible for the 4 MHz clock and the 8K ROM. Basically the address/data lines would be tied to the prop and the prop could delegate certain tasks such as simulating video memory, external peripherals, etc. Also, it would provide the 4 MHz clock signal.
Is this possible? Or, is 4 MHz simply too fast for bit-banging those pins?
Thanks.
Is this possible? Or, is 4 MHz simply too fast for bit-banging those pins?
Thanks.
Comments
Thanks.
And I wouldn't have thought that 128 MHz would have been possible. My scope only goes to 100 MHz. lol
Now I'm curious, could two cogs be used to "interleave" a high/low signal somehow so that you could double the bandwidth?
Let's say I have the Z80 tied to the prop via the addr/data bus. Next, when the Z80 requests address $D000 (or whatever), could the propeller then switch over to maybe an SPI SRAM chip (like on the Propeller Memory Board) and pass the information through? Like a "glue" logic between the prop and Z80?
There are a lot of Application Notes you could read about the possibilities of the Prop:
https://www.parallax.com/download-family/propeller-p8x32a-application-notes
There. I just gave you a reading assignment for the next week.
There are other threads where the prop has been used to emulate the ROM on a real Z80 and IIRC also the peripherals.
So what you want to do is possible
One thing I'm finding difficult is how can I simply toggle a pin at X times per second?
I'm not finding any tutorials like that.
I'd prefer C over SPIN if I could.
Nevermind. Found it.
I think you will find that you will have to get into pasm to do the timing stuff.
pasm is not that difficult because the language is very regular and you will only use a small portion of the instruction set.
There is an app note for the counters and there are examples that came with PropTool.
You will want to use PASM, the simplest language on the propeller (and its assambly language).
Thanks.
Well, it's not a matter of being easy. I've done PIC assembly too. The issue is learning yet another platform. lol
C is ambiguous.
Not familiar with CMM or LMM.
There are only 16 registers, most of which you won't use. No need to learn, nor initialise, a whole lot of registers!!!
Coupled with that, all instructions are
conditional opcode destination, [#]source [with carry],[with zero], [no result]
Only exception if the rdxxxx/wrxxxx instructions.
Printout the single page cheat sheet (summary), read common instruction brief, and you're done.
for example, here is a led flash program (spin starting of the program not shown, just a single cog/core program) Note I didn't use the lower power option of a waitcnt instruction.
And here is the rest of the required program to start this cog That's all there is to it!
CMM and LMM are the names of two methods the C compiler uses to run compiled code out of Hub ram. LMM is an extremely small interpreter that uses PASM for most of the op-codes. (except for jumps, and interpreter calls) AFIK, CMM is similar, but uses some assumptions to compact PASM op-codes down to 16-bits. (I think the restrictions are fixing the destination, stripping ICZN bits and stripping conditional execution bits) Both interpreters have an overlay loading function, called Fcache, that will insert short bits of ASM inline to run at full speed.
If you're familiar with C and inline ASM code, I'd assume that everything works the same as usual and that you can ignore all these implementation specific details for now. I.e. don't worry about this stuff till you've filled Hub ram or are optimizing for speed.
Marty
the ultimate Z80-Propeller project...
http://searle.hostei.com/grant/cpm/
I then got interested in his cheap (pick - and - mix) FPGA version, which would trundle along at +15MHz. Then I moved house and lost the WS setup, I must get back into it all ...
But a 15 Mhz Z80 might make it worth while!
Hope you get it all back up and running again.
I still have the Z80B and Prop version, tucked away in a box, and it is faster than Cluso's arrangement (twin Props - with Kbd/VDU), but only about double for all of the extra work that was required (but then, I do like the making of things - rather than actually using them). I made quite a few of the Dracboard / Pullmoll version, these only ran about 2MHz equivalent but were self contained to just the one Prop, I made one into the back of a PC Kbd/ We were all waiting for the Prop2 to come along and then CP/M etc should have been so much easier (but I still like DIP chips - eyes banjaxed!)
And yes, Heater, I do acknowledge that it was all started by your 8080 stuff ;-)
http://sowerbutts.com/socz80/
ZiCog is still waiting for the Prop II...
-Tor