SEARCH
TOOLBOX
LANGUAGES
modified on 21 June 2010 at 15:01 ••• 14,064 views

Using CPLD/2

From Manuals

Jump to: navigation, search

Contents

Reference Implementations

Monitor

This monitor application uses the CPLD to watch events and trigger an alarm when a condition is reached. By delegating the monitoring task to the CPLD, the processor can concentrate on other tasks. If properly implemented, this distributed processing can lead to very efficient applications. The event being monitored is the number of pulses on pin 30 (PXC7) of the extended I/O connector J12. It uses two CPLD registers: the current count (RXA) and the count limit (RXB). Once the count limit is reached, the interrupt line (IO_INTR) is asserted. A status of the count changes is printed on serial port COM1. The count changes are monitored every 100 ms. The alarm event is handled asynchronously using an interrupt service routine (ISR). To run this application, download the monitor.svf firmware to the CPLD using the procedure in section 3 of the manual and the cpld_monitor.bin firmware to the microcontroller using a JTAG or the Luminary Flash Programmer.

SPI Port Extender

The SPI port extender application expands the available I/Os to the processor using both the extended I/O connector J12 and the PC/104 connector J13. The PC/104 signals are reclassified according to table 2-1.

(*) Controlled by MCU, not CPLD firmware. Table 2-1: PC/104 connector pin out for Extended I/O


For applications that do not require PC/104 expansion, this maximizes the number of available I/O on the board. It allows up to 63 I/Os as listed in Table 2-2. A

The application writes a four line message to the LCD twice a second, scrolling the text on every instance. It also displays a marching pattern in port XA with its reverse in port XB. The state of port XC is read and printed on serial port COM1. To run this application, download the xtender.svf firmware to the CPLD using the procedure in section 3 of the manual and the cpld_xio.bin firmware to the microcontroller using a JTAG or the Luminary Flash Programmer.

ISA Bus Master

The ISA bus master application allows expansion using PC/104 standard I/O cards on connector J13. The extended I/O connector is still available with the restrictions on table 2-3.

The application writes to an SSD display at address 0x0106 on a PC/104 I/O card. It also copies the state of a DIP switch at address 0x0107 on the card to port XA on the extended I/O connector and an SSD display on port 0x0106. A status is printed twice per second on serial port COM1.

To run this application, copy the pc104.svf firmware to the CPLD using the procedure in section 3 of the manual and the cpld_isa.bin firmware to the microcontroller using a JTAG or the Luminary Flash Programmer.