How-to: programmeerbare logische gadgets (CPLD)

0 Comments

Complex programmeerbare logische gadgets (CPLOS) bevatten de bouwstenen voor talloze 7400-Serries Logic ICS. Totale circuits kunnen zowel op een pc als vervolgens worden ontworpen en vervolgens worden geüpload naar een CPLD voor onmiddellijke implementatie. Een microcontroller gekoppeld aan een CPLD is als een microcontroller gekoppeld aan een herprogrammeerbare circuitkaart en een volledig gevulde elektronicawinkel.

In zeer eerste waren we niet zeker van de brede charme en de toepassing van CPLO’s in hobbyistische projecten, maar we zijn ervan overtuigd. Een aangepaste logica-gadget kan dagen van het lezen van datasheets, het ontdekken van de perfecte logica-IC-combinatie, evenals het wachten op chips om aan te komen. Circuitborden zijn gemakkelijker met CPLO’s sinds een enkele chip met programmeerbare PIN-plaatsing 100s privélogica ICS kan vervangen. Circuitfouten kunnen worden gecorrigeerd door een nieuw ontwerp te uploaden, in plaats van etsen en vullen van een nieuwe printplaat. CPLO’s zijn snel, met reactietijden die beginnen bij 100 MHz. Ondanks hun extreme veelzijdigheid zijn CPLDS een volwassen innovatie met chips die beginnen bij $ 1.

We hebben een thuis-etchable, zelfprogrammeringspromotiebord om je op weg te helpen. Maak je geen zorgen, dit bord heeft een seriële poortinterface voor het werken met de CPLD, evenals geen afzonderlijke (meestal parallelle poort) JTAG-programmeur nodig.

Intro aan cpl

Wanneer een CPLD gebruiken

Overweeg om een ​​CPLD te gebruiken wanneer een stijl meer dan één logische ICS van 7400 series vereist. Een CPLD is goedkoper, sneller, evenals kan worden geprogrammeerd met uw perfecte pin-outconfiguratie voor eenvoudiger PCB’s.

Gebruik een CPLD in lastige stijlen die mogelijk een aantal iteraties nodig hebben. Het is gemakkelijker om een ​​nieuw circuit in softwaretoepassing in te stellen, evenals uploaden naar de CPLD dan het is om te ontwerpen, Etch, evenals dingen een nieuwe printplaat.

Selecteer een CPLD voor maximale snelheid en onmiddellijke reactie. Het verschil in snelheid is geweldig; CPLD’s beginnen bij een 100 MHz, terwijl microcontrollers reageren op onderbrekingen op een paar MHz. CPLD-stijlen Type-circuits die reageren op externe stimulus, reacties gebeuren bijna onmiddellijk. Een microcontroller voert code uit om te reageren op gebeurtenissen, zelfs onderbroken routines hebben een relatief hoog latentie.

Cpld vs fpga

FPGA’s zijn veel beter begrepen dan CPLO’s, maar ze delen veel kenmerken. Deze analogie is niet perfect, maar we vinden het leuk: waar FPGA’s een herprogrammeerbare processorkern zijn, is een CPLD een herprogrammeerbare circuitkaart of breadboard. FPGA’s vervangen microcontrollers, geheugen, evenals andere componenten. CPLO’s nemen in logica IC’s, evenals het werk goed met een microcontroller.

Fabrikanten

Altera evenals Xilinx, de grootste CPLD-fabrikanten, zijn veel beter begrepen voor hun FPGA’s. Lattice Semiconductor is nog één grote CPLD-fabrikant met minder wijk na. Atmel maakt pin-compatibele versies van oude industrie-standaard CPLO’s.

Als u van plan bent om bij 5volts te werken, zijn uw keuzes beperkt. Xilinx XC9500 CPLD’s worden nog steeds aangeboden als nieuwe oude voorraad, hoe extra keer vier keer meer dan nieuwere 3.3VAST-equivalenten. ATMEL’s ATF1502-serie werkt bij 5volts, maar ze bieden geen vrije vooruitgangsomgeving.

Bij 3.3Volts is er meer opties, hoe nieuwe CPLD’s geleidelijk een kern hebben die loopt op 2.5volts, 1.8volts of lager. De Altera Maxii en de Xilinx XC9500XL-serie zijn hoogstwaarschijnlijk de meest prominente 3.3Volt-CPLO’s. Xilinx maakt eveneens de CoolRunnerii CPLD, maar het is echter alleen verkrijgbaar in een TQFP-bundel en heeft een afzonderlijke 1.8Volt-toevoer voor de kern nodig.

Pakketjes

De meeste fabrikanten bieden een of twee CPLO’s in een hobbyistische vriendelijke PLCC 44-pakket, hoewel dit begint te verdwijnen. PLCC is een soice-sized oppervlak Installeer chip met pinnen aan alle vier de zijden. PLCC44-aansluitingen worden vaak aangeboden in via-gat, evenals SMD-versies. Helaas beginnen nieuwere CPLD-huishoudens van de PLCC-bundel af te komen en slechts 44-pin te bieden, evenals grotere TQFP-chips, zoals de coolrunnerii van Xilinx.

Ontwikkelingsomgevingen

De meeste fabrikanten bieden een gratis voortgangsfeer die stijlinvoer ondersteunt die gebruik maakt van eenvoudige schema’s, naast Verilog of VHDL. Velen ondersteunen de nieuwste FPGA’s niet in de gratis versie, maar we vereisen toch alleen de CPLD-onderdelen. Altera heeft quartus, Xilinx heeft ise, evenals rooster heeft Isplever. Atmel heeft Prochip-ontwerper voor de ATF15XX-serie, maar ze bieden slechts een 6 maanden proefvergunning – die ze ons niet echt zouden bieden.

Programmeurs

Het voorschotbord dat we presenteren, vereist geen aparte JTAG-programmeur, aangezien de PIC Microcontroller al de CPLD programmeert. Als u een externe programmeur wilt, zijn de goedkoopste de parallelle poortprogrammeurs: parallelle kabel III voor zowel Xilinx als BytleBlaster voor Altera. Betaalbare klonen, evenals schema’s, worden aangeboden bij Sparkfun. De OpenOCD is een generieke USB JTAG-programmeur die werkt met veel CPLO’s, FPGA’s, evenals armen.

Onze keus

We hebben uiteindelijk geregeld op de Xilinx XC9500XL-serie sinds het HAd a inexpensive advancement set we might utilize to test our JTAG programmer prior to implementing an entire design.

The DO-CPLD-DK from Digilent includes a XC9572XL, a CoolrunnerII, as well as parallel port programmer. Nu Horizons has some old non-ROHS designs for $40, however because of sloppy variable type handling in their credit history card processing scripts, we couldn’t total an order online. We tried to do it over the phone however they refused to take such a little order on the phone, even during a website malfunction. In the end, it was cheaper to pay full cost at Digikey (#122-1512-ND) after including new Horizon’s exorbitant shipping charges. We wouldn’t normally mention this, however with only two locations to buy the board it’s most likely worth noting our experience.

CPLD advancement board

Click right here for a full size schematic picture (PNG). The circuit as well as PCB are designed utilizing the freeware version of Cadsoft Eagle. All the data for this job are included in the job archive linked at the end of the article.

Circuit

A pic 24FJ64GA002 microcontroller (IC1) provides the individual as well as programming interface to the CPLD. We utilize this $4 pic in a great deal of jobs since the peripheral pin choose function makes board routing truly easy. inspect out our introduction to the PIC24F for more details. The pic needs to interact with a PC serial port, so we added an affordable MAX3232 RS232 transceiver. The serial interface should work with a USB->serial adapter.

Our option of CPLD (IC3), a Xilinx XC9572XL (PDF), is linked between the pic as well as a number of other components. We can produce an endless range of circuitry between the pic as well as other chips utilizing the reprogrammable logic inside the CPLD. The pic will program the CPLD with code sent from a PC serial port, however we still brought the JTAG pins to a header for simple outside debugging.

A DS1085 digital programmable oscillator (IC4) produces clock frequencies between 8KHz as well as 133MHz, at 10KHz increments. This is extremely similar to the DS1077 we covered earlier, however it has even steps between all frequencies. The DS1085 needs a 5volt supply (VR2). The I2C interface likewise runs at 5volts, so we linked it to 5volt tolerant pic pins. It’s possible to utilize the 3.3volt 66MHz 1085L instead, as well as eliminate the 5volt supply.

We utilized a inexpensive 3.3volt SOT223 voltage regulator (VR1) to power most of the circuit.  The 5volt supply (VR2) can be excluded if you utilize a slower 1085L 3.3volt oscillator.

CPLDs are commonly utilized as a memory controller, so we included 32K of SRAM (IC5) on the advancement board. A 3.3volt latch with 5volt tolerant inputs interface the memory inputs to a wide variety of outside voltages (IC6). The latch inputs are held low with a 1Mohm resistor network (RN1). We’ll discuss this section extensively in an upcoming article.

PCB

The board is a quasi one-sided design. We made a number of compromises so we might prototype this extremely experimental PCB ourselves. We present the board ‘as is’ for other die-hards that may want to etch this board at home. If you send the PCB to a board house, try to correct these problems prior to creating a ‘real’ double-sided board.

One power pin of the CPLD is missing a decoupling capacitor entirely; there was no method to put a capacitor in that area. One CPLD decoupling capacitor, as well as the SRAM decoupling capacitor, are through-hole parts. utilizing these through-hole parts gotten rid of a few jumper wires.

The jumper wires on the back of the board are optimized for single-sided production, rather than great style practices. We faked a double-sided board by soldering the power bus on the back. A genuine double-sided board style should path the power bus to prevent crossing signal paths, as well as include the missing decoupling capacitors.

We utilized an surface install PLCC chip socket, however a through-hole version is definitely a much better idea. We though the SMD version would be simple to solder, however it [turned out to be] a nightmare. We truly desired the CPLD to be on the front of the board for the coolest possible presentation. A appropriate two-sided board with plated through-holes can have a through-hole socket on the front, however this wasn’t possible with our 1-sided prototype board.

Onderdelen lijst

Click right here for a full size placement diagram (PNG).

Een deel
Waarde

IC1
PIC25FJ64GA002 (SOIC)

IC2
MAX3232CSE (SOIC-N)

IC3
XC9572XL-10PCG44C (PLCC)


PLCC44 socket, SMD

IC4
DS1085 or DS1085L (SOIC)

IC5
32Kx8, 3.3v, SRAM (SOJ)

IC6
74LVT573D (SOIC)

VR1
3.3v regulator, LD1117S33 (SOT223)

VR2
5v regulator, LD1117S50 (SOT223)

C1-11,13-17
0.1uF decoupling capacitors (0805)

C12
0.01uF capacitor (0805)

C15,16
0.1uF decoupling capacitors (through-hole)

C18
10uF tantalum capacitor (A)

R1,2
390ohm resistor (0805)

R3-5
2000ohm resistor (0805)

RN1
1Mohm resistor network (9 pin)

LED1,2
LED (0805)

X1
db9 female serial port connector *untested

J1
2.1mm power jack

ICSP, JTAG, SV1
0.1″ pin header, right angle

S1
Tactile switch (DTSM-6)

Firmware

The firmware is written in C utilizing the free presentation version of the pic C30 compiler. discover all about working with this pic in our introduction to the pic 24F series. The firmware is included in the job archive at the end of the article.

We desired a super simple method to interact with the hardware on the board without endless compile-program-test cycles. We made a custom version of the Bus Pirate firmware that  provides a simple ASCII terminal interface to the DS1085 clock chip (I2C), the CPLD programing interface (JTAG), as well as a 3 cable (SPI) interface to the CPLD. inspect out the Bus Pirate tutorial for background on the simple syntax utilized with the firmware.

The original Bus Pirate firmware handles a number of protocols that share the exact same pins. For the CPLD version, we altered the pin assignments to in shape the connections on the advancement board. We likewise eliminated unused modules as well as options.

CPLD blinky LED examples

We prepared a number of styles in Xilinx’s ISE advancement environment. The schematics, pin placement files, as well as compiled styles (XSVF) are included in the job archive linked at the end of the article.  A full explanation of ISE is beyond the range of this article; we discovered the assist data sufficiently useful to make these examples.

The very first style just lights the LED linked to pin 8 of the CPLD.

Prepare the XSVF file

XSVF is a compressed JTAG programming format, as explained by Xilinx in this application note (PDF). XSVF isn’t restricted to programming Xilinx devices, as well as can be gotten ready for any type of chip that provides a typical BSDL JTAG meaning file.

Open the effect programming tool from the ISE style Suite job panel under Configure target device->iMPACT.

select the choice to produce a limit scan file,  as well as set the type to XSVF.

Give the XSVF output a data name as well as then add a compiled CPLD picture (ex1.jed) when prompted to add a device.

You should see a JTAG chain that contains a single device.

Click on the gadget as well as select program; effect will record the programming sequences to an XSVF file.

With XSVF data in hand, it’s time to open up a terminal as well as program the CPLD. We like Tera Term as well as Hercules on Windows. You must allow XON/XOFF flow manage in the client to utilize the JTAG interface. The default PC side setting for the advancement board terminal is 115200bps, 8N1.

HiZ>m <–select mode 1. HIZ 2. I2C 3. JTAG 4. RAW3WIRE MODE>3 <–JTAG 900 MODE SET 602 JTAG READY JTAG>(2) <–probe JTAG chain macro xxx JTAG INIT CHAIN xxx JTAGSM: RESET xxx JTAGSM: RESET->IDLE
xxx JTAGSM: IDLE->Instruction Register (DELAYED ONE bit FOR TMS)
xxx JTAGSM: IR->IDLE
xxx JTAGSM: IDLE->Data Register
xxx JTAGSM: DR->IDLE
xxx JTAGSM: RESET
xxx JTAGSM: RESET->IDLE
xxx JTAGSM: IDLE->Data Register
xxx JTAG CHAIN REPORT:
0x01 DEVICE(S)
#0x01 : 0xC9 0x02 0x06 0x9A <–XC9572XL responds xxx JTAGSM: DR->IDLE
JTAG>

In the terminal we go into the mode menu (m), as well as select JTAG (3). Macro 2 probes the JTAG chain, in our situation this is just the CPLD.  The chain report tells us that the chip is linked as well as responding. checked out more about the JTAG interface.

Now we can run the XSVF programmer, macro (3), as well as upload the XSVF data from the terminal in binary mode. The very first example just lights the LED on pin 8. If the LED lights, we can confirm that programming was successful. If your LED doesn’t light, don’t despair; sometimes the JTAG programmer sticks as well as a reset macro (1) will get the chip going.

LED at full brightness.

74LS32/4071 OR gate, blink at half rate (/2)

A major element of the CPLD advancement board is the 1085(L) frequency synthesizer linked to pin 7 of the CPLD. The next example utilizes a logic OR gate, like a 74LS32 or 4071 IC, to blink the LED whenever the clock signal is high. At even the slowest clock rate the blinking will be as well quick to see, however we should get a nice PWM dimming impact compared to the very first example.

JTAG>m <–select mode 1. HIZ 2. I2C 3. JTAG 4. RAW3WIRE MODE>2 <–I2C interface to DS1085 900 MODE SET 202 I2C klaar I2C>(1) <–address browse macro xxx browsing 7bit I2C address space. Found gadgets at: 0xB0 0xB1 <–found the DS1085 address I2c>

Program the CPLD as before, as well as then switch to I2C mode to gain access to the DS1085 clock. We might look up the gadget address in th

Leave a Reply

Your email address will not be published. Required fields are marked *