45111 Parallax Inc, 45111 Datasheet - Page 92

MANUAL FOR SX-KEY/BLITZ VER. 2.0

45111

Manufacturer Part Number
45111
Description
MANUAL FOR SX-KEY/BLITZ VER. 2.0
Manufacturer
Parallax Inc
Datasheet

Specifications of 45111

Accessory Type
Manual
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Contains lead / RoHS non-compliant
For Use With/related Products
Parallax microcontroller
For Use With
70002PAR - GUIDE PROG THE SX MICRO -DAUBACH
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Contains lead / RoHS non-compliant
10 SX Special Features and Coding Tips
To configure the I/O pins to Schmitt-Trigger input:
The following code snippet demonstrates this:
10.2.5 Edge Detection
Every I/O pin in port B can be set to detect logic level transitions (rising edge or falling edge). This can
be configured by writing to the Edge Selection register (WKED_B) and detected by monitoring the
Pending register (WKPEN_B). The I/O pins are set to detect falling edge transitions by default. By
configuring edge detection on input pins, the SX chip can set the pin’s associated bit in the Pending
register when the desired edge arrives. The Pending register bits will never be cleared by the SX alone;
the running program is responsible for doing so. This means, if a desired edge is detected, the flag
indicating this will remain set until the program has time to attend to it. This feature can be used by the
SX program for signals that need attention, but not necessarily immediately.
To configure the I/O pins for edge detection:
Page 92 SX-Key/Blitz Development System Manual 2.0 Parallax, Inc.
1) Set the MODE register to $0C (the value for Schmitt-Trigger register configuration).
2) Use the port configuration instruction to set the individual Schmitt-Trigger state of each I/O pin
3) Set I/O pin directions as necessary.
1) Set the MODE register to $0A (the value for Edge Detect register configuration).
2) Use the port configuration instruction to set the individual edge to detect on each I/O pin. A high
3) Set I/O pin directions as necessary.
within each port. A high bit (1) sets the corresponding pin to normal and a low bit (0) sets it to
Schmitt-Trigger.
bit (1) sets the corresponding pin to falling-edge detection and a low bit (0) sets it to rising-edge
detection.
; Schmitt-Trigger Configuration
;
MODE $0C
MOV
MOV
MODE $0F
MOV
MOV
!rb,#%11110000 ; Port B bits 4-7 to normal, bits 0-3 to S.T.
!rc,#%00001111 ; Port C bits 4-7 to S.T., bits 0-3 normal
!rb,#%10110011 ; Port B bits 2,3,6 to output, all others input
!rc,#%11011110 ; Port C bits 0,5 to output, all others input
; Set Mode to Schmitt Trigger configuration
; Set Mode to allow Direction configuration

Related parts for 45111