1 - POWER - USER - CH - 002 - DS0001 - Exploring A Simple LED Driver

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

Discovery Session 1

Exploring a Simple LED Driver

Overview
In this exercise we will use a Digital IO Instrument and Configurable LED Controller, to control a row of 8 tricolor LEDs
on the NanoBoard 3000. Each LED has 3, user accessible pins (one for each of the R, G, & B values). Power is
supplied by the NanoBoard using a low-side driver. The RGB signals are accessible through a port plugin component.
To modify the RGB values, we’ll drive each of the LED controller’s inputs with an output of Digital IO Instrument.

Prerequisites
This tutorial assumes a basic understanding of the process of placing and wiring objects in Altium Designer (including
components, net labels (including net connectivity), and wires / buses). No additional information is required.

Design Detail
For this exercise, you will need to place the following components from their respective libraries:

Component Library Name in Library

CLK_BRD FPGA NB3000 Port-Plugin.IntLib CLOCK_BOARD

LED_R[7..0]
LED_G[7..0] FPGA NB3000 Port-Plugin.IntLib LEDS_RGB
LED_B[7..0]

U?
LED0_ON LED0
FPGA Peripheral.IntLib LED_CTRL
C
LED_CTRL

U?
Configurable Digital IO
AIN[7..0] AOUT[7..0] FPGA_Instruments.IntLib DIGITAL_IO
DIGITAL_IO

Table 1. List of components required by the design

DS0001 - Exploring a Simple LED Driver 1


Figure 1. Schematic for the Session 1 design.

Tutorial steps – preparing the hardware


1. Select File»New»FPGA Project to create a new, blank FPGA Project.
2. Select File»New»Schematic and add a new blank schematic to your FPGA project.
3. Select File»Save Project As to save the project document. You will first be prompted to save the schematic,
followed by the project document. Name the documents LED_Control.SchDoc and
LED_Control.PrjFpg respectively.
4. From the Libraries panel, locate and select the LED_CTRL component and click Place.
5. Before completing the placement, press Tab on the keyboard to open the Component Properties dialog, and
set the Designator to U1,
6. Then click the Configure button on the lower left of the Component Properties dialog, to open the Configure
LED Controller dialog.
7. Configure the component as it appears in the Figure 2, click OK to close the dialog, then place the component
approximately in the centre of the schematic sheet.

DS0001 - Exploring a Simple LED Driver 2


Figure 2. Configuring the LED Controller

8. From the Libraries panel, locate and select the DIGITAL_IO component and click Place.
9. While it is floating on the cursor, press Tab to open the Component Properties dialog.
10. Change the component’s Designator to U2, then click the Configure button on the lower left of the dialog to
open the Digital I/O Configuration dialog.
11. For the Input Signal AIN[7..0], change the Style property to LED Digits, and the Color property to Red.
12. Using the Add button to the right of the Input Signals section of the Digital I/O Configuration dialog, add 2
additional groups of input signals. These will appear as BIN[7..0] and CIN[7..0] in the list of Input
Signals.
13. For these new Inputs, set the Style property to LED Digits, and the Color property to Green and Black
respectively (we will use Black as there is no Blue option).

DS0001 - Exploring a Simple LED Driver 3


Figure 3. Configuring the Inputs of the Digital IO instrument.

14. Now for the Output Signals. For the existing Output Signal, AOUT[7..0], change its Style property to
Slider.
15. Using the Add button to the right of the Output Signals section of the Digital I/O Configuration dialog, add 2
additional groups of Output Signals. These will appear as BOUT[7..0]and COUT[7..0] in the list of Output
Signals.
16. Configure these new Output Signals to also have a style of Slider, as shown in Figure 4.

DS0001 - Exploring a Simple LED Driver 4


Figure 4. Configuring the Outputs of the Digital IO instrument.

17. Click OK to close the Digital I/O Configuration dialog and place the DIGITAL_IO component on the schematic
below the LED_CONTROLLER, as shown in Figure 1.

18. Place Bus lines to wire up the LED_CONTROLLER output pins back to its input pins, as shown in Figure
5.
The DIGITAL_IO is also connected to the input pins of the LED_CONTROLLER. These connections can be
created by placing Bus lines directly between the DIGITAL_IO pins and the LED_CONTROLLER pins, or
alternatively, Net Labels can be placed, creating what is called logical connectivity in Altium Designer. As the
designer, you can choose when it is more appropriate to use physical connectivity (hard wiring) or logical
connectivity, depending on the requirements of the design and your organisation.

19. To connect using Net Labels, click the Net Label button, then press the Tab key to open the Net Label
dialog. Type in the Name Blue[7..0], and place the first Net Label on the upper-most Bus line, as shown in
Figure 5.

Figure 5. Connect the output pins to the input pins using Bus lines, and place Net Labels.

DS0001 - Exploring a Simple LED Driver 5


20. After clicking to place the first Net Label, a second will appear on the cursor, press Tab to edit its value, type in
the Name Green[7..0], and place the second Net Label on the second Bus line. Place the Red[7..0] Net
Label on the 3rd Bus line, as shown in Figure 5.
21. Place the CLOCK_BOARD and LED components on either side of the LED_CONTROLLER, as shown in
Figure 1. As both of these components reference resources on the NanoBoard 3000, there is no need to
designate these parts.
22. Complete the wiring on both sides of the LED_CONTROLLER, as it appears in Figure 1. Note that the
CLK_BRD component is the only component connected with a Wire , all others are connected using Bus
lines.
23. This completes the hardware capture, save your work (File»Save All).

Tutorial steps – implementing the design on the NB3000


24. The next step is to create the connectivity from the ports on the schematic sheet, through to the actual pins on
the target FPGA. This mapping is done by constraint files, which detail port-to-pin mapping, along with other
relevant design specifications, such as the target device, clock allocations, and so on. To constrain the design
you will need an NB3000 connected to your PC via a USB cable, once you have this, open the Devices View
by selecting View»Devices View from the menu, or clicking the button on the toolbar.
25. Enable the Live checkbox at the top right, to establish communications between Altium Designer and the
NB3000.
26. Right-click the NanoBoard 3000 icon and select Configure FPGA Project»LED_Control.PrjFpg to auto-
configure the design, as shown in Figure 6.

Figure 6. Right-click on the NB3000 icon to configure the design

27. The Configuration Manager will open automatically, showing the constraint files that have been detected and
added to the project, and the configuration that has been created (NB3000XN_04). A configuration is simply a
set of constraint files, using configurations allows you to divide your constraints into separate constraint files,
and also allows you to easily target the same design to different devices. We will use this automatically
created Configuration, click OK to close the dialog.
28. The build flow buttons should now appear below the NanoBoard icon (Figure 7), with an arrow showing which
target FPGA the design will be downloaded into. Below that is the selected project + configuration that will be
programmed into the device.

DS0001 - Exploring a Simple LED Driver 6


Figure 7. The build flow shows which project + configuration is targeting the device, and its current build status.

29. Click the Program FPGA button in the build flow to run through the stages up through and including
programming the device. Note that the Xilinx ISE software must be installed to be able to do this, as it is used
to perform the Build stage of the process.
30. From the Devices View, right-click the DIGITAL_IO instrument in the Soft Devices chain and select
Instrument to bring up the component’s Instrument Rack.
31. Adjust the sliders and notice the change in the colours and intensity of the tricolour LEDs.

Figure 8. Move the sliders to illuminate the LEDs in the chosen color.

32. Select File»Save All to save your work.

DS0001 - Exploring a Simple LED Driver 7


Some additional items for you to try
Below are some suggestions for additional things you might try as you further explore the tools and the new
environment. These changes are not required by later exercises, but it is strongly recommended that you save
a backup of your current source files first, before continuing.
• Modify the Digital IO Instrument in schematic and change the output port names from AOUT[7..0],
BOUT[7..0], etc. to RED[7..0], GREEN[7..0], and BLUE[7..0]. Once completed, you will need to
rebuild the design from the Devices View.
• Rewire the design to produce only white light that varies only in luminance (intensity). Hint: You should be
able to achieve this with only one, non-clock input and a single output on the LED_CONTROLLER connected
to a single port on the Digital IO instrument. Once completed, you will need to rebuild the design from the
Devices View.
• Explore adding some of the simple logic gates available in the library FPGA Generic.IntLib. Components
with 8-bit bus pins will be indicated by the term ‘8B’ in their component name. Once completed, you will need
to rebuild the design from the Devices View.

DS0001 - Exploring a Simple LED Driver 8


Revision History
Date Revision No. Changes

21-Jul-2009 1.0 New document release

Software, hardware, documentation and related materials:


Copyright © 2009 Altium Limited.
All rights reserved. You are permitted to print this document provided that (1) the use of such is for personal use only and will not be copied or
posted on any network computer or broadcast in any media, and (2) no modifications of the document is made. Unauthorized duplication, in whole
or part, of this document by any means, mechanical or electronic, including translation into another language, except for brief excerpts in published
reviews, is prohibited without the express written permission of Altium Limited. Unauthorized duplication of this work may also be prohibited by local
statute. Violators may be subject to both criminal and civil penalties, including fines and/or imprisonment. Altium, Altium Designer, Board Insight,
Design Explorer, DXP, LiveDesign, NanoBoard, NanoTalk, P-CAD, SimCode, Situs, TASKING, and Topological Autorouting and their respective
logos are trademarks or registered trademarks of Altium Limited or its subsidiaries. All other registered or unregistered trademarks referenced
herein are the property of their respective owners and no trademark rights to the same are claimed.

DS0001 - Exploring a Simple LED Driver 9

You might also like