Oddness with writePin?
Scott M
Posts: 43
Have folk used writePin to set multiple pins at once? I understand that you can only set pins 0-7 OR 8-15 in one call, but at one point I summed up some pinids between 8 and 11, called write, and had pin 2 change state. It would happen reliably (and would reliably send my circuit to never-never land). The problem vanished when I did individual calls to writePin for each, separate pinid. That kind of defeats the purpose (I wanted the pin changes to happen simultaneously).
Anyone know of any weirdness with this call?
Anyone know of any weirdness with this call?
Comments
CPU.writePin(CPU.pin8 | CPU.pin9 | CPU.pin10, false);
You still must only use pins from the same port.
You can use writePort() to set the port latch (this does not change pin directions,
but it disturbs VP that uses pins of that port)
and then use setOutput() to make the required pins outputs.
required peter
·