Reply 20 of 611, by Jepael
wrote:This: http://www.nomad.ee/micros/isapic.gif looks almost ideal, but I'm still wrapping my head around the logic.
In general that is a good circuit to start. Just ask if you have a specific question.
Yes, you need data in latch, data out latch and some control flip-flops. Never put the microcontroller sitting directly on the ISA bus. Well unless it has a suitable interface for doing that, like PC keyboard controllers do.
The point is when PC writes to IO port, the data gets written to a latch, and the write signal sets a flip-flop as a flag that data is written. Then this flag is available for PIC and PC status IO port, so that PC knows it is not free to write next byte, and PIC knows it must now read the latched data, and to reset the write flip-flop.
Also same thing to other direction. When PIC has data to PC, PIC writes this into a latch, and this latch signal also toggles a status flip-flop. This status flip-flop is readable by PC status IO port so that PC knows there is data for reading, and also the PIC knows the PC has not yet read it. Also, the flip-flop can raise the PC IRQ line. Then when PC reads the data port, it gets the data from latches, and the read strobe clears the flip-flop, so that again PC status says no more data, PIC knows it can write more data, and also it clears the pending IRQ.
Of course there must be the control write port as well, to reset the MCU into different modes somehow.
But I still suggest to consider the use of PIC. The original 6801 MCU is clocked at 4 MHz, running internally at 1 MHz, but it has more registers than PICs I know so comparing those clock by clock the PIC has to execute more opcodes to do the same thing as 6801. Of course you can clock PICs higher, and there are more sophisticated PICs. But still, consider something modern with free developement tools for writing large C code and good debugging capabilities. I may be biased as I havent used PICs lately, as I have used AVRs and ARMs since.