Jump to content
  • 0

4 digit 7 segment display IC for BASYS MX3


tadius

Question

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

Hello Tadius,

The code is the Lab1 one :

int main( void )
{

int x,y;                // Input values x and y
int result = 0;         // Operation result
    Hardware_Setup();   // Initialize switches, buttons and LEDs
    TRISBSET =  0b0000111000000000;  // RB9, RB10, RB11 are input   
    ANSELBCLR = 0b0000111000000000;  // ANSB9, ANSB10, ANSB11 = 0
     Set_All_LEDs_On();
     seg7_init();  

The seg7_init(); function makes the system halt in reset after few seconds.

I've  just tried lab2b using 7segments and it is the same.

I tried to add TRISXXbits=0  to set outputs but it is already done in Seg7cfg() function

The 7 segment is working with the demo project but it is not the same library for 7 seg.

 

Link to comment
Share on other sites

Thanks Pal53,

 

My code for this is in my home office so I will have to upload it later today.

 

If the demo is working then that is a good sign, because it means we are not dealing with a hardware fault. We just have to find the bug in your code that is not correct yet to drive a segment.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...