Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Z80 to PIC interface ?

Status
Not open for further replies.

sae140

New Member
I'm currently firming-up an ultra-low-power minimalistic Z80 SBC.
128Kb of static ram, some of it configured as ROM, and a real-time clock - and only 3 chips so far .....

Ok - the time has come to consider I/O, and the obvious choice would be to use a single PIC - say a 18F4520 or similar, so that I could use the Slave Port (maybe ?) and gain access to the impresssive range of peripherals that the PIC offers.

I've had a look at the Parallel Slave Port, and can see that it would need an extra interrupt/ handshaking line for efficient bi-directional communication - but before taking this any further, thought I'd check with you guys first: if you were tackling this job - what form of Z80 to PIC communication would you choose ? Simplicity and reliability being more important here than speed.
Thanks
 
Ok - the time has come to consider I/O, and the obvious choice would be to use a single PIC - say a 18F4520 or similar, so that I could use the Slave Port (maybe ?) and gain access to the impresssive range of peripherals that the PIC offers.
hi,
An excellent VLSI peripheral IC for use with the Z80 is the Z84C90, it a 84 pin PLCC device.
 

Attachments

  • Z84C90.pdf
    355.5 KB · Views: 483
Last edited:
Just about all the 28- and 40-pin PICs have a hardware USART. Just about anything in the 16F and 18F series should suffice. These have a receiver and transmitter register, both with multibyte buffers and interrupt capability. This leaves you free to have the PIC running chores until you start pumping a serial stream from the Z80 into the Receiver's buffer. This causes an interrupt. The PIC drops what it's doing and starts processing the serial input. This would have a simple command structure using one- or two-letter commands, combined with values as needed, to define what needs to be done. A simple one-letter command may be just a "report status" command, in which case the PIC takes, say, several ADC readings and I/O port values (looking at switches and stuff) and sends them to the Z80. The Z80 then parses all this data and maybe sends further commands based on the contents.

Microchip also makes a series whose models start with "MPC", I don't know the rest. These are ICs specifically designed for jobs like yours. They have a serial control system used by any processor that can do serial, actually SPI I think. You should do a search on uchip's site for these.
Have a fun project.
ken
 
Some useful replies there - much appreciated.

I particularly want to stick to my philosophy of having a minimum chip count, and serial comms of any kind will need at least one more chip at the Z80 end. If inter-processor comms were going off-board, then I would certainly consider some form of serial.

Although I'll definitely be using a PIC as a peripheral device, ironically I found Eric's suggestion to be the most useful - not in using the Zilog peripheral itself - but rather his suggestion to use a device in a PLCC package.

Without realising it, I'd set myself an upper limit of 40-pin DIL (for obvious ease of proto-typing), but on checking some of the larger quad-packaged PIC's I find that many have 7 or more tri-state I/O ports. With so many ports to play with I could even invoke /BUSRQ and write the I/O data directly into a reserved area of the Z80's RAM, without using so much as one external decoding chip or tristate buffer !

Or I could stay with the PSP, create 2 extra handshaking lines (RTS:- Output Buffer Full, request Z80 read, and CTS:- Input Buffer NOT Full, Z80 may send) to convert a Slave Port into an active port, and transfer I/O data in a more conventional way.

Plenty to think about now.

Many thanks
 
Some useful replies there - much appreciated.

I particularly want to stick to my philosophy of having a minimum chip count, and serial comms of any kind will need at least one more chip at the Z80 end. If inter-processor comms were going off-board, then I would certainly consider some form of serial.

Although I'll definitely be using a PIC as a peripheral device, ironically I found Eric's suggestion to be the most useful - not in using the Zilog peripheral itself - but rather his suggestion to use a device in a PLCC package.

Without realising it, I'd set myself an upper limit of 40-pin DIL (for obvious ease of proto-typing), but on checking some of the larger quad-packaged PIC's I find that many have 7 or more tri-state I/O ports. With so many ports to play with I could even invoke /BUSRQ and write the I/O data directly into a reserved area of the Z80's RAM, without using so much as one external decoding chip or tristate buffer !

Or I could stay with the PSP, create 2 extra handshaking lines (RTS:- Output Buffer Full, request Z80 read, and CTS:- Input Buffer NOT Full, Z80 may send) to convert a Slave Port into an active port, and transfer I/O data in a more conventional way.

Plenty to think about now.

Many thanks

hi,
If you live in the UK, I will send you a couple of Z84C90's, FOC.
 
Eric - many thanks for your generous offer - but I've just realised that I've been looking at this in a 'back-to-front' manner:
For ease of prototyping I started-off by considering 2 x 40-pin DILs: a Z80 and a PIC (16F8877 or 18F4520) talking to each other.

Then, because of losing valuable pins from the PIC in the process of establishing a comms link, I was prepared to venture into pastures new (and a tad scary !) by hand-soldering an 80-pin quad-packaged PIC onto an adapter ...

So - why not reverse things, and hand-solder a 100-pin quad-packaged Z84C015 instead - which of course has an on-board UART - and opt for a 40-pin DIL PIC (with on-board UART, of course) to supply all the rest of the toys ... ?
And, by using a 'conventional' comms link, the PIC can then be programmed much more easily in a high-level language.

So I think this is the way I'll proceed now. I really appreciate the input from this forum - it's helped me crystallise the design. Just 4 chips - can't be bad.

And now to make it. If anyone has first-hand experience of hand-soldering large quad packages - especially with dodgy eyesight ! - any tips would be appreciated.

Thanks
Colin
 
Hi there,

There's also the simple 74LS138 approach. Maybe one chip for inputs and one chip for outputs.
 
Here is an excellent YouTube video ...

Excellent - thanks. I see there's also one there by the same guy using a clothes-iron to remove SMDs - think I'll have a play with doing that to get some practice in with re-soldering, while I wait for the Zilog chips to arrive.

BTW - does anyone have a source for 100-pin QFP adapters - 0.65mm pitch, 30 x 20 pin matrix ? UK preferred if possible. I can't see any on Ebay, although there's a guy in Thailand selling 144-pin 0.65mm pitch adapters, so I could use those at a pinch.


MrAl - yes indeed - the '138 and '139 are my favourite decoding chips - but on this project I'm after a minimum chip count.
By careful selection of chips (some might say 'over-careful' !) a CP/M-capable design with an array of clever peripherals has resulted using just 4 chips with no decoding or glue logic - although I have cheated a bit by using one resistor-diode 'OR gate'. I only hope the proposed system works !!

'best
Colin
 
Last edited:

Mornin' Eric - that site is pretty typical of many I've looked at - every adapter in the book, except the one I'm looking for !

I have found a supplier, but they're in Thailand, and their ordering page is written in Thai ! Well, no-one said that this was going to be straightforward ;^) Time for an email, methinks ....

**broken link removed** (the one I want's on the right - with assymetric pin layout)

'best, Colin
 
The continuing saga of the TQFP adapter ...
Just in case anyone else needs one of these - the Thai company I mentioned above sells 'em on Ebay. Item no: 320557649948

Strange thing is - before today this item wasn't showing up on Ebay's search engine - but now it is. Spooky.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top