In SX Microcontrollers, SX/B Compiler and SX-Key Tool, bernoulli wrote: Personally with the SX48, I have had difficulty getting the PIN assignment commands to work and ended up using an initialize routine to set the port settings. An example from one of my programs is below. Maybe doing a similar thing for your program will resolve the issue. [code] ASM MODE $09 ; WKPND_B MOV !RB,#00000000B ; clear pending Port B detections MODE $0A ; WKED_B ; 0 = selects rising edge detection ; 1 = selects falling edge detection MOV !RB,#11111111B ; set high-to-low detection for all Port B pins MODE $0B ; WKEN_B ; 0 = enable pin for interrupt ; 1 = disable pin for interrupt MOV !RB,#11111111B ; MODE $0C ; ST_B/C/D/E ; 0 = enable Schmitt Trigger ; 1 = disable Schmitt Trigger MOV !RB,#11111111B MOV !RC,#00000001B ; enable 1-7 as Schmitt-Trigger MOV !RD,#00000000B ; enable all inputs as Schmitt-Trigger MOV !RE,#00000000B ; enable all inputs as Schmitt-Trigger MODE $0D ; LVL_A/B/C/D/E ; 0 = Sets pin to CMOS ; 1 = Sets pin to TTL MOV !RA,# 1111B ; set 1-3 inputs to TTL levels MOV !RB,#11111111B ; set 1-5,7 inputs to TTL levels, 6 to CMOS MOV !RC,#11111110B ; set 1-7 inputs to TTL levels, 0 to CMOS MOV !RD,#11111111B ; set all inputs to TTL levels MOV !RE,#11111111B ; set all inputs to TTL levels MODE $0E ; PLP_A/B/C/D/E ; 0 = Enable internal pull-up resistor ; 1 = Disable internal pull-up resistor MOV !RA,# 0000B ; do not use internal weak pull-up resistor MOV !RB,#00000000B ; do not use internal weak pull-up resistor on 0-3 and 6-7 ; internal pull-ups for 4 & 5 MOV !RC,#00000000B ; do not use internal weak pull-up resistor MOV !RD,#00000000B ; do not use internal weak pull-up resistor MOV !RE,#00000000B ; do not use internal weak pull-up resistor for 0-6 MODE $0F ; TRIS_A/B/C ; 0 = Sets pin to output mode ; 1 = Sets pin to input (High-Z) mode MOV !RA,# 0000B ; set 0-7 as outputs MOV !RB,#11110111B ; set 0-2 & 4-7 as Hi-Z inputs ; and pin 3 as output MOV !RC,#11111110B ; set 0 as output, 1-7 as Hi-Z inputs MOV !RD,#11111111B ; set 0-7 as Hi-Z inputs MOV !RE,#11111111B ; set 0-7 as Hi-Z inputs MOV !OPTION,#01000000B ; Register $01 is W ; RTCC roll-over interrupt off ; Prescaler assigned to WDT ; Prescaler = 1:1 ENDASM[/code] ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=398444#m398696 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)