Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The use of a shift register to multiplex (or de-multiplex, depending on your point of view) inputs/outputs is very common in digital electronics.</p> <p>Basically, you trade saving pins on your controller for having to include another chip (the shift register) in the design.</p> <p>In this case, the register works as a serial-to-parallel converter; it has a serial input line, which is fed with bits from your CPU. It also has 8 parallel outputs, connected to an 8-bit memory that is loaded serially from the CPU. Using this, you can "shift out" 8 bits of data on a single pin (plus one pin for clocking, typically), which are then stored in the shift register and can drive 8 LEDs in parallel.</p> <p>In this particular case, you need to figure out which AVR port pins the shift registers (the MBI5168 constant-current sink drivers contain the shift registers, here) are connected to. They ought to be chained to a pair of outputs, one for data and one for clock. Once you know those pins, you should be able to drive them yourself using the <a href="http://www.arduino.cc/en/Tutorial/ShiftOut" rel="nofollow noreferrer">ShiftOut</a> command.</p> <p>Digging a bit further, <a href="http://www.seeedstudio.com/depot/images/product/RaibowduinoCMD_Bata.rar" rel="nofollow noreferrer">this sample "sketch"</a> contains the following definitions, in the file called "Rainbow.h":</p> <pre><code>//MBI5168 #define SH_DIR_OE DDRC #define SH_DIR_SDI DDRC #define SH_DIR_CLK DDRC #define SH_DIR_LE DDRC #define SH_BIT_OE 0x08 #define SH_BIT_SDI 0x01 #define SH_BIT_CLK 0x02 #define SH_BIT_LE 0x04 #define SH_PORT_OE PORTC #define SH_PORT_SDI PORTC #define SH_PORT_CLK PORTC #define SH_PORT_LE PORTC </code></pre> <p>This is of course total digital "hearsay" (I don't own the device, I've never programmed on any kind of *duino), but I'd say this is the particle-spewing bullet delivery system you're looking for.</p> <p>I interpret this like so:</p> <ul> <li>PORTC is the one connected to the shift registers, all control pins are in PORTC.</li> <li>Four pins are dedicated (rather than the optimistic two I mentioned above).</li> <li>The clock is pin PORTC:2 and the data is PORTC:1.</li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload