In SX Microcontrollers, SX/B Compiler and SX-Key Tool, PJMonty wrote: Calebjo, Here is a sample program that sets various pins of Port A as outputs and lets you set them high or low. Thanks, PeterM [code] ifdef __SASM DEVICE SX28, turbo, stackx, optionx, OSCHS3 ; Un-comment for SX28 chip ;DEVICE SX48, OSCHS3 ; Un-comment for SX48 chip else DEVICE SX28L,turbo,stackx_optionx endif FREQ 50_000_000 RESET InitSx ;Set reset/boot address ifdef __SASM LIST Q=37;, Q=64 ; This quiets specfic SASM warnings irc_cal IRC_FAST endif ; Control register equates DIR equ $0f InitSx org $0 ; Get SX ready for setting port pin direction mode DIR ; set input/output states ; These are samples of setting different pin(s) as outputs mov !ra, #%11111110 ;Set PortA pin 0 as output mov !ra, #%11111101 ;Set PortA pin 1 as output mov !ra, #%11110110 ;Set PortA pins 3 and 0 as output jmp @Main ; Everything above this line only needs to be done once in program ; Now you can set port pins high or low org $200 Main mov ra, #%11111111 ; Port A, all pins high mov ra, #%11111110 ; Port A, pin 0 low mov ra, #%11110110 ; Port A, pins 0 and 3 low jmp Main [/code] ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=308356#m309280 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2008 (http://www.dotNetBB.com)