Functionality; Shared Pins; User Buttons - Digilent Basys MX3 Reference Manual

Hide thumbs Also See for Basys MX3:
Table of Contents

Advertisement

Basys MX3™ Board Reference Manual
TRISBbits.TRISB9 = 1;
ANSELBbits.ANSB9 = 0;
4.2

Functionality

In order to read the switches, the user needs to read the corresponding digital input pin. A value of 1 indicates the
switch as being on (high) or 0 indicates the switch as being off (low).
val = PORTFbits.RF3;
val = PORTFbits.RF5;
val = PORTFbits.RF4;
val = PORTDbits.RD15; // read SW3
val = PORTDbits.RD14; // read SW4
val = PORTBbits.RB11; // read SW5
val = PORTBbits.RB10; // read SW6
val = PORTBbits.RB9;
Library functions for using the switches are contained in the Basys MX3 library pack, SWT library; however, the
user can easily use the switches without the SWT library, as presented above.
4.3

Shared Pins

As shown in the connectivity table above, SW7 driving signal is shared with the TRIG_2 signal in 2x15 pins
Header.
5

User Buttons

There are five buttons on the board, labeled BTNU, BTNL, BTNC, BTNR, BTND both on the board and in the
schematic, attached to five digital I/O pins of PIC32. Reading the buttons is done by basic access to an input I/O
pin. Read more details in
Digital Inputs and Outputs
Figure 5.1 shows the way the buttons are electrically connected on the Basys MX3.
Copyright Digilent, Inc. All rights reserved.
Other product and company names mentioned may be trademarks of their respective owners.
// RB9 (SW7) configured as input
// RB9 (SW7) disabled analog
// read SW0
// read SW1
// read SW2
// read SW7
section.
Debug
Page 16 of 56

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Basys MX3 and is the answer not in the manual?

Questions and answers

Table of Contents