DSX USBIF UGv1
DSX USBIF UGv1
DSX USBIF UGv1
DSX
Experimenter Module
USB Interface User Guide
DSX-USBIF-UG-V1
Written by Mark Benjamin
UTS: ENGINEERING
D SERIES
DSX
Table of Contents
Table of Contents ................................................................................................................................. 2
Revision History .................................................................................................................................. 3
Known USB Interface Issues ............................................................................................................... 4
Inaccessible COM Port .................................................................................................................... 4
The Issue ...................................................................................................................................... 4
Work Around ............................................................................................................................... 4
Introduction to the DSX USB Interface ............................................................................................... 5
Overview ...................................................................................................................................... 5
DSX Kirra .................................................................................................................................... 5
Initial Setup Process ............................................................................................................................. 7
Appendix 1: Serial Port Emulation Mode .......................................................................................... 19
Configuring SPE Mode .................................................................................................................. 20
UART TX Enable ...................................................................................................................... 20
UART RX Enable ...................................................................................................................... 20
USB Loop Back ......................................................................................................................... 21
DTR Signal Required from PC to open UART ......................................................................... 21
Baud Rate Configuration ........................................................................................................... 21
Appendix 2: Troubleshooting ............................................................................................................ 22
PGM, SPE and USB Activity LEDS are simultaneously lit .......................................................... 22
Device not recognised message is displayed in Windows ............................................................. 22
UTS: ENGINEERING
DSX-USBIF-UG-v1
DSX
Revision History
Version
V1
Date Released
30/03/2013
UTS: ENGINEERING
Changes
First Revision of this Document.
DSX-USBIF-UG-v1
Author
Mark Benjamin
DSX
Work Around
Before attaching the DSX Kit to the PC, ensure that the DSX Kirra software is closed. After the
USB Cable is connected, DSX Kirra can be started.
UTS: ENGINEERING
DSX-USBIF-UG-v1
DSX
DSX Kirra
DSX Kirra is a PC Application which is used in conjunction with the DSX Experimenter Module
for the following tasks:
Erase, Program and Read the Microchip PIC16F877A Microcontroller Device installed in
U3 socket on the Experimenter Module. To program the Microcontroller device, a
programming file (HEX) is required which contains the machine code of the firmware that
will run on the Microcontroller. The programming file is generated in the Microchip
MPLAB Integrated Development Environment (IDE) software.
Erase and Program the Xilinx XC9572XL Complex Programmable Logic Device (CPLD)
installed in the U4 socket on the Experimenter Module. To program the CPLD, a
programming file is required, which can be in XSVF, SVF or JED formats. The
programming file is generated in the Xilinx ISE software
Configure Serial Port UART Baud Rate on the PIC18F2550. The UART on the
PIC18F2550 connects to the UART on the PIC16F877A. This allows serial communications
between an application running on a PC and the PIC16F877A.
UTS: ENGINEERING
DSX-USBIF-UG-v1
DSX
Configure the Programmable Clock sources which drive the Global Clock inputs on the
CPLD.
DSX Kirra and the DSX Operating System are available from the DSXonline course on UTS
Online.
UTS: ENGINEERING
DSX-USBIF-UG-v1
DSX
Important Note
DSX Kirra on the DSX 2011 Software DVD is an old version and should no longer be used.
If you have installed DSX Kirra from the Software DVD, please uninstall this software, and
obtain the latest DSX Kirra from DSXonline.
UTS: ENGINEERING
DSX-USBIF-UG-v1
DSX
c. Ensure the Application, SPE Driver and OS Firmware components are all
selected. Press Next> to continue.
UTS: ENGINEERING
DSX-USBIF-UG-v1
DSX
e. Select a Start Menu Folder for the DSX Kirra shortcuts. Press Next> to continue.
UTS: ENGINEERING
DSX-USBIF-UG-v1
DSX
UTS: ENGINEERING
DSX-USBIF-UG-v1
10
DSX
For
32 bit
Windows
For
64 bit
Windows
Note: the file paths listed above are the default DSX Kirra paths. If you have installed DSX
Kirra to a custom path, then you will need to find the \DSX\Kirra\SPE Driver folder in
your custom path.
5. Follow the SPE Driver Installer prompts.
a. Press Next>
UTS: ENGINEERING
DSX-USBIF-UG-v1
11
DSX
6. Connect the USB Cable to the USB Socket on the DSX Kit.
DO NOT attach the USB cable to the PC.
7. Power up the DSX Kit with a suitable plug pack.
8. Attach the USB Cable to a USB Port on the PC.
UTS: ENGINEERING
DSX-USBIF-UG-v1
12
DSX
UTS: ENGINEERING
DSX-USBIF-UG-v1
13
DSX
b. The DSX_OSV300.osf file will appear in the dialog box. Select this file, and press
Open.
The DSX Operating System Firmware File (OSF) is included with the full installer version of
the DSX Kirra v2.30 application. If no osf file appears in the file dialog box, or if a different
version appears then you can download the DSX_OSV300.osf file from UTSOnline under
the following path
UTSOnline -> DSXonline -> Software -> DSX Kirra -> New Version -> DSX Kirra, DSX OS,
Device Driver: Individual Downloads
UTS: ENGINEERING
DSX-USBIF-UG-v1
14
DSX
UTS: ENGINEERING
DSX-USBIF-UG-v1
15
DSX
Important Note
Immediately after the operating system has been downloaded, the CPLD may not
be detected properly. To resolve this problem simply click on the Check
Communication button and the CPLD should be successfully detected.
11. Remove the USB Cable from the PC.
Remove the USB cable from the PC USB Port, but leave the USB cable attached to the DSX
Kit.
12. Close DSX Kirra
13. Reattach the USB to your PC
14. Reopen DSX Kirra
UTS: ENGINEERING
DSX-USBIF-UG-v1
16
DSX
If the version are less than those listed above, then you have probably used an old
version DSX Kirra and/or the DSX Operating System. Please download the latest
version from UTSOnline, and start back from step 1.
16. Check Serial Port connection
The COM port number allocated to the DSX Kit is shown on the bottom status bar in DSX
Kirra. The allocated COM port number may change if another device takes ownership of the
COM port on your PC (this cannot happen while the DSX Kit is attached to your computer),
or if you take the DSX Kit to another computer.
UTS: ENGINEERING
DSX-USBIF-UG-v1
17
DSX
c. Press OK.
d. DSX Kirra will indicate that the Serial Port Settings were successfully updated in the
status window.
UTS: ENGINEERING
DSX-USBIF-UG-v1
18
DSX
PC
(USB 2.0 Host)
USB Interface
Microcontroller
User Programmable
Microcontroller
RX
TX
USB 2.0
Device
Interface
(RC7)
UART
UART
RX
TX
(RC6)
PIC18F2550
USB
Cable
PIC16F877A
DSX
Experimenter Module
A block diagram of the SPE mode is shown in the above diagram. The PIC16F877A and
PIC18F2550 are interconnected together with 2 hardwired serial data lines which provide a full
duplex serial data interface.
The serial data lines are interfaced into hardware UART (Universal Asynchronous Receiver
Transmitter) peripherals on both the PIC16F877A and PIC18F2550. The UART consists of two
parts, a transmitter and receiver. The transmitter takes a byte of data which is loaded into the
TXREG by the user firmware, adds a start and stop bit, and then shifts each bit of data onto the TX
pin of the UART peripheral. The period between shifting each bit is controlled by the selection of
the baud rate.
The receiver does the opposite to the transmitter. Serial data is periodically sampled (the period is
dictated by the baud rate), and the sampled value is stored in a shift register. Once the start bit, data
byte and stop bit has been received, the data byte is loaded is loaded into the RCREG of the UART
peripheral, and the firmware running on the Microcontroller can then read this byte.
When the DSX Kit is attached to the PC a new communications port will be allocated to the
Operating System running on the computer. This communications (COM) port is accessible by any
application that supports RS232 serial communications (eg hyper terminal). Any data that is
transmitted to the COM port allocated to the DSX Kit is sent via USB to the PIC18F2550. The
PIC18F2550 will buffer the data from the PC, and then load each byte into its hardware UART
peripheral for transmission to the PIC16F877A.
Serial Data transmitted from the PIC16F877A will be buffered in the PIC18F2550 and will be
transmitted to the PC over the USB interface when the application running on the PC is ready to
accept new data.
UTS: ENGINEERING
DSX-USBIF-UG-v1
19
DSX
UART TX Enable
Enabled
All serial data received from the PC is buffered in the PIC18F2550, and is transmitted to the
PIC16F877A. The baud rate used for the transmission is dependent on the baud rate configuration.
Disabled
All serial data sent from the PC to the PIC18F2550 is discarded. The TX to RX line connecting the
PIC18F2550 top pin RC7 on the PIC16F877A is placed in a high impedance state.
The TX should be disabled in the following set up conditions:
1. Pin RC7 on the PIC16F877A is going to be used for regular I/O functions; OR
2. An external UART TX signal is going to be interfaced to the Receive Line (RC7) in the
PIC16F877A.
UART RX Enable
Enabled
All serial data received from the PIC16F877A is buffered in the PIC18F2550, and is transmitted to
the PC.
Disabled
Any serial data sent to the PIC18F2550 from the PIC16F877A is ignored.
UTS: ENGINEERING
DSX-USBIF-UG-v1
20
DSX
Application Configuration
For application configuration the PIC18F2550 baud rate is configured directly by the PC
application that opens the DSX COM port. The PC application may prompt the user to setup
the baud rate prior to the COM port being opened. Other PC applications may have a fixed
baud rate setting. In the case of a terminal client program like HyperTerminal the user needs
to correctly configure the baud rate setting prior to opening the COM port.
Hardware Locked
The UART baud rate on the PIC18F2550 is locked to a specific value set in DSX Kirra. The
hardware locked checkbox needs to be ticked, and the appropriate baud rate needs to be
selected. Any baud rate setting selected in the user PC application is ignored.
UTS: ENGINEERING
DSX-USBIF-UG-v1
21
DSX
Appendix 2: Troubleshooting
PGM, SPE and USB Activity LEDS are simultaneously lit
This indicates a primary oscillator failure, specifically the crystal is not working. In this case please
check soldering around the PIC18F2550 crystal (Y2), and capacitors (C19, C20 ), and the soldering
of the PIC18F2550 IC Socket, and fix any suspect solder joints. If this does not resolve the problem,
the crystal will need to be removed and replaced, which should only be done by a tutor at a support
session.
UTS: ENGINEERING
DSX-USBIF-UG-v1
22