<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body style='font-size: 10pt; font-family: Verdana,Geneva,sans-serif'>
<div class="message-partheaders"> </div>
<div class="message-partheaders">in my experience using a multimeter to test the working of pins on an Arduino</div>
<div class="message-partheaders">is not always giving what you expect.</div>
<div class="message-partheaders">i suggest to use e.g. a led to see if pins are on or off.</div>
<div class="message-partheaders"> </div>
<div class="message-partheaders">rolf</div>
<div class="message-partheaders"> </div>
<div id="message-part4" class="message-part">
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">Rick Snow wrote:</div>
<div class="pre" style="margin: 0; padding: 0; font-family: monospace"> </div>
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">Thank you all for your thoughts regarding this issue.<br /> <br />
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0"><br /> On Thu, 2023-04-13 at 16:28 -0500, Rick Snow wrote:<br /> <br />
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0">I am helping someone use pd with an arduino mega.? They would like to<br /> use all of the digital output pins.? I?ve used pduino in the past in<br /> this way and not had trouble,?</blockquote>
<br /> Also with a Mega?<br /> <br />
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0">but I seem to be bumping into something now.</blockquote>
<br /> What version of pduino are you using? Most current is 0.8.<br /> <br /> Also, if an older version of pduino worked fine with the Arduino Mega,<br /> what version was that?</blockquote>
<br /> I have used pduino in the past with a mega.  I do not remember if I used the specific pins in question previously.  I am using pduino .8 and standardFirmata (most recent).  I am using a Mac with a usb c dongle….I have tried it on a pc laptop and had the same problem. I have used a couple of different brand new megas for testing.<br /> <br /> One test run revealed the following.<br /> Process: I turn on all the pins with a 250 ms delay in sending messages “pinMode 2 output” -> “pinMode 53 output”.<br /> <br /> Then I check each individual pin with a multimeter. The results are:<br /> Pins 2-23 work fine<br /> Pins 24-30 turn on but do not turn off<br /> Pins 31-38 do not turn on or off<br /> Pins 39-53 work fine<br /> <br /> I’ve done this a few times and had different sets of pins working/not working but they are generally in the areas above with pins 24-38 the most problematic.<br /> <br /> <br />
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0">
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0"><br /> I started by using the arduino help patch.? StandardFirmata sketch on<br /> the Mega.? Connection via usb works fine.<br /> <br /> I set all the pins to output by sending "pinMode 2 output? -><br /> ?pinMode 45 output? messages to the arduino object. No errors.<br /> <br /> Then, I use the messages ?digital 2 1? ?digital 2 0? -> ?digital 45<br /> 1? ?digital 45 0? sent to the arduino object to check the pins.? When<br /> checking with a multimeter I am not able to get output from pins 2-<br /> 7.? I do get output from 8-20.? Between 20-40 some pins work and<br /> others not at all.? Other pins will turn on but not turn off.</blockquote>
<br /> What happens if you specifically send 'pinMode 45 output, digital 45<br /> 1'? Or you use any other pin that seems to be not working correctly<br /> with your setup.</blockquote>
<br /> When trying this method directly (without trying to turn on all the pins first) the working pins all work.<br /> When trying with a “non-working pin”, if I do this right after opening the patch, I can do this with at least 1 pin and it will work.  Sometimes, I can check up to 3-4 “non-working pins” with this method and they will work, but then no more “non working pins” will work, and the previously checked non-working pins will stop working. Working pins will work even after the “non-working pins” stop responding.  Restarting pd will allow this behavior to be replicated.<br /> <br />
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0">Also, there is 'pinState' message for querying the<br /> current state and there is the 'capability' message that triggers a<br /> report of all supported modes of all pins. So, I would like to know if<br /> the non-working pins report of themselves to support 'output' mode.<br /> Then, if you set their 'pinMode' to 'output', do they actually report<br /> their 'pinState' as 'output'?</blockquote>
<br /> pinState messages will show what the multimeter shows with all working pins.  pinState will sometimes show 1 for non working pins when the multimeter shows 0. <br /> <br />
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0">
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0">Checking the pins using a simple blink sketch shows all the pins<br /> working fine.</blockquote>
<br /> Ok, so you can be sure the board is working.<br /> <br />
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0">Any advice would be greatly appreciate!</blockquote>
<br /> I don't own an Arduino Mega and I don't know how well [pduino] is<br /> tested with that board. I certainly haven't tested it ever.?<br /> This makes it hard for me to reproduce the problem. If you can give a<br /> hint that the problem is in the software, that would help.</blockquote>
<br /> My intuition is that the messaging for these pins gets corrupted somehow after a certain number of pinMode messages are sent to the arduino object, but I really know absolutely nothing about the serial port/sysex side of this.<br /> <br /> Thank you all again for your thoughts!  Ultimately this person would like to control about 40 solenoids with an arduino mega and a pd patch.<br /> <br /> Cheers,<br /> Rick</div>
</div>

</body></html>