Strange failure of pulsout command vs high/low


I have some code controlling the STROBE line on a switch matrix chip - switches in the matrix are controlled by setting the address inputs correctly, setting the data to high (on) or low (off), then strobe should go high then low for it to set the selected switch.

Pin A.6 is the strobe pin and is normally low. Once I've set the address (7 pins on D) and data (A.5) correctly, if I use:

high A.6
low A.6

Then the correct switch in the matrix is turned on or off depending on the data value. If I instead use:

pulsout A.6,1

Nothing. I can see with a logic probe that the pulses happen but the switch matrix doesn't do anything. I tried various values from 1 up to 1000 and it's the same, the matrix does nothing. Change it back to high then low and it works perfectly. I couldn't get my code to work at first as I'd been using pulsout, it was only by chance and piles of debugging and messing around that I noticed high/low fixed everything.

Does anyone know why this is happening? It's a MT8816 switch chip and a 40X2 PIC.


Senior Member
Since the pulse is opposite the polarity to which the pin is set when the command is executed, are you sure that it is initially low, so that you get a high pulse?

Does this work?

Low A.6
pulsout A.6, 100


Yes absolutely certain, A.6 is set low in the initial setup and not touched except in this subroutine. I can see this on my logic probe too.

Does program execution continue during the pulse or wait for it to finish?