Feasability of sequencer requiring alot of input

Hi,

Over the past few days I've been designing an analog-style sequencer. It will use an arduino for all functions, and will have four individual sequencers running on the same panel. However, nearing completion I am unsure whether the arduino will have enough processing power.

The project consists of:

1x 4067N Multiplexer
6x (48 Buttons) 4021N Shift Registers for Button Input
10x 74HC595 to control SPI Chip Select aswell as trigger outputs and 68 LED's
2x 4021N for Clock and control data (Required to be high priority, not daisy chained to the first 6.)
4x MCP4921 DAC's daisychained.

At the moment my concerns are over being able to update everything intime. The program will loop, checking the set of two 4021N's for changes in the first four bit's. Whenever a clock event is determined, it will progress to the next step of the corresponding sequence, update the 10x shift register chain (yes, all 80 outputs), set to ADC's to the value stored in a array for each sequencer.

While this is happening, it'll be scanning for changes to the sequencer controls (16 Faders, 48 triggers, 4 buttons for sequence choice).

It will generally do this up to 5 times a second, and preferably the entire update process will take up to 5ms. I would like to use an UNO for this, but if eliminating some registers with the extra IO, a mega should be doable, but I'd like to keep costs as low as possible.

Does this sound like an unreasonable request?

Thanks for the help.

That's a lot of stuff :wink:

I can't say for sure since I don't know how quick is quick.

So if I may dissect your project, I'd do this:

inputs: some dozens of buttons (although this can be better done with matrix connections, in which case you just need 14 input lines, 7 rows and 7 columns, so 2x 4021N)

inputs: analog knobs with ADC. I don't know too much about ADCs, I suppose they're on SPI bus so no problem.

outputs: LEDs I would separate the LEDs from SPI CS lines just because they're different and coupling them would be more difficult to debug.
You can use two separate latch lines, first one goes to 9 shift registers controlling LEDs (make sure your chip can connect 9 in series, I doubt it is a problem though), then a second latch line goes to the last shift register. This way you just shift away whatever you need and toggle the right latch to update LEDs or SPI CS lines, two things are separate and yet still you save I/O pins.

What clock and control data do you need?

My overall feeling of the entire

You can clock the SPI port at 8 megabits per second. Your 80 bits would go out in about 10 microseconds plus a few for register loading. I expect that will be fast enough to keep up with your output needs.

If you want to save time you could wire all your input shift registers together (input AND output) and clock in 80 bits of input at the same time you clock out the 80 bits of output. Depending on how long it takes to do the rest of the loop() you might be checking your inputs 1000 times per second.

Thanks very much for the suggestions.

I have no idea why I didn't think of using matrices. I will defenitely do so for the switches, and I'd like to do so for the LED's too. The sharing of data and shift register clock was a great idea, and a great saving of IO.

The clock data is a 5v pulse that indicates to move to the next step in the pattern. I'll have 4 of these for each individual sequencer. The control data consists of 16 faders (for pitch, i.e voltage output), 16 buttons to indicate whether the pitch should be outputted, and 2 lots of 16 buttons to indicate whether to output a pulse. There will also be 4 buttons that are used to select the sequencer that should be modified.

Quick in this case would be <5ms, although for my intended purpose <15ms should be fine, but being a modular synth component, I think that others will find some uses that would leverage a fast update.

John, thanks for the idea. I'm assuming you mean sharing clock and latch? I did not intend to check the inputs as often, yet if I can get both of them down to a reasonable time, then look's like I'll implement this aswell.

Just fixed my post, I meant DAC's instead of ADC's.

What are you using to read the 16 faders? The Arduino has 6 analog input pins and does 10-bit conversions. You can use an analog multiplexer to switch in different inputs but since your outputs are 12-bit you might want to use an external A/D converter and multiplexer (or one converter per channel if you need the speed).

For the four trigger channels I'd try hooking them directly to input pins and enabling the Pin Change interrupt. Then in the ISR you could check which pin has changed and send the new output to the DAC.

If I understand correctly you are implementing four 16-step sequencers with one set of controls to set them. Each sequencer has one control voltage output, the associated trigger output, and 12 channels of binary output (like drum triggers). Each sequencer has one trigger input for when to step to the next values. To set each sequencer you push one of the four sequencer buttons and use the faders and buttons.

One problem I see is that once you have the faders set for one sequencer, as soon as you switch to a different sequencer it will lose whatever fader settings it had and use the current settings. That's not going to be easy to use. I see two choices: Use motor driven faders so the Arduino can set them to the last settings for each sequencer, OR, use a n encoder knob (or buttons) to raise and lower each pitch. If you use encoders or buttons you might want some kind of visual feedback for the pitch setting. Maybe 16 LED's per channel (256 total) to show a rough pitch.