[sdiy] Microchip PIC 5 x 4 matrix
Vinicius Brazil
brazil.v at gmail.com
Wed Oct 7 17:35:06 CEST 2015
You´re wellcome.
To minimize switching noises in my application, I had to do before the
equivalent of RBx = RAx = 0, then exchange RAx to InputPort and add a NOP
instruction before reading RAx. Only then totally eliminated phantom
readings KeyOn.
VB
On Wed, Oct 7, 2015 at 12:20 PM, Jean-Pierre Desrochers <jpdesroc at oricom.ca>
wrote:
> Thanks for the explanation.
> A pull down version like yours comes better.
>
>
> Le 2015-10-07 11:15, Vinicius Brazil a écrit :
>
> JP,
>>
>> My key reference ON was the Vcc, like yours, and when a key was open, in
>> your case an RA, the pin was very noise, possibly interpreted as "1" (some
>> keys to 0.5 meters). With pull down the noise reduced considerably.
>>
>> In the case of Key On being read RAX = 0, then Key Off = 1, pullup. In
>> this case reverse diodes and LED.
>>
>> In your drawing, when Key Off, the pullup pull RAx to +5V, the ON
>> condition.
>>
>> VB
>>
>> On Wed, Oct 7, 2015 at 11:57 AM, Jean-Pierre Desrochers <
>> jpdesroc at oricom.ca> wrote:
>> Vinicius,
>>
>> Can you clarify what a difference pull down or pull up makes here ?
>> Each final pin input impedance is the same here ?
>> Unless you want all your wiring ground related.. (??)
>> JP
>>
>> Le 2015-10-07 10:46, Vinicius Brazil a écrit :
>>
>> Hi Jean-Pierre,
>> I did something similar but put a 10k pull down resistor on the "Rx In"
>> due to distances of the keys to the PIC.
>>
>> Vinicius Brazil
>>
>> On Wed, Oct 7, 2015 at 11:32 AM, Jean-Pierre Desrochers <
>> jpdesroc at oricom.ca> wrote:
>> Hi Tom,
>>
>> The PIC has no internal pullups on port A.
>> You were right. I uploaded a corrected picture
>> on the same link shown.
>> And yes the 100 ohms is for the LED's current limiting.
>> The voltage drop of the led + the series diode gives around
>> 2.2 + .7 = 2.9v leaving 2.1v (@ 5vdc) for the limiting resistor.
>> At 20mA that gives around 100R.
>> Thanks for your good reply (as usual).
>> JP
>>
>> Le 2015-10-07 10:07, Tom Wiltshire a écrit :
>> What does the 100R do? Is that a current limiting resistor for the LED?
>> What about pull-ups for the buttons? Does the 16F88 have internal
>> pull-ups on Port A?
>>
>> Aside from those questions, it looks fine to me, JP. Nice and simple.
>>
>> Personally, I'd have done it with serial-parallel and parallel-serial
>> chips, but that's because I've got code for that already. 74HC594/595
>> and 74HC166/165 can both be driven from 6 pins total (or even five if
>> you use the same clock for both in and out), and you can extend the
>> chain as long as you want.
>>
>> Your way saves the six(!) other chips I'd have used though, so it's
>> probably to be preferred.
>>
>> Tom
>>
>> On 7 Oct 2015, at 14:52, Jean-Pierre Desrochers <jpdesroc at oricom.ca>
>> wrote:
>>
>> I'm about to build a MIDI foot controller
>> using around 20 normally open footswitches
>> with there respective state LEDs.
>> I have a bunch of PIC16F88 micros and want
>> to use one for this project using as less pins as possible.
>> (9 pins for the matrix)
>> I figured out a way to read and feed all switches
>> and LEDs this way:
>> http://www.arcenson.com/public/PIC16F88_5x4_matrix.JPG [1] [1]
>>
>> All the switches and LEDs will be processed one after each other
>> in an endless loop..
>> RB5 will send the MIDI data.
>>
>> Does anybody see something I forgot in that drawing ?
>> I'm not home and will try it tonight.
>>
>> Thanks. JP
>> _______________________________________________
>> Synth-diy mailing list
>> Synth-diy at dropmix.xs4all.nl
>> http://dropmix.xs4all.nl/mailman/listinfo/synth-diy [2] [2]
>> _______________________________________________
>> Synth-diy mailing list
>> Synth-diy at dropmix.xs4all.nl
>> http://dropmix.xs4all.nl/mailman/listinfo/synth-diy [2] [2]
>>
>> Links:
>> ------
>> [1] http://www.arcenson.com/public/PIC16F88_5x4_matrix.JPG [1]
>> [2] http://dropmix.xs4all.nl/mailman/listinfo/synth-diy [2]
>>
>
>
>
> Links:
> ------
> [1] http://www.arcenson.com/public/PIC16F88_5x4_matrix.JPG
> [2] http://dropmix.xs4all.nl/mailman/listinfo/synth-diy
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://synth-diy.org/pipermail/synth-diy/attachments/20151007/8cb3b44c/attachment.htm>
More information about the Synth-diy
mailing list