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.…
22/52
TRISBbits.TRISB12 = 0; //RB12 set as output
ANSELBbits.ANSB12 = 0; //RB12 analog functionality disabled
TRISBbits.TRISB13 = 0; //RB13 set as output
ANSELBbits.ANSB13 = 0; //RB13 analog functionality disabled
TRISAbits.TRISA9 = 0; //RA9 set as output
TRISAbits.TRISA10 = 0; //RA10 set as output
TRISGbits.TRISG12 = 0; //RG12 set as output
TRISAbits.TRISA14 = 0; //RA14 set as output
TRISDbits.TRISD6 = 0; //RD6 set as output
TRISGbits.TRISG13 = 0; //RG13 set as output
TRISGbits.TRISG15 = 0; //RG15 set as output
TRISDbits.TRISD7 = 0; //RD7 set as output
TRISDbits.TRISD13 = 0; //RD13 set as output
TRISGbits.TRISG14 = 0; //RG14 set as output
A seven segment display controller is implemented in the SSD () library of the Basys MX3 library pack. Here are some details on the
implementation of the library:
One array contains constant values for the segments configurations (one bit for each segment) corresponding to various digits (0-9,
A-F).
When the user selects the values to be displayed, they are used as index into this segments configuration table and the resulting
configuration bytes are stored in global variables.
Timer1 is used to generate interrupts every 3 ms (corresponding to the period register PR1 = 3750).
Every time the interrupt handler routine is called, the following operations are performed:
The next digit becomes the current digit, in a circular approach (thus each digit will be addressed once after 4 calls of the
interrupt handler routine)
All digits are deactivated by outputting 1 to their corresponding anodes.
The cathodes are outputted according to the segments information corresponding to the current digit
The current digit is activated (0 is outputted to its corresponding anode)
The Basys MX3 features a basic LCD () module, the Sunlike Display SD1602G with a KS0066U display controller. It displays two rows of
16 characters. It is controlled using a set of command signals (DISP_RS, DISP_R/W, DISP_EN), and 8 data signals (DB0 - DB7). These
signals make up a parallel port for communicating with the display.
7.2. Functionality
8. LCD Module