Shop OBEX P1 Docs P2 Docs Learn Events
INA behavior in PASM — Parallax Forums

INA behavior in PASM

T ChapT Chap Posts: 4,223
edited 2012-08-18 10:26 in Propeller 1
I don't have a meter to check this right now, but am curious about something. I have set a debug section in PASM to monitor ina:
                        mov     dbg_parm , #0
                        or      dbg_parm, ina 'cogcmd
                        call    #dbg_hex
                        mov     dbg_parm, #13
                        call    #dbg_tx

First, it sets the long to 0. Then it ORs the contents of INA to the byte, then sends to a serial terminal.

Nordic0_CE = 0 output
Nordic0_CSN = 1 output
Nordic0_SCK = 2 output
Nordic0_MOSI = 3 output
Nordic0_MISO = 4 input
Nordic0_IRQ = 5 input


But, I am getting a reading on INA of %0010_1011.

I know bit 5 is correct for the incoming value from the SPI device, but how am I seeing anything for the other bits that are set to outputs? Does INA still allow access to the pin's state even if set to output? I believe that bits 0 and 1 are correct as far as their output states for CE and CSN(both high).

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2012-08-18 10:08
    The INA bits represent the state of the I/O pins regardless of whether they're set as inputs or outputs. If the I/O pins are set as inputs, the I/O driver transistors are turned off and act as if they were disconnected.
  • T ChapT Chap Posts: 4,223
    edited 2012-08-18 10:26
    Thanks Mike. That is very convenient.
Sign In or Register to comment.