Jump to content

I need one more stinking input pin on my bass pedal unit!


Axeslinger

Recommended Posts

I've been figuring out how to implement some additional functions on my bass pedal unit -- which started life as the Floorboard.  After adding the 13th pedal note, PORTD had three inputs left.  One of those was used by my octave select function.  The other two are reserved for additional functions I want to implement.  So far, so good.  I can do everything I have to do here.  If I were to stop developing right now and start building, I'd have a pretty cool bass pedal controller.

Unfortunately, I seem to never be satisfied.  One success builds on another.  It occurred to me that it would be cool if I had some ability to change the voicings on the NanoBass my pedal unit drives.  Well, since this functionality is already there, this should be easy.   I could add another LED digit to display the preset number because there's room for one more anode output.  Using one LED digit displaying in hex, I'd be able to implement 16 MIDI program change commands by stepping through them with a pushbutton the way I do with the octave selection.

And there's where I could have a problem -- the pushbutton.  I need one more input!  Let's say that I wanted to use pin RC5 as my new input.  Based on what I saw in the PIC datasheet and the Floorboard code, I would have to set TRISC (maybe PORTC also, I can't remember) to treat RC5 as an input.  Then I would go through the usual stuff of adding RC5 to the shift register, adding code for C5_pressed and C5_released, and adding these modules to contab.  I assume I would also have to have a pullup resistor for this pin.  Finally, I'd need my pushbutton.

Do I have this covered?  Is there some reason I can't use pin RC5 as an input?  Is there something I've missed?  I swear, I did read the datasheet before I posted this.

N.B. I think I mean C5.  If I recall correctly, the TX and RX pins are the uppermost pins in PORTC.

Link to comment
Share on other sites

I don't know why which shouldn't work - you could output the read value of PORTC on your LED digit, just to check if anything changes.

Best Regards, Thorsten.

...which is exactly what I was planning to do.  I was just proceeding carefully and trying to make sure I had done my homework properly before venturing into unknown territory.  So far, everything I've done has just been a matter of building on code you already had in there or the little tricks I've added for button function processing.

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...