Shop OBEX P1 Docs P2 Docs Learn Events
CPLD as Propeller glue. — Parallax Forums

CPLD as Propeller glue.

Martin HodgeMartin Hodge Posts: 1,246
edited 2011-08-22 05:13 in Propeller 1
This is a small Xilinx CPLD configuration I've been working on to enhance the Propeller in certain ways and to familiarize myself with CPLDs and FPGAs. The impetus for starting down this road was to somehow be able to switch between composite A/V with keyboard, and VGA out, on the same 8 Propeller pins that the Propeller ASC has on it's AUX port.

The project then grew to provide a configurable clock-divider to supply a 5MHz or 6.25MHz clock for the Prop. Finally I2C was added to allow configuration through software. The I2C system has a configurable address and a single 8-bit configuration register. The bits in this register toggle the clock frequency and video output routing. The I2C pins are connected in parallel with the EEPROM to save Propeller pins. This project has been testing and works very well. The most difficult part of this project was devising a way for the CPLD to act as a middleman or repeater for the open-collector keyboard bus. The target device is a Xilinx XC9572XL which is a "legacy" component that can be purchased for less than $3 in qty. I uses a single MEMS 50MHz oscillator to drive the CPLD and, through the freqdiv, the Propeller. A MEMS device is not required but it's so very tiny and simple and has comparible tolerance.

In the atteched images you can see the prototype using a Propeller Platform, a CPLD carrier, a Propeller ASC KVM adapter and a Propeller ASC VGA adapter. The PP was used because it provides access to the EEPROMs I2C bus on it's headers. The spin program demonstrates on-the-fly switching between NTSC and VGA via i2c commands. The video proves the result. Included is a zip file of the Xilinx files that can be opened in ISE. I'm also working on an Altera port of this project.

This is still very much a work in progress. The next step is to devise a way to provide a 3-bit monochrome, or 4 bit grey, VGA output with keyboard. This could be done by routing one or two bits of one signal to all three resistor network channels. I'm not certain that will work but it's worth a try. There are 6 remaining bits in the configuration byte to do more things and a little less than half the macrocells are free in the 9572 part.

DSCF6688s.JPG

Comments

  • Martin HodgeMartin Hodge Posts: 1,246
    edited 2011-08-09 16:22
    this space intentionally left blank
  • TubularTubular Posts: 4,717
    edited 2011-08-09 19:47
    Sweet. I did not know there was a cpld that cheap. Do you know what Altera device you might target yet?

    Look forward to seeing what you do with it.

    cheers
    tubular
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2011-08-10 00:14
    Take a look at the Xtreme 512K memory module for the Hydra. Andre LeMothe implemented programmable logic to provide an enhanced RAM interface. If you have the Xtreme 512K, you can reprogram it in any fashion you prefer OR you can use the documentation as a starting point for other RAM interface schemes.
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2011-08-10 01:30
    I did use a 9572 in a simple substitution of the latches etc on a Dracblade. Originally I had used a 9532 as a start and then used the extra bits in a ' 72 but quickly started to run out of pins and cells.

    I am seriously thinking of getting the Altera demo board and USB programmer that Leon recently posted about. That one should have so much more than my imagination could handle.
    1024 x 768 - 125K
  • AleAle Posts: 2,363
    edited 2011-08-10 02:25
    I also made a project with a XC9572+36 and ran out of cells, the '144 proved better but still too small :(. Altera's EPM240 is as cheap as the '144 but has much more resources and is more flexible (it is a 240 LE FPGA with embedded EEPROM). I'd recommend Altera's devices to well everyone interested because there is a grow path if needed (pin compatible) and the price/features is better than Xilinx. Sadly X's coolrunner devices are not much better than old XC95xx in terms of logic cells, just lower power.
    Martin: nice idea !
    Toby: that is a nice kickass board !
  • jmgjmg Posts: 15,185
    edited 2011-08-10 03:26
    Tubular wrote: »
    Sweet. I did not know there was a cpld that cheap. Do you know what Altera device you might target yet?

    PLDs start under $1 for a 16V8, which can manage a Chroma-modulator, and the CPLDs from Lattice (LC4032ZE) are under $1.50, as are the X2C32A from Xilinx, and the ATF1502 series from Atmel is sub $2.

    Moving up from the classic CPLDs to the 'FPGA CPLDs', I see the Actel A3PN030-Z are now showing in Mouser stock for $3-3.50 /100, which is a good price for what they claim to be ~256 Mcells.

    The Lattice ~640 MC MachXO2 is ~ $6/100, no release yet on the smaller siblings, but likely to be on the same price curve.

    Altera MAX V, in a fine qfp, are $1.70 for ~64MC

    and on the 'Small PLD' in every sense of the word, I see Silego now are showing their new GreenPAK2 !!.
    29c/100+, and a Pgmr for $49.

    http://www.silego.com/buy/index.php?main_page=index&cPath=48

    Their first generation GreenPAK (1) was narrow supply, and only 8 pins, so we never quite found an app, but the new ones are 12 pins, and wide supply, so are much more flexible. I'm sure those will be designed in here.

    Their USB Boards, include some nice instrumentation features - which show what can be done, once you break the shackles of a FTDI Serial chip, and move to a Small Microcontroller.

    Parts are OTP, but I think they have a RAM-loader mode, which coupled with the instruments, mean you can test most things before burning one.
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2011-08-10 04:27
    Until Leon showed me that there were copies of the Altera USB programmer I thought that I would be stuck with the Xilinx chips that I had around. Using their older Parrallel Port Mk3 cable circuit was simple enough for me, but Heater. pointed out that his PC didn't have the legacy ports.

    I will have to come out from underneath my stone, and start to use the Far East markets.

    @ Ale. Thanks, it was a bit thirsty on power as it wasn't a low power chip.The board took about 180mA running MBasic via CP/M (still better than my old Nascom did, that was about 3-4 Amps in total ;-))
  • LeonLeon Posts: 7,620
    edited 2011-08-10 04:32
    I got a Chinese clone of the Xilinx USB cable, also. It works very well. Xilinx gave me one of their parallel port cables many years ago, which I used when I got started with their CPLDs. I prefer the Altera CPLDs to those from Xilinx.
  • TorTor Posts: 2,010
    edited 2011-08-10 05:02
    The board took about 180mA running MBasic via CP/M (still better than my old Nascom did, that was about 3-4 Amps in total ;-))
    Ah, the old Nascom.. as a teenager I managed to somehow find the funds for a Nascom-1 kit, but I could never find or pay for or build a powersupply for it.. all the voltages, all the current, you couldn't just use a cheap find-everywhere one-voltage charger-style PS back in the late seventies. And then summer holidays went without the kit being built (no use without power), school started, we all got AIM-65's to play with, I got the key to the computer room with the mini, and suddenly the 2KB RAM 2MHz Z80 Nascom-1 was obsolete anyway.

    So I never put the kit together. Found it just the other day in a box:

    Nascom-1.png


    -Tor
    829 x 675 - 786K
  • Martin HodgeMartin Hodge Posts: 1,246
    edited 2011-08-10 05:03
    Thanks everyone for your contributions. ;)

    @tubular: I originally started this on an Altera and would like to support both. For whatever reason I got a lot of momentum going on the Xilinx side and was able to reach this stage with it first. Mostly because, after hours of work, a system crash munged the Altera files so bad they wouldn't load anymore.
  • LeonLeon Posts: 7,620
    edited 2011-08-10 05:09
    Some people used to say that Nascom stood for NASty COMputer. :)

    With Z80 FPGA emulations being available, it should be feasible to emulate the Nascom 1 and 2.
  • ColeyColey Posts: 1,110
    edited 2011-08-10 05:17
    Leon wrote: »
    I prefer the Altera CPLDs to those from Xilinx.

    You know I've heard a lot of people say this.
    Why do you prefer Altera? Is there some advantage they have over Xilinx?

    Nice work Martin!

    Regards,

    Coley
  • LeonLeon Posts: 7,620
    edited 2011-08-10 05:29
    The Altera ones are more advanced technically (they are actually FPGAs) than the Xilinx ones. There isn't much to choose between their FPGAs, although Xilinx tends to be more leading-edge with their latest devices. The Altera tools are easier to use than the Xilinx ones.
  • alex123alex123 Posts: 102
    edited 2011-08-10 08:38
    I used Xilinx XC95 series CPLDs for many years. The largest one they have in this series is the 288 mc one but the smallest package is 144 pin TQFP. The Altera has the 570 logic elements (440 mc equivalent - MAX II) in a 100 pin TQFP package. Usually it's the micro cells I run out of not the I/O pins. I recently bought the EPM570T100C5N for $13.3 from Digikey. The XC95288 is $14.7 so it's more expensive per cell.

    Another good part about Altera are the programmers. The least expensive jtag programmer (clone) for Xilinx is about $50 while you can buy the USB Blaster for $15 (free shipping) on eBay.

    Another thing that makes the Altera MAX II a little bit better is the build-in oscillator and a small user accessible EEPROM block on the chip.

    Then again, it may be more fair to compare the CoolRunner to MAX V.

    Just my $0.02...
  • AleAle Posts: 2,363
    edited 2011-08-22 01:15
    But even the coolrunner does not have the architecture of MAX V...
  • jmgjmg Posts: 15,185
    edited 2011-08-22 03:15
    Ale wrote: »
    But even the coolrunner does not have the architecture of MAX V...

    Correct - the CoolRunner has the older, more classic CPLD of wide-AND macrocells, with very deterministic timing.

    The newer CPLDs, like MAX V and Mach XO2, are more granular (FPGA like) and the closest device to the MAX V is presently the Lattice Mach XO2, which has the edge, in having RAM on board, and a regulator.

    The MAX V goes smaller in device size, (so gets under $1), whilst the Mach XO2 has only one member priced so far, but it gives more 'macrocells' & RAM than the closest Altera part.

    A complete MachXO2 kit, is just $29.. Someone will do a MachXO2 + Prop PCB ?
  • LeonLeon Posts: 7,620
    edited 2011-08-22 04:03
    I designed a PCB with a Propeller, MAX II EPM570 and fast SRAM a couple of years ago, but no one seemed interested in it. Here is the schematic and the first draft layout:

    http://www.leonheller.com/Prop-CPLD/Prop-CPLD.pdf
    http://www.leonheller.com/Prop-CPLD/prop-cpld_layout.GIF
  • jmgjmg Posts: 15,185
    edited 2011-08-22 04:35
    Leon wrote: »
    I designed a PCB with a Propeller, MAX II EPM570 and fast SRAM a couple of years ago, but no one seemed interested in it. Here is the schematic and the first draft layout:

    Looks quite good to me.

    With the 100 pin footprint, you could update that to the larger and much cheaper LCMXO2-1200HC-4TG100CR1,
    with some simple track shuffling ?

    Add in a CP2105 for a Dual serial link, and it would be universlly useful
  • Martin HodgeMartin Hodge Posts: 1,246
    edited 2011-08-22 05:13
    I almost have this project ported to the Altera EPM7064. In the process I found that the Altera part seems to have less hysteresis on the inputs than the XC9572 making it fairly sensitive to slow rising edges. Adding a series of DFFs to those inputs was necessary. Also the XC9572 is winning in economy of macrocells. This project took about 60% of resources on the 9572 and is taking upwards of 80% on the 7064.
Sign In or Register to comment.