Command Order
mynet43
Posts: 644
I have a question about the OUTA and DIRA commands.
The examples in the manual show the DIRA command before the OUTA command.
Some coding examples reverse the order. It seems to make sense to have the values set before you change the direction from input to output.
Would someone please explain what's going on here and why it matters?
Thank you for your help.
Jim
The examples in the manual show the DIRA command before the OUTA command.
Some coding examples reverse the order. It seems to make sense to have the values set before you change the direction from input to output.
Would someone please explain what's going on here and why it matters?
Thank you for your help.
Jim
Comments
That's what I needed to know, that the OUTA register is initialized to zero.
It seems like it would always make more sense to set the OUTA value first, before the DIRA command.
Otherwise, you would create a glitch when you set it to high. It would first go low when you set the direction to out, then back to high when you send the OUTA command.
I think I'll keep doing it OUTA first, DIRA next.
Thanks again,
Jim
I have a design which has some interfacing signals active low. Thus setting the Output register to a HI state, not active, then the DIRA direction, the output line only goes low when the program sets it that way. For instance, providing an Interrupt signal to say a micro, you'd have pull-up R on the line to make sure it is high on power-on time and ONLY low when the program outputs a low.
Depends on the application. Sometimes it doesn't matter; others it is critical.