In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Rsadeika wrote: A revisit of this commnd. In the code below, what I am expecting is, goes to pulsin command sub, times out, turns the LED on and off, and keeps repeating. Now, what is ocurring is that the LED does not turn on, means it never got out of the pulsin sub? I tried it with temp1 = 0, that did not do anything for me. So, I tried pushing a button on the remote, and the LED did turn on. My question is, when the program gets to a pulsin, does the program just hang there until it times itself out, or does it just wait until something occurs on the pin (IR demodulator in this case). I thought I read that their is supposed to be a 50 ms time out. In my program did I insert something weird. I just tried it in a stand-alone, and the program works as expected. As soon as I give it power the LED starts to go on and off. Something weird is going on, in stand-alone it works as expected, with SX-key it just hangs there (I hope I did not mess up my board). Any comments will be appreciated. Thanks ******code ' ========================================================================= ' ' File...... Test4.sxb ' Purpose... SX/B Programming Template ' Author.... Ray Sadeika ' E-mail.... ' Started... ' Updated... ' ' ========================================================================= ' ------------------------------------------------------------------------- ' Program Description ' ------------------------------------------------------------------------- ' ------------------------------------------------------------------------- ' Device Settings ' ------------------------------------------------------------------------- DEVICE SX28, OSCXT2, TURBO, STACKX, OPTIONX FREQ 4_000_000 ' ------------------------------------------------------------------------- ' IO Pins ' ------------------------------------------------------------------------- irpin var rc.0 led1 var rb.0 ' ------------------------------------------------------------------------- ' Constants ' ------------------------------------------------------------------------- ' ------------------------------------------------------------------------- ' Variables ' ------------------------------------------------------------------------- temp1 var byte ' ========================================================================= PROGRAM Start ' ========================================================================= ' ------------------------------------------------------------------------- ' Subroutine declarations ' ------------------------------------------------------------------------- ledon sub getsome sub ' ------------------------------------------------------------------------- ' Program Code ' ------------------------------------------------------------------------- Start: ' PLP_A = %0000 'PLP_b = %00000000 'PLP_c = %00000000 ' temp1 = 0 Main: do getsome 'Get a pulse reading ledon 'Turn the LED on/off loop END GetSome: pulsin irpin, 0, temp1 return ledon: TRIS_b = 0 led1 = 0 pause 1000 led1 = 1 pause 1000 return ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=97915#m98834 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2005 (http://www.dotNetBB.com)