Shop OBEX P1 Docs P2 Docs Learn Events
Interface a BS2 to a computer / microprocessor (ZX81/Z80) question?? — Parallax Forums

Interface a BS2 to a computer / microprocessor (ZX81/Z80) question??

T&E EngineerT&E Engineer Posts: 1,396
edited 2006-10-05 07:29 in BASIC Stamp
Has anyone interfaced a BS2 (or is it possible) to a microprocessor like a Z80 or preferably a ZX81. I know about the keyboard project - but wondering how to use the address lines. I would like to us a EEPROM like a 24LS128 (or something similar in that series) with the ZX81 but it is serially interfaced but through a BS2 it may be possible.

Comments?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-04 17:21
    The BS2 (and serial memories like the 24LS128) are very slow compared to the timing of a microprocessor like the Z80. Sometimes the microprocessor is completely static and can wait for its memory or I/O indefinitely, but often they're not static and have timing constraints that a BS2 could not meet. Even if the processor is static, you're talking about at least a 1:1000 speed loss. If you wanted to do this as a teaching tool, to be able to show how a microprocessor appeared to the outside world, you could use a 74HC165 to read the address lines. You probably would want to use the Stamp pins directly to handle the data bus because it's bidirectional. I wouldn't use an EEPROM anyway for the memory because the locations in the memory can only be written a limited number of times (about 100000) and writing is very slow (milliseconds). You could use a RAMTRON FRAM serial memory for this. It's faster and has no practical write limitations.
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2006-10-04 22:07
    Not to get too far off the topic....how about using an SX-28 (SX/B) instead of the BS2.

    I would have thought that the BS2 and other PIC chips would be much faster than 80's technology like the Z80 but I guess I'm wrong.

    I'm just trying to use what I have and know·if I can before I buy any FRAM chips.



    Thanks.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-10-04 22:26
    Hello,
    ·
    ·· The architectures of these two systems are so radically different.· The Z80 is a CPU whereas the BASIC Stamp is a hybrid microcontroller.· More appropriately the interpreters on all BASIC Stamps are microcontrollers.· The Z80 connects to its I/O and memory through 3 system busses (Address, Data, Control) whereas on a microcontroller that is all internal and what you have are the I/O pins as your direct interface.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-05 00:25
    The SX48 has about 36 I/O pins available. This would allow you to directly connect the Z80 address bus, data bus, and the necessary control signals for memory access. The SX48 is quite fast and Parallax has very inexpensive prototype boards with a voltage regulator and programming port. You could certainly connect a RAMTRON FRAM with the other pins and maybe use a few pins for an I/O expander and emulate some simple I/O.

    Is there some reason why you want to do it this way rather than use a byte-wise static memory chip? RAMTRON even has a 32K x 8 parallel FRAM. One would be trivial to connect while two would just require a couple of discrete gates to decode the most significant memory bit. You could still use an SX48 or SX28 as an I/O emulator to provide some parallel ports and serial ports
  • GadgetmanGadgetman Posts: 2,436
    edited 2006-10-05 07:29
    It would be helpful to know exactly what you want to do, but...

    If you want them to 'talk' to each other, you could just put a couple of latches on a board connected to the ZX81's expansion connector.
    You also need an address decoder or some sort connected to the lower 8bit of the address bus and to the processors I/O signal.
    Then you just need to use the Z80's I/O instructions to read from and write to those latches.
    (This can possibly even be done using ZX Basic )

    But there's no reason for you to go through the BS2 just to read/write to a EEPROM...
    The Z80 should have the speed to 'bit-bang' the serial comms without much problem.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Don't visit my new website...
Sign In or Register to comment.