How can I treat bass pedals as a matrix?

Started by David, March 24, 2006, 08:56:59 AM

Previous topic - Next topic

David

Quote from: toneman on September 28, 2006, 10:02:46 PM
Hey D,  U didn't build the PIC programmer that came with The Book??

I used mine to easily burn F84A's;  don't know if it can burn F628's,
but, i'll bet The Book's web page has some updated software(?)
Reguarding encoding a keyboard, see Friendy Stories byJohn Simonton.

T

Actually, I've had a PIC programmer for over a year.  I snagged a PG2C off Evilbay for about five bucks.  It works just fine for both 628s and 677s except I have to use it with a desktop so that means traipsing upstairs to program a PIC.  I had bought a pedalboard from a small spinet organ about the same time.  It's really a bunch of normally-open momentary-contact pushbuttons that are wired to a common ground.  What I'll need to do is separate them all from the common ground and wire them into rows and columns.  Shouldn't be hard, but I have to be careful, so it'll be time-consuming.

David

It's been quite a while since I've done anything with this.  It went into stasis because of other, higher-priority items...  you know the drill.  In addition, a lot of pressure got taken off to get it done because we actually have some bass players on our worship team.  I know, however, that the day will come when I'll need this puppy, so I'm trying to pick up the threads of where I left off and get ready for a big push to get it finished.

When I left off, I was ready to give up on the 16F628 because I was out of pins and needed more functionality.  It was easy enough to step up to the 16F877, and I figured I was going to do that when I resumed work on this project.  Something kept holding me back, though.  I guess it was not wanting to monkey around with interrupts.  Also, the prospect of dealing with all those pins seemed daunting somehow.

Anyway, if you've read this far, you're probably just the person I need.  I'm revisiting the idea of using the '628.  I've decided that this chip will work if I go back to my idea of offloading the display processing to 4511 chips to drive each LED digit (I plan to use four).  I was bumping my head on the limitations of key matrix size and digit handling.  I still am, especially with wanting to add functionality to select the MIDI channel AND preselect some patches.  All right, down to cases.  I'm going to use PORTB and pin RA5 for my 4X5 combined foot pedal and function button matrix.  RA5 is selected because it's input-only.  I'm using RA4 for my MIDI output.  This leaves me 6 output pins.  Well, it turns out that I only have to display digits in the range 0-7, so I only need 3 output pins to drive the 4511 digit inputs.  I can force the high-order bit to 0.  That leaves me with a bit of a problem with enabling the proper 4511 chip, and I'm finally down to my question(s).

It looks like I should be able to use a 74LS138 (thanks, Jordan Petkov!) to select the appropriate 4511 because it drives an output pin low depending on a 3-bit input, and the 4511s need the enable pin to be driven low in order to display the digit on the input lines.  Neatly enough, I only need to connect my PIC to two of the 138's inputs because I'm using 4 4511s.  I would think I could just force the high-order input on the 138 low like I'm planning to do with the 4511s.  Hey, cool!  This would implement the functionality I need (except for playing predetermined chords, but I'm saving that in case I ever do a larger version of this circuit), and I even get a pin left over!

Does this sound workable, or have I missed something stupid?

Dave_B

It sounds workable.  Have you ever considered the 74hc595?  That thing is hot stuff for adding outputs to a µC, and there's some documentation on the Web for using them with PICs.  You can string them together so (for example) three '595's will convert three µC pins into twenty-four outputs. 

I'm working on a circuit that uses two '595's to control 20+ LED's and 3 7-segment displays.  The first chip connects to the Anodes, the second chip grounds the cathodes sequentially.  From there, it's the same concept as your input matrix.  With the '595, you can easily end up with more outputs than you need.   :)
Help build our Wiki!

David

Quote from: Dave_B on June 29, 2007, 11:18:10 AM
It sounds workable.  Have you ever considered the 74hc595?  That thing is hot stuff for adding outputs to a µC, and there's some documentation on the Web for using them with PICs.  You can string them together so (for example) three '595's will convert three µC pins into twenty-four outputs. 

I'm working on a circuit that uses two '595's to control 20+ LED's and 3 7-segment displays.  The first chip connects to the Anodes, the second chip grounds the cathodes sequentially.  From there, it's the same concept as your input matrix.  With the '595, you can easily end up with more outputs than you need.   :)

Yeah, I did get some suggestions about that chip, and they were VERY seductive.  Especially after R.G. indicated that bit-banging MIDI was sufficient qualification for serial output coding.  I just couldn't do it, though.  I understand parallel outputs and have those working.

Check in with your toy once in a while.  It sounds real interesting!

Dave_B

It's a metronome, so it's barely interesting. ;D  I know, I know, you can buy one of those.  I want one where the LED's are arranged in an arc and flash back and forth like a traditional mechanical metronome.  That works better for me as a drummer, since I can't hear the 'blip' when I'm playing.
Help build our Wiki!

David

This project hasn't died, but it's been comatose for an awfully long time...

I haven't done anything but research on it for months.  That and trying to find the time to rewire the switches into a matrix...
...with diodes, in true Jordan Petkov fashion.

I have, however, significantly managed to simplify and add much functionality to the design at the same time.  I am now going to use two PIC16F648As in a master/slave configuration.  The master will handle the inputs, figure out what needs to be played and send out the necessary MIDI data to the selected synth (I'm going to use two, maybe three).  It will also send data to be displayed over its USART to the slave, which will receive the data via its USART and then display it on a 20x4 LCD screen.  More info, more features, way less work.

This will allow me to output to multiple synths, and preprogram some patches for each one that I can select on the fly.

It's a ways off, but not as far as it used to be.