In SX Microcontrollers, SX/B Compiler and SX-Key Tool, yllawwally wrote: I got that one and a couple of others. The document seems to call it pulse 3, but it seems to be on the 4th pulse when you should look for XYZ. The last pulse held high I believe, while you read the buttons. I have the code set to light up, when I get a z, however it actually lights when I get an up. Looking at the pdf again, I added another toggle of the select line, and left it high, however it did not seem to make a difference. I changed the code to display the LED when the A button is held, and then also for the B button, which shows me I'm controlling the select properly. I'm running with the internal clock set to 4MHz. It seems it must be my timing that is off,below is the code I'm trying to use now. [code]bp0 pause ;93 setb ra.0 ;turn select off, setting voltage to 5 pause ;93 clrb ra.0 ;turn select on, setting voltage to 0 nop ;1 nop ;1 nop ;1 setb ra.0 ;turn select off, setting voltage to 5 nop ;1 nop ;1 nop ;1 clrb ra.0 ;turn select on, setting voltage to 0 nop ;1 nop ;1 nop ;1 setb ra.0 ;turn select off, setting voltage to 5 nop ;1 nop ;1 nop ;1 clrb ra.0 ;turn select on, setting voltage to 0 nop ;1 nop ;1 nop ;1 setb ra.0 ;turn select off, setting voltage to 5 nop ;1 nop ;1 nop ;1 clrb ra.0 ;turn select on, setting voltage to 0 nop ;1 nop ;1 nop ;1 setb ra.0 ;turn select off, setting voltage to 5 nop ;1 nop ;1 nop ;1 ;------------------- should be select on data now ; mov w, rb ; mov Joystick_Mid, w jnb rb.0, light ;check first bit, which should be button z jmp nolight light: clrb rc.6 ;turn off led jmp bp0 nolight: setb rc.6 ;turn on led jmp bp0[/code] ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=406732#m412584 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)