Bus Controller: can I use EMIF / DMA?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
MaJa_1553636
Level 3
Level 3
First like given

Hi (new guy here),

   

I am trying to figure out how I can let my PSoC-5LP be a System Controller for a Z80 computer project I am doing. Functionality I have in mind is loading programs directly into Z80 memory, debug support, extended (above 64k) memory management etc. I started with a UART implementation to hook up to a terminal on the PC (just to get a feel for it) and now I have that working, I was looking into how to transfer a (Z80) program from the PC, over UART link, directly into the memory of the Z80 computer.

   

I looked at the EMIF and DMA sample which looked relatively simple. However the designer does not allow me to re-assign the ports in use by the EMIF for other purposes. The problem is that the EMIF only need to be active when I am doing a DMA into external Z80 memory. At any other moment the EMIF needs to be disconnected and the Address and Data bus are used for monitoring purposes (inputs) - and perhaps some external memory decoding (also inputs).

   

I am starting to think that the EMIF is not the correct tool for the job, but I would like some confirmation from people that have a little more experience on the PSoC than I have (like I said, new guy). Also if you have any suggestions for alternative solutions...

   

Thanx, Marc

0 Likes
5 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Marc,

   

EMIF is a memory interface. What kind of memory are you using on the Z80 side? What does the interface look like (can't be a two-port memory?) What are the historical reasons 🙂 you are keeping alive the Z80? No money for a Raspberry PI??

   

Why do you want to use DMA? The PSoC is much faster than the Z80, you might transfer data by using an 8-bit port and some control-lines. This concept you even may cast into an UDB component using verilog.

   

 

   

Bob

0 Likes
MaJa_1553636
Level 3
Level 3
First like given

The Z80 Memory is normal 64k SRAM (64kx8 bits) - not dual ported in anyway. I have 4 chips but for now I only try to interface one. I do not 'want' to use DMA, it just seemed the right thing for the job - perhaps it's not in this case.

   

The Z80 is a 20MHz one, so its pretty quick - but for transferring a Z80 program to memory slower is no problem.

   

I started this project because the Z80 has some sentimental value and to learn how to design a simple computer and to learn new things along the way. I do not want a Raspberry PI ;-).

   

I have seen a couple of tutorial video's about UDB components but I am not familiar with them, also, I do not know any Verilog, although I started in VHDL a short while ago. I am planning on getting into that too, but I am trying not to do everything at once. I learn best by getting to grips with small blocks and combing them and build from there. I am currently just past the hello world stage. I have never programmed PSoC type of devices before, but it sparked all kinds of new (for me) ideas in my head.

   

So it seems the EMIF (or DMA) is not suited for a bus controller function. Am I better of with three 8-bit ports I control from the C? At least then it looks like I am able to have output, input and Hi-Z control on those lines...

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

You can do with fewer ports, there are pin drive modes using in-out and enable, so that you may use a single 8-bit port and some control signals as R/W and OE for the sram.

   

 

   

Bob

0 Likes
MaJa_1553636
Level 3
Level 3
First like given

Yeah, I've seen them. But I still need to attach the complete 16-bit address bus, 8-bit data bus and around 8 control signals in order to perform the other tasks I had in mind.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

So get it on, winter is quickly gone...   😉

   

 

   

Bob

0 Likes