In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Rsadeika wrote: Here we go again. I have some new code, the master essentially sends, and slave is supposed to respond when it receives the character. It does not work, I must of overlooked something. The reason I was using the SIRCS_ISR version is because I had the IR detector hooked up to my SX52 board, since the pulsin command has a bug, I could not use the plain SIRCS on the SX52 board. I guess I will have to reconnect things, but first I want to get a plain serin/serout to work between the two boards. Thanks Ray ********CODE This is the master ' ------------------------------------------------------------------------- ' Program Description ' ------------------------------------------------------------------------- ' ------------------------------------------------------------------------- ' Device Settings ' ------------------------------------------------------------------------- DEVICE SX52, OSCHS2 FREQ 4_000_000 ' ------------------------------------------------------------------------- ' IO Pins ' ------------------------------------------------------------------------- TXpin VAR RE.7 ' Transmit ' ------------------------------------------------------------------------- ' Constants ' ------------------------------------------------------------------------- ' ------------------------------------------------------------------------- ' Variables ' ------------------------------------------------------------------------- rDATA var byte temp1 var byte ' ========================================================================= PROGRAM Start ' ========================================================================= ' ------------------------------------------------------------------------- ' Subroutine Declarations ' ------------------------------------------------------------------------- ' ------------------------------------------------------------------------- ' Program Code ' ------------------------------------------------------------------------- Start: PLP_A = %00000000 ' pull-up unused pins PLP_B = %00000000 PLP_C = %00000000 PLP_D = %00000000 PLP_E = %00000000 rDATA = "A" temp1 = 20 Main: tx_again: serout TXpin, N9600, rDATA djnz temp1, tx_again pause 5000 goto Main END ' ------------------------------------------------------------------------- ' Subroutine Code ' ------------------------------------------------------------------------- ' ========================================================================= ' User Data ' ========================================================================= ****************************** This is the slave ' ------------------------------------------------------------------------- ' Program Description ' ------------------------------------------------------------------------- ' ------------------------------------------------------------------------- ' Device Settings ' ------------------------------------------------------------------------- DEVICE SX28, OSCXT2, TURBO, STACKX, OPTIONX FREQ 4_000_000 ' ------------------------------------------------------------------------- ' IO Pins ' ------------------------------------------------------------------------- led1 var rc.0 led2 var rc.1 ' ------------------------------------------------------------------------- ' Constants ' ------------------------------------------------------------------------- ' ------------------------------------------------------------------------- ' Variables ' ------------------------------------------------------------------------- rDATA var byte temp1 var byte ' ========================================================================= PROGRAM Start ' ========================================================================= ' ------------------------------------------------------------------------- ' Subroutine Declarations ' ------------------------------------------------------------------------- ledon1 sub ledon2 sub ' ------------------------------------------------------------------------- ' Program Code ' ------------------------------------------------------------------------- Start: PLP_A = %00000000 PLP_B = %00000000 PLP_C = %00000000 main: do serin rc.7, N9600, rDATA loop until rDATA = "A" ledon1 ledon2 goto main end 'subs ledon1: low led1 pause 1000 high led1 return ledon2: low led2 pause 1000 high led2 return ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=103038#m103211 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2006 (http://www.dotNetBB.com)