Shop OBEX P1 Docs P2 Docs Learn Events
I need some help... — Parallax Forums

I need some help...

MRLMRL Posts: 13
edited 2007-03-27 02:20 in General Discussion
I am brand new to SX development - I have been using BS2's for quite some time.

I have a question that may be pretty basic, but it is driving me crazy.

I am using SX/B only (no in line assembly) and I am trying to run through a series of baud rates in the SERIN command using a program line like this:···
SERIN RA.0, Baud, tmpB1

I have defined a number of constants like this:
Baud1··········· CON···· "T3600"
Baud2··········· CON···· "OT3600"
Baud3··········· CON···· "N3600"
Baud4··········· CON···· "ON3600"


So, I am trying to assign the values in the Baud1 through Baud4 to the Baud variable like this:
Baud = Baud1

And I am getting a compile error.
Would someone please help a new guy out and tell me how to do this with SX/B?· I have been trying to use the SX/B help file but I can't figure it out.· There are references to something called a "z-string", but I don't know what this is and I can't find a clear definition anywhere.· I have also been reading about the "READ" command that works with the "DATA" command, but I don't know if that is an appropriate set of commands to use, or not.
Any help or tips would be appreciated.
Thanks
Mike

Comments

  • Capt. QuirkCapt. Quirk Posts: 872
    edited 2007-03-27 02:17
    SX/B handles both SERIN and READ differently then BS2, Post your code and I'll take a look.
  • JonnyMacJonnyMac Posts: 9,447
    edited 2007-03-27 02:20
    You can't do this:

      Baud = Baud1
    
    
    



    ... but you can do this (I do it all the time):

     Baud    CON     Baud1
    
    
    



    The reason is that Baud1 is a string and that is not a valid type in SX/B so the assignment you're attempting is not valid. What this means, though, is that you can't change baud rates on the fly.
Sign In or Register to comment.