7/30/2019
Basys MX3 Reference Manual [Reference.Digilentinc]
https://reference.digilentinc.com/reference/microprocessor/basys-mx3/reference-manual?_ga=2.68739409.1349070004.1564406803-1961480359.…
14/52
Label
Schematic Name
PIC32 Pin
Description
LD2
LED2
SCL2/RA2
Led 2
LD3
LED3
SDA2/RA3
Led 3
LD4
LED4
TDI/CTED9/RA4
Led 4
LD5
LED5
TDO/RA5
Led 5
LD6
LED6
TRCLK/RA6
Led 6
LD7
LED7
TRD3/CTED8/RA7
Led 7
All the pins must be defined as digital output (their corresponding TRIS bit must be set to 0):
TRISAbits.TRISA<0-7> = 0; // LED<0-7> configured as output
In order to turn an LED () on or off, turn the corresponding digital output pin high or low by writing 1 or 0 to the corresponding LATA
register bit.
LATAbits.LATA<0-7> = 1; // turn led on
or
LATAbits.LATA<0-7> = 0; // turn led off
Library functions for using the LEDs are contained in the Basys MX3 library pack, LED () library. However, the user can easily use the
LEDs without the LED () library, as presented above.
Eight switches are provided, labeled SW0 – SW7 on the board and in the schematic, attached to eight digital IO pins of the PIC32. Reading
the switches is done by basic access to an input IO pin. Read more details in Digital Inputs and Outputs chapter.
Figure 4.1 shows the way the switches are electrically connected on the Basys MX3.
3.2. Functionality
4. User Switches