|
1 IO Ports
1. Set PortA as input with pulling high
lda #$FF
sta P_IOA_Data ;pull-high
lda #$0
sta P_IOA_Dir ;input
lda #$0
sta P_IOA_Attrib ;PA as pull-high input |
2. Set PortA as input with pulling low
lda #$0
sta P_IOA_Data ;pull-low
lda #$0
sta P_IOA_Dir ;input
lda #$0
sta P_IOA_Attrib ;PA as pull-low input |
3. Set PortA as input with float
lda #$FF
sta P_IOA_Attrib ;PA as float |
4. Set PortA as output
lda #$FF
sta P_IOA_Dir
lda #$0
sta P_IOA_Attrib ;PA as Output
lda #$FF
sta P_IOA_Buf ;Output high
lda #$0
sta P_IOA_Buf ;Output low |
5. Use bit operation to set PortA1 as input with pulling high, but do not change other ports.
set P_IOA_Data, 1 ;pull-high
clr P_IOA_Dir, 1 ;input
clr P_IOA_Attrib, 1 ;PA1 as pull-high input |
6. Use bit operation to set PortA1 as input with pulling low, but do not change other ports.
clr P_IOA_Data, 1 ;pull-low
clr P_IOA_Dir, 1 ;input
clr P_IOA_Attrib, 1 ;PA1 as pull-low input |
7. Use bit operation to set PortA1 as float, but do not change other ports.
| set P_IOA_Attrib, 1 ;PA1 as float |
8. Use bit operation to set PortA1 as output, but do not change other ports.
set P_IOA_Dir, 1
clr P_IOA_Attrib, 1 ;PA1 as output high
set P_IOA_Buf, 1 ;output high
clr P_IOA_Buf, 1 ; output low
|
|