Close

The Noob Looks At FPGAs and CPLDs

A project log for The Last Psion

Resurrecting Psion's SIBO/EPOC16 Platform For The 21st Century

alex-brownAlex Brown 09/19/2018 at 10:021 Comment

When I started thinking about this project, I knew there was going to be quite a steep learning curve. Picking up JavaScript after a long absence, trying to wrap my head around C after trying (and failing) to do so about 20 years ago, learning more about electronics than just holding a soldering iron the right way around.

What I wasn’t expecting to learn was how to design a microchip.

As I said in my last log, I am worried that a regular ARM microcontroller won’t be fast enough to handle the 3.84 MHz clock speed of the data coming from the Psion Series 3c. It’s something I hadn’t considered at the beginning, as I assumed that processors had come on enough in the 27 years since the original Series 3 was released that they would be able to handle the speed.

Fortunately, a few very kind people have already sent me messages with ideas on how to tackle this.

On comp.sys.psion.misc (via Google Groups), Theo gave me some food for thought:

The protocol is rather interesting.  I think doing it in a CPLD (basic FPGA) would probably be most flexible, but I can understand that's a place you don't want to go. Also, you need to a device with 5V capability, which is quite rare nowadays.

It sounds like the tricky bit is dealing with the up-to-5MHz input signal. I wonder whether you could take a couple of 12-bit shift registers.  One is an input, which latches data coming out of the ASIC. The other is an output, which you enable to send data to the ASIC. With a little bit of control logic to handle synchronisation and latching, it essentially reduces your 5MHz one-bit problem to a 400kHz parallel-word problem, which is a lot easier to deal with in software.

Depending what you feel comfortable with, you could have a couple of shift register chips in TTL logic, and then wrap up the control logic in another programmable logic device (PAL, GAL, CPLD, whatever you prefer). Or maybe it's simple enough to do in a few TTL logic gates.

Shift registers didn’t even cross my mind when I started, but using them makes sense. What I need to work out is how to control the data going back to the Psion. I think I would need to monitor the incoming IO, checking the first three bits sent from the 3c for a data request command, then get the output shift register to send data back. (Assuming I have understood the way the SIBO Serial Protocol works, that is.)

The thing is, I hadn't heard of FPGAs before a week ago and the first time I'd come across a CPLD was in Theo's message. So, as I'm sure you can see, using programmable logic chips is a completely different paradigm for me. Using them adds more questions to a project that already seems very complicated to me. For example, will I be able to get enough current from the 3c to be able to power both a CPLD or FPGA and a microprocessor? How do I get them to talk to each other? Not only that, how do I go about learning VHDL?

First, though, I need to really understand what’s going on between an SSD and the 3c. At Theo’s suggestion, I have already ordered a CY7C68013A-based logic analyser (under £4 on eBay, shipped from China) so that I can look at the data going back and forth. In an ideal world I would be able to tell which end of the wire is sending data at any given time. I do like Theo’s suggestion on this:

For instance, gimp the power supply so the SSD voltage is slightly lower than the other, or something like that?

That might be the easiest option. I need to build a “break-out” cable anyway, so that I can use an SSD outside the 3c. Perhaps I can connect up a separate 5v supply on a slightly different voltage? Of course, this could be an ideal project for me to get going with programmable logic.

So, I’m currently worrying about which FPGA or CPLD development board to buy. Do I go with Xilinx or Altera? Is one manufacturer’s software better than the other’s? Do I buy one with an in-built JTAG programmer? What size is suitable for this? How much money is this all going to cost me?

Like I said, I wasn’t expecting to have to think about these things when I started. But I’m not going to lie, there’s part of me that’s a little excited. The kid who wanted to build his own computer is finally getting his wish.

Discussions

Michael Cullen wrote 09/25/2018 at 18:52 point

I suspect a fast microcontroller might actually be fast enough - probably not anything like an arduino or a javascript-based environment. Something like a Teesnsy or Nucleo might be worth looking into - they run much faster! (there's a 180MHz teensy that should do it I think if you're careful!)

  Are you sure? yes | no