Searching \ for '[SX] Problem with SX/B compiler using the PAUSE an' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/ubicom/languages.htm?key=sx
Search entire site for: 'Problem with SX/B compiler using the PAUSE an'.

Exact match. Not showing close matches.
PICList Thread
'[SX] Problem with SX/B compiler using the PAUSE an'
2006\05\08@191838 by tdoddsn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, tdodds wrote:

:redface:  HELP!
I need to have a time delay before sending a character string at powerup as part of my application. When I added the PAUSE statement to my code to get the delay, I kept getting a garbled initial character. After a lot of trial and error, I pared the code down to a bare minimum and found that if the PAUSE comes first, there is a garble every time on powerup, and if the SEROUT comes first, there is never a garbled initial character. Here is my test code:


This works just fine:


DEVICE          SX28, OSCXT2, TURBO, STACKX, OPTIONX, BOR26
IRC_CAL  IRC_SLOW
FREQ            20_000_000
PROGRAM START
START:
OUTPUT RA.1
MAIN:
SEROUT RA.1,T9600,71
PAUSE 254
GOTO MAIN

This produces an initial garbled character on powerup every time:


DEVICE          SX28, OSCXT2, TURBO, STACKX, OPTIONX, BOR26
IRC_CAL  IRC_SLOW
FREQ            20_000_000
PROGRAM START
START:
OUTPUT RA.1
MAIN:
PAUSE 254
SEROUT RA.1,T9600,71
GOTO MAIN

Is this an SX/B compiler bug? How can I get rid of this garble and still get an initial time delay before sending after a power up??

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=125135
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)

2006\05\08@192430 by beann/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, bean wrote:

First of all you don't have to set the pin to an output. The SEROUT command will do that.
As for the garbled character, you should set the pin to the "idle" state before the pause.
Since you are using "true" serial mode that would be high.

Try this
HIGH RA.1
MAIN:
PAUSE 254
SEROUT RA.1,T9600,71
GOTO MAIN
Bean.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=125135#m125136
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)

2006\05\08@192756 by Jon Williamsn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Jon Williams wrote:

Maybe you need a pull-up on your serial line so that it's in a stable state (vis-a-vis your receiver) until the SX can start transmitting on it.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=125135#m125139
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)

2006\05\08@202834 by tdoddsn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, tdodds wrote:

Thanks so much you guys!

I tried your suggestions  - and they both fix the problem. Like most problems, it's obvious once it is solved, though I wish I could have had this info before I spending three hours trying different code configurations. It makes sense that the send data lead needs to be put in a steady mark (high) condition immediately on startup. I think this needs to be included in the SEROUT documentation.

Thanks again.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=125135#m125150
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)

2006\05\08@210712 by Jon Williamsn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Jon Williams wrote:

I disagree and will not burden our docs unnecessarily.  When we (Parallax) design serial modules they include a pull-up (true mode) or pull-down (inverted mode) to prevent this kind of problem; it's just good design practice.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=125135#m125161
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)

2006\05\09@145944 by James Newtonn/a
flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, James Newton wrote:

tdodds, Feel free to add that documentation to an appropriate page on the sxlist.com wiki/blog site. We like our docs heavily loaded with the things users actually trip up on.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=125135#m125289
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)

More... (looser matching)
- Last day of these posts
- In 2006 , 2007 only
- Today
- New search...