User manual

Basys MX3™ Board Reference Manual
Copyright Digilent, Inc. All rights reserved.
Other product and company names mentioned may be trademarks of their respective owners.
Page 18 of 56
val = PORTBbits.RB1; // read BTNU
val = PORTBbits.RB0; // read BTNL
val = PORTFbits.RF0; // read BTNC
val = PORTBbits.RB8; // read BTNR
val = PORTAbits.RA15; // read BTND
Please note that if you want the buttons to trigger a specific functionality, proper software debouncing is required.
Library functions for using the buttons are contained in the Basys MX3 library pack, BTN library; however, the user
can easily use the buttons without the BTN library, as presented above.
5.3 Shared Pins
As shown in the connectivity Table 5.1 above, some pins are shared:
Buttons BTNL and BTNU share functions with PGD and PGC signals used for programming. Therefore, the
following line should be inserted in the code, to disable their programming function.
#pragma config JTAGEN = OFF
Buttons BTNR and BTND share the pins with S0_PWM and S1_PWM, explained in Servo headers section,
so these resources should be used exclusively.
BTNC is shared with TRIG_1 signal in 2x15 Pins Debug Header, so it can be used to trigger events in an
Analog Discovery board experiment.
6 RGB LED
The Basys MX3 board contains one tri-color (RGB) LED. The LED allows the user to obtain any RGB color by
configuring the R, G and B color components.
Figure 6.1. RGB LED schematic diagram.
The usage of the RGB LED is the same as controlling three separate LEDs, one for each color. Figure 6.1 shows the
way the RGB LED is electrically connected on the Basys MX3.