Exact match. Not showing close matches.
PICList
Thread
'[SX] Serial In/Out Timing'
2009\07\28@193827
by
Castrovincin/a
|
|
Hello,
I am having issues with the timing of the serial in command. I am using visual basic to send a simple 1 or 2 depending on my outcome and the Sx chip needs to pick it up and go high. (nothing orginal here) but the problem I am having is that it works great for about 4 seconds and then it seems like it is timing out then works good again. Sometimes I have to send a serial command like 3 times for the stamp to pick it up. I am using an external osc. I am thinking that its resetting somehow? Watchdog timer or reset command?
Here is the shabby program
DEVICE SX28, OSCXT2, STACKX, OPTIONX,turbo
FREQ 20_000_000
IRC_CAL IRC_FAST
RX_BYTE FUNC 1, 0
sdata var byte
sdata="0"
'pin Ra.3=INPUT SCHMITT
PLP_A = %1111
plp_c=%11111111 ' pull up unused pins
output rc
PROGRAM Start start:
goto main
Main:
'TX_STR "Press a key: "
sdata = RX_BYTE
if sData = "1" then
high rc.7
SEROUT RA.0, n2400, "A"
endif
if sdata= "2" then
low rc.7
SEROUT RA.0, n2400, "B"
endif
GOTO Main
''''''''''''''''''''''''''''''''''''''''''''''
FUNC RX_BYTE
SERIN ra.3, n2400, __PARAM1 ' wait for byte
ENDFUNC
---------- End of Message ----------
You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=371702
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)
2009\07\28@212245 by JonnyMacn/a
|
|
The problem may be in the VB code. Test your program with something generic like a terminal program -- you can do this with the bytes you're sending. Once you get the SX slave side happy and proved then you can move on to the VB stuff.
---------- End of Message ----------
You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=371702#m371730
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)
2009\07\28@220112 by PJ Allenn/a
|
|
[ Just wanted to emphasize the 22K resistor on the SX/SERIN_pin. ]
---------- End of Message ----------
You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=371702#m371736
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)
More... (looser matching)
- Last day of these posts
- In 2009
, 2010 only
- Today
- New search...