Is there a way to read OUTA?
TC
Posts: 1,019
Hello all,
I am wondering if it is possible to read the state of OUTA of the actual output pin? In the manual it says you can, but that only works if the current COG is controlling the I/O pin. I want to display if a heater is on or not, just an indicator on the display. If the character is on, then the heater is on. If the character is off, then the heater is off.
Thanks
TC
I am wondering if it is possible to read the state of OUTA of the actual output pin? In the manual it says you can, but that only works if the current COG is controlling the I/O pin. I want to display if a heater is on or not, just an indicator on the display. If the character is on, then the heater is on. If the character is off, then the heater is off.
IF OUTA[Heater] == 1 Display.tx($DB) ELSE Display.tx($20)
Thanks
TC
Comments
It's not really the actual state of the pin that you read, as DIRA would also have to be set for your cog to affect the pin.
You can use INA to read the actual electrical pin state, unless there is a short somewhere the state will reflect: if Any Cog have DIRA=1 and OUTA=1 for this pin it will be a 1
As if any other cog also use the same pin, a high state is ORed
The INA works like a charm for what I needed.
Thank you
OTOH, X := outa[.] reads the state of the output latch for a particular cog, and that only affects the output if the corresponding dira[.] is set to ouput, and all other output sources (cogs and counters) are permissive.
That makes sense now, thanks.