Jump to content

7-Segment display program change


the_ungod
 Share

Recommended Posts

Hi,

I have a midi switch witch controlls relays acording to program change messages, and i need to know what the current program number... for example if i change de program to 1, the led display will show 001, if i change it to the 105, the led display will show 105 and so on...

thanks

Link to comment
Share on other sites

is the midi switch a midibox? if so, just hook up another DOUT module to it (you'll need 16 pins if you go without 7-segment display drivers, assuming not displaying the leading "0" is not a problem, otherwise you'll need 20 pins) and change the source code so it changes the status of the 16/20 pins according to the program number.

Link to comment
Share on other sites

Okay, so you could just split the midi signal (using some inverters for instance) and run it into a core module. Hook up a DOUTx2 to it, wire up the displays - done ;)

The software side is a piece of cake as well, I'll gladly help out if you need anything.

Link to comment
Share on other sites

Each DOUTx4 module gives you 32 outputs.

Using that module is a bit more complicated as the leds are wired in a matrix (for some more info on how this is done check http://ucapps.de/mbhp/button_duoled_matrix.pdf)

I'd suggest using 3 indivual displays, which makes life (on the software side as well) a lot easier for a beginner's project.

Link to comment
Share on other sites

Yes that's the kind of dipsplay that will be easiest to use.

You'll need a common ground, correct. But you won't need 21 output pins. As you only want to display numbers from 0..127, the leftmost display only uses 2 of the LEDs (see attached pic) - which means you need 2 x 7 + 1 x 2 = 16 outputs. Which is exactly how many outputs you get from a DINx2 :-)

5274_digits_png5694fcdcf258bc246beb8f457

5274_digits_png5694fcdcf258bc246beb8f457

Link to comment
Share on other sites

Writing the application isn't reall all that hard ;) You can use the "http://ucapps.de/mios/ain64_din128_dout128_v2b.zip application to test all the individual segments. So you can go ahead and build the hardware and see if it works.

Don't worry about the code at this point. We'll get to that once you got the hardware up and running. As I said, if you for some reason really can't do it, I'll be happy to help out ;)

Link to comment
Share on other sites

Ok, thanks...

I'm building a pedalboard using this http://www.jimkim.de/html/guitar01_01.htm 5x, for 16 pedal, guitar A/B selector. amp A/B selector and plenty fo other functions... but in this case the code is already available and i just program the chip...

I'll build these components (it will take about a month 'cause i'm missing 4x the above switch)

Thanks

Link to comment
Share on other sites

Well 90% of what you need is already done here as well. The only coding you'd have to do is this:


unsigned char segments[10] = {0x3F, 0x06, 0x5B, 0x4F, 0x66, 0x6D, 0x7C, 0x07, 0x7F, 0x6F};

// ...

void MPROC_NotifyReceivedEvnt(unsigned char evnt0, unsigned char evnt1, unsigned char evnt2) __wparam {
if (evnt0 = 0xC0) { // it's a program change on channel 1
unsigned char prog_num = evnt1;
unsigned int status = 0; // all leds off

if (prog_num > 99) { // 1st digit
status = 0xC000;
prog_num -= 100;
}

status |= segments[(prog_num / 10)] << 7; // 2nd digit
status |= segments[(prog_num %% 10)]; // 3rd digit

MIOS_DOUT_SRSet(0, (status & 0xFF)); // set first shift register
MIOS_DOUT_SRSet(1, (status >> 8)); // set second shift register
}
}[/code]

(Untested, just wrote that down quickly to give you an idea) ;)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...