I am trying to use the 4 digit 7 segment display on the new BASYS MX3 development board.
At first the sample code found in Digilent's classroom files that they offer in Lab1b was not working. I decided to try multiple combinations of simple code to see if any of the displays LEDs would come on at all. Here is the following code I used in a simple while(1) loop:
LATGSET = BIT_12; // Segment A off
LATACLR = BIT_14; // Segment B on
LATDSET = BIT_6; // Segment C off
LATGCLR = BIT_13; // Segment D on
LATGSET = BIT_15; // Segment E off
LATDCLR = BIT_7; // Segment F on
LATDSET = BIT_13; // Segment G off
LATGCLR = BIT_14; // Segment DP on
LATBSET = BIT_12; // Display 0 off
LATBSET = BIT_13; // Display 1 on
LATACLR = BIT_9; // Display 2 off
LATASET = BIT_10; // Display 3 on
The display is a common anode device and to turn on the segment LEDs you should drive them low (logical 0).
Nothing comes on anywhere and I wonder if I am still missing some key instructions?
I can attach actual code files if it helps.
Thanks in advance for any help that can be provided!
Question
tadius
Hello,
I am trying to use the 4 digit 7 segment display on the new BASYS MX3 development board.
At first the sample code found in Digilent's classroom files that they offer in Lab1b was not working. I decided to try multiple combinations of simple code to see if any of the displays LEDs would come on at all. Here is the following code I used in a simple while(1) loop:
LATGSET = BIT_12; // Segment A off
LATACLR = BIT_14; // Segment B on
LATDSET = BIT_6; // Segment C off
LATGCLR = BIT_13; // Segment D on
LATGSET = BIT_15; // Segment E off
LATDCLR = BIT_7; // Segment F on
LATDSET = BIT_13; // Segment G off
LATGCLR = BIT_14; // Segment DP on
LATBSET = BIT_12; // Display 0 off
LATBSET = BIT_13; // Display 1 on
LATACLR = BIT_9; // Display 2 off
LATASET = BIT_10; // Display 3 on
The display is a common anode device and to turn on the segment LEDs you should drive them low (logical 0).
Nothing comes on anywhere and I wonder if I am still missing some key instructions?
I can attach actual code files if it helps.
Thanks in advance for any help that can be provided!
Link to comment
Share on other sites
8 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.