複素プログラマブルロジックガジェット(CPLD)には、多数の7400(Serries Logic IC)のためのビルディングブロックが含まれています。全回路はPC上で設計することができ、その後即時の実装のためにCPLDにアップロードすることができる。 CPLDにリンクされているマイクロコントローラは、再プログラム可能な回路カードと対になっているマイクロコントローラと、完全に蓄積された電子機器店と同じです。
まず最初に私たちは広い魅力と趣味プロジェクトでのCPLDの適用が確信していませんでしたが、私たちは確信しています。カスタムロジックガジェットは、データシートの読み取りの日を取り除くことができ、完璧なロジックICの組み合わせを発見してから、チップを到着させるのを待っています。プログラム可能なPIN配置を備えた単一チップは、100SのプライベートロジックICを置き換えることができるため、CPLDが簡単になります。回路誤差は、新しい設計をアップロードすることによって、新しい回路基板を詰めるだけでなく、新しい設計をアップロードすることによって補正することができます。 CPLDは速い、反応時間は100MHzから始まります。極端な汎用性にもかかわらず、CPLDはチップが1ドルで始まる成熟した革新です。
私たちはあなたが始めるためにホームエッチング可能な自己プログラミング前進ボードを持っています。心配しないで、このボードにはCPLDを操作するためのシリアルポートインタフェースがあります。また、別の(通常はパラレルポート)JTAGプログラマーを必要としません。
CPLDSへのイントロ
CPLDを利用する場合
スタイルが2つ以上の7400シリーズ論理ICを必要とするときにCPLDを利用することを検討してください。 CPLDはより安価で、より速いPCBのための完璧なピンアウト構成でプログラムすることができます。
いくつかの反復が必要な場合があるトリッキーなスタイルでCPLDを使用してください。ソフトウェアアプリケーションで新しい回路をスタイル化しやすく、それが設計、エッチング、そして新しい回路基板を詰めるだけでなくCPLDにアップロードするのが簡単です。
最大速度と即時の応答の場合は、CPLDを選択してください。速度の違いは素晴らしいです。 CPLDは100MHzで始まりますが、マイクロコントローラは数MHzの割り込みに応答します。外部刺激に反応するCPLDスタイルタイプの回路は、反応がほとんど瞬時に起こります。マイクロコントローラはイベントに反応するためのコードを実行し、割り込みルーチンでさえ比較的高い待ち時間を持つ。
CPLD対FPGA.
FPGAはCPLDよりもよく理解されていますが、それらは多くの特性を共有しています。この類推は完璧ではありませんが、私たちはそれが好きです。ここで、FPGAが再プログラム可能なプロセッサコアである場合、CPLDは再プログラム可能な回路カードまたはブレッドボードです。 FPGAは、マイクロコントローラ、メモリ、および他のコンポーネントを置き換えます。 CPLDは論理ICを取り込み、マイクロコントローラでうまくいきます。
製造業者
最大のCPLD製造業者であるザイリンクスと同様にアルとして、彼らのFPGAにはずっとよく理解されています。ラティスセミコンダクターは、近隣の近所のより大きなCPLD製造業者です。 Atmelは、PIN互換のバージョンの古い業界標準CPLDを作ります。
5ボルトで働く予定の場合は、選択肢が制限されています。ザイリンクスXC9500 CPLDはまだ新しい古い株式として提供されていますが、これまでの3.3Voltの4倍以上の経費です。 AtmelのATF1502シリーズは5ボルトで動作しますが、無料の進歩環境を提供していません。
3.3ボルトではより多くのオプションがありますが、新しいCPLDは次第に2.5ボルト、1.8ボルト、または低いコアを持ちます。 ALTERA MAXIIおよびザイリンクスXC9500XLシリーズは、最も顕著な3.3Volt CPLDです。ザイリンクスも同様にCoolRunnerIIのCPLDを作りますが、TQFPバンドルでのみ使用可能であり、コアの別の1.8ボルト電源が必要です。
パッケージ
ほとんどの製造業者は、趣味に優しいPLCC 44パッケージで1つまたは2つのCPLDを提供していますが、これは消え始めています。 PLCCは、4つの側面すべてのピンを備えたSOICサイズの表面設置チップです。 PLCC44ソケットは一般的にスルーホールとSMDバージョンで提供されています。残念なことに、新しいCPLD世帯は、PLCCバンドルを取り除き始めているだけでなく、ザイリンクスのCoolRunneriiなどの44ピンだけでなく44ピンだけでなく44ピンしか提供していません。
開発環境
ほとんどの製造業者は、VerilogまたはVHDLに加えて、単純なスキーマを利用してスタイルエントリをサポートする無料の進歩雰囲気を提供します。無料版の最新のFPGAをサポートしていませんが、とにかくCPLD部品を要求するだけです。アルテラにはQuartusがあり、ザイリンクスはISE、およびラティスがispleverにあります。 AtmelはATF15XXシリーズのためのProchip Designerを持っていますが、6ヶ月のトライアル許可しか提供していません。
プログラマー
PICマイクロコントローラがすでにCPLDをプログラムしているため、我々が存在する前進ボードは別のJTAGプログラマーを必要としません。外部プログラマが必要な場合は、最も安いポートプログラマは並行ポートプログラマです。ザイリンクスのための並列ケーブルIII、およびアルテラのためのBillBlasterです。 Sparkfunでは、手頃な価格のクローン、およびスキーマが提供されています。 openocdは、多くのCPLD、FPGA、およびArmsで動作する一般的なUSB JTAGプログラマーです。
私たちの選択
私たちは最終的にザイリンクスXC9500XLシリーズに登録していますd 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.
回路
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.
パーツリスト
Click right here for a full size placement diagram (PNG).
部
価値
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
j.
2.1mm power jack
ICSP, JTAG, SV1
0.1″ pin header, right angle
S1
Tactile switch (DTSM-6)
ファームウェア
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.ホイズ
2. I2C
3. JTAG
4. RAW3WIRE
MODE>3 <–JTAG
900モードセット
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.ホイズ 2. I2C 3. JTAG 4. RAW3WIRE MODE>2 <–I2C interface to DS1085 900モードセット 202 I2C準備完了 I2C>(1) <–address browse macro xxx browsing 7bit I2C address space. ガジェットを見つけました: 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