I need some help/advice/tip on 开发者_运维问答how to short two 2 ports in MSP430 software wise.
set P4.4 to be equal to P2.6
You can't do that I'm afraid.
You'll either have to
- Poll
P2.6
regularly and accept some lag on how soonP4.4
will follow it (and miss any transitions which are smaller than the poll time) - If
P2.6
can generate an interrupt, copy the value fromP2.6
toP4.4
in a small interrupt service routine. You'll be able to deal with shorter events this way. But you'll have to accept that if you get lots of transitions on that pin, you're processor will be very busy!
Microcontroller 3 state GPIO's don't provide this sort of configurability. As an alternative, you could
- Set both ports to the same level; either high or low; They will be electrically shorted by virtue of being set or grounded; but they will also pull their loads to that level too.
- Poll one port and set the other to that value on a periodic basis.
- Add a CPLD or other logic elements to your project, which does provide that level of configurability.
精彩评论