In SX Microcontrollers, SX/B Compiler and SX-Key Tool, jhaustin1943 wrote: Is it the case that operations on the SX28 port registers (RA, RB, RC) only apply to positions set as output (0) in the direction register? I tried the following program: [code] mov W, #%0000_1111 ;put direction 0=OUT mov !RC, W ;in port direction register !RC mov W, #%0101_0101 ;put intital data pattern mov RC, W ;in port data register RC not RC ;Toggle data bits mov RC, W ;Restore RC On the SX simulator, after the first mov rc,w, The contents of RC was %0101_0101 as I expected, but after the not, the contents was %1010_1111; I was expecting %1010_1010. after the second mov, the contents was $0101_1111; I expected %0101_0101. The actual chip appears to behave the same way. If the port registers are masked by the direction register, then why did wasn't the first mov result the same as the second? I'm using SXkey 3.2.3 Assembler/Simulator, and SX Tech board with LED cathodes connected to port pins (0=on). JoeA ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=220652 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2007 (http://www.dotNetBB.com)