Jump to content

How many douts does it take to...?


sidysm

Recommended Posts

k, hopefully the last last question before I finalise the planned controls for my box.

I plan to run 16 segment meterbridges (  )and 11 segment led rings.

Would I need an output for eac set set or each LED ie. would one of each of the above require to outputs from a dout board or 26 from 4 Dout Boards?

Link to comment
Share on other sites

k, hopefully the last last question before I finalise the planned controls for my box.

I plan to run 16 segment meterbridges (  )and 11 segment led rings.

Would I need an output for eac set set or each LED ie. would one of each of the above require to outputs from a dout board or 26 from 4 Dout Boards?

Link to comment
Share on other sites

  • 2 years later...

I dont understand how it is possible to multiplex and have different values for each ledring ...  ???

Electrically speaking and programmatically speaking, the last values sent to the connectors with resistor will update ... the whole bunch of ledrings with that value  :( Only thing you can do is shut off some rotarys but that's all ...

Playing with MIOS_DOUT_PinSet0( ) and MIOS_DOUT_PinSet1( ) I could not set two different values for each ledring ...  ::)

Did I misunderstood something ??? What's wrong with my ... logic ?  :D

Goule

Link to comment
Share on other sites

It's easier to set 8 pins at once with the MIOS_DOUT_SRSet() function, it should be done within the SR_Service_Prepare() hook, which is called each mS before the LEDs will be updated.

Programming handling for this circuit: http://www.ucapps.de/mbhp/mbhp_doutx4_ledrings.pdf

First cycle: set D7 of the first shift register (SR1) to 0 (ground), and all other outputs of SR1 and SR2 to 1 (+5V)

As a result, only the first row of LEDs will lit, all others will close (cathode driven with +5V)

set the data outputs of SR3 and SR4 to the pattern which should be displayed by the first row

On the next cycle (1 mS after SR_Service_Prepare() has been called again), set D6 of SR1 to 0, all other to 1, and apply the pattern for the second row to SR3 and SR4

Once the 16th row has been reached, switch back to the first

So - a loop takes 16 mS. And now the trick: if a LED row is not supplied with power for 15 mS, it will continue to lit for a short moment. The brightness will be lower, but you won't regognized that it's switched off/on very quickly.

Btw: see the code in mm_vpot.c of the MIDIbox MM application for an example which drives 8 LED rings:


/////////////////////////////////////////////////////////////////////////////
// This function should be called from SR_Service_Prepare in main.c
// it copies the current LEDring pattern to the DOUT registers
/////////////////////////////////////////////////////////////////////////////
void MM_VPOT_LEDRing_SRHandler(void)
{
#if LEDRINGS_ENABLED
  static unsigned char sr_ctr;
  unsigned int anode_pattern;

  // increment the counter which selects the ledring that will be visible during
  // the next SRIO update cycle --- wrap at 8 (0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, ...)
  sr_ctr = ++sr_ctr & 0x07;

  // select the cathode of the LEDring (set the appr. pin to 0, and all others to 1)
  MIOS_DOUT_SRSet(LEDRINGS_SR_CATHODES, cathode_patterns[sr_ctr]);

  // set the LEDring pattern on the anodes
  anode_pattern = ledring_pattern[sr_ctr];
  MIOS_DOUT_SRSet(LEDRINGS_SR_ANODES_1, anode_pattern & 0xff);
  MIOS_DOUT_SRSet(LEDRINGS_SR_ANODES_2, (anode_pattern >> 8) & 0xff);
#endif
}
[/code]

Best Regards, Thorsten.

Link to comment
Share on other sites

I see!  ...this is tricky :o

Thanks for the explanation, Thorsten!

(Now I can put back my soldering iron and spare some pins for my 4 LED-levelMeters...  ;D)

@Goule: I wouldn't be astonished at all if our MidiBoxes would look exactly the same once they're finished... over and over the same problems  :P  ;D

Link to comment
Share on other sites

Thorsten thank you for this useful explanation  :D as I've planned to emmbed several 10 led meters to see the joysticks & D-Beam activity  8)

Audiocommander : you're right  ;D I wouldn't be surprised as well  8)

What kind of controllers have you planned to put in your machine among the distance sensor ? Joysticks ?  ;D

Tonight there will be some new soldering to test all this !

Best Regards to all of you,

Goule

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...
×
×
  • Create New...