Pages: [1]   Go Down
Author Topic: 2 x 4 shift registers, max (inefficient solution)  (Read 947 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

(screen shots and patch below)

hi there.

I am sharing a patch here on this forum that allows the user to control 2 x 4 shift registers.
(  64 outputs from 6 pins on an arduino ) it works , but it is not very efficient.

i am pretty good at max but terrible with arduino.   therefore all the processing happens in max
and is output through maxuino serial and standard firmata. with no modifications to the standard firmata arduino sketch.

as you may know:  To control a shift register you need to send a sequence of 1's and '0s and the shift register will then light up a selection of leds. So to create the sequence of 1's & 0's : in max I created 2 x step sequencers that generate the needed serial sequence to control the external 74hc595n shift registers on the breadboard, it's pretty crazy because it gobbles up the serial bandwidth and makes max a bit sluggish too.

In the time i had ,this is the only way I could get all these shift registers to be controlled from max and just as importantly still have control of the analogue inputs and remaining digital out pins.

There are some super efficient sketches available about the net that will allow all the processing to happen inside the arduino and therefore you only need to send a small amout of data via serial to the arduino to control a massive array of leds. But i could not figure out how to do this whilst keeping the "analog in" functionality in max , and so I had to resort to this inefficient patch .

so to whoever is reading ,if you are stuck, like i was, need control of lots of leds from max and do not know how to make complex sketches, here is a patch below that may help you get by.
 
http://www.filedropper.com/2x4shiftregisters

here are a few screen shots
you can see how inefficient all this is, just by looking at it. lol . : )



here in this sub patcher is one of the step sequencers that controls 4 x shift registers.
 

the 3 outlets at the bottom of this sub patcher go to maxuino and then to the arduino
and then to the shift register.

peace: )


 
« Last Edit: May 18, 2012, 12:27:16 pm by qwerky » Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 443
Posts: 23836
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I just did the same recently, with just 2 shift registers and 1 ULN2803, to control up to 128 mulitplexed LEDs.
I kept the data of what was being displayed on the LEDs in an array, and shift it out to the shift registers every 500uS using SPI.transfer()'s.
Whenever serial data comesin, the array is updated between refresh cycles.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I just did the same recently, with just 2 shift registers and 1 ULN2803, to control up to 128 mulitplexed LEDs.
I kept the data of what was being displayed on the LEDs in an array, and shift it out to the shift registers every 500uS using SPI.transfer()'s.
Whenever serial data comesin, the array is updated between refresh cycles.


sounds very  interesting. 128 leds, cool : )

i had a go with an ardunio tutorial a few weeks ago (below) which works more efficiently than mine above. all the user needs to send is an 8-bit number from max and the arduino does the rest of the work. The arduino analogue inputs are not enabled in the sketch provided however, which is why I decided to make my own patch.

little-scale.blogspot.co.uk/2008/01/talking-to-3-595s-via-maxmsp.html


« Last Edit: May 18, 2012, 02:06:43 pm by qwerky » Logged

Pages: [1]   Go Up
Jump to: