I am using a 16 pin Multiplexer and I recently found out that for my project I need to trigger the 4 control pins of the multiplexer to their HIGH or LOW values at exactly the same time.
This would be fine if I had all 4 pins in the same port register (A, B, C, or D) but I don't. Mostly I need to trigger two port registers at the same time. I would rewire, but I have already made a PCB for my project, so I am wondering if there is a way to trigger multiple port registers at the same time:
e.g. PORTD = B00001010 & PORTB = B10010000
Any help with this is greatly appreciated!
Shame.. Thanks for the reply
Nupky:
at the same time
Speed of light limitations and quantum uncertainty both make it impossible for two different things to happen at exactly the same time. How close together do you really need these things to happen?
Even if the 4 control pins managed to change at precisely the same time, there is no guarantee that the paths within the chip will be precisely the same time delay.
This is hard enough to do when all four pins are on the same port. It will be impossible with pins on two or more ports.
Hint: Think synchronous. You need to make your changes on a clock edge, and look for the result on the next clock edge. That way, you have a whole clock period in which the changes can settle out.
What are you really attempting to accomplish with the multiplexer?
What's to prevent you modifying the wiring so all the pins are on one Port ?
...R
PORTB = X;
PORTD = Y;
Won't those be 62.5 to 135nS apart?
So might see a little glitch at the outputs.
Does the mux have an output enable that you can control?
Disable the outputs, setup the address, re-enable the output?
Are there 4 port pins free on a port? Set up 4 pins one port, add 2 jumpers to the other port, and pinMode the now unused port pins as inputs.