In SX Microcontrollers, SX/B Compiler and SX-Key Tool, tdg8934 wrote: I have been working on modifying the SX/B 4x4 matrix keypad Help example to transmit the keypad digit to a BS2px. It was working sometime back but perhaps something changed (I don't think so) and the transmit portion (SEROUT) doesn't work anymore and I have been spending a couple of days looking at it and coming up with nothing. I have attached the SX/B code for your review. Is there anyway how I can test the SEROUT of the SX/B to see what may be happening here. All I get is some random characters from time to time (with the program below). At the BS2px I am trying to receive the byte with the following statements: '========================================================= ' TestKeypad.BS2px ' {$STAMP BS2px} ' {$PBASIC 2.5} SIO PIN 12 ' keypad serial output to sx28 RA.0 TX PIN 13 ' serial output to LCD ' ------------------------------------------------------------------------------ ' Constants ' ------------------------------------------------------------------------------ #SELECT $STAMP #CASE BS2, BS2E, BS2PE T2400 CON 396 T9600 CON 84 T19K2 CON 32 #CASE BS2SX, BS2P T2400 CON 1021 T9600 CON 240 T19K2 CON 110 #CASE BS2PX T2400 CON 1646 T9600 CON 396 T19K2 CON 188 #ENDSELECT Inverted CON $4000 Open CON $8000 Baud CON OPEN | T9600 ' 9600 OPEN TRUE keypad baud rate LcdBaud CON T19K2 ' 19200 LCD baud rate ' ------------------------------------------------------------------------------ ' Variables ' ------------------------------------------------------------------------------ response VAR Byte ' ------------------------------------------------------------------------------ ' Initialization ' ------------------------------------------------------------------------------ Initialize: HIGH TX ' setup serial output pin PAUSE 100 ' allow LCD to initialize ' ------------------------------------------------------------------------------ ' Program Code ' ------------------------------------------------------------------------------ Main: GOSUB Get_Keypad GOTO Main ' Repeat process '----- Subroutines Get_Keypad: SERIN SIO, Baud, 1000, Get_Keypad, [response] PAUSE 250 SEROUT TX, LcdBaud, [response + 48] RETURN '================================================================ ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=108157 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)