Shop OBEX P1 Docs P2 Docs Learn Events
Changing Datalogger 27937 Baud Rate — Parallax Forums

Changing Datalogger 27937 Baud Rate

Li YueLi Yue Posts: 2
edited 2014-02-17 09:55 in BASIC Stamp
I am trying to change the communication baud rate between BS2 and Datalogger #27937. It doesn’t seem to work. This is the code I am using to change the baud rate of the Datalogger from its default (9600) to 19200 :

Baud CON 84 ' Serial Baud Rate 9600 bps (BS2)
SEROUT TX\CTS, Baud, [$14, $20, $9C, $80, $00, CR]

I would like to know what I am doing is wrong. If any one has any idea, please let me know. Thanks,


Li

Comments

  • PublisonPublison Posts: 12,366
    edited 2014-02-17 08:56
    Welcome to the forums!

    Your other post was deleted as double posts are not allowed:

    http://forums.parallax.com/showthread.php/134682-Forum-Guidelines
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2014-02-17 09:53
    Are you confident with the connections, and have it working okay at 9600 baud? Seeing the ">" prompt?


    Maybe try the ascii mode:
    SEROUT TX\CTS, $54, ["SBD $$9C8000", CR]

    In general, the Stamp has trouble receiving at higher baud rates due to its unbuffered serial port. Flow control does help with the #27927 datalogger. Nevertheless, the actual throughput will not improve by much, because the Stamp takes time between bytes to process data. You'll never get more than 4800 baud in actual throughput.
  • xanatosxanatos Posts: 1,120
    edited 2014-02-17 09:55
    Digging in my way-back machine, I found this code - this is what I was using to set my datalogger to 4800, before I used a firmware updater to make it power up at the defaults I specified. Don't know if this helps, but here it is:
    '***********[INITIALISE LOGGER & DETECT MEMORY STICK]*********
    LOW DLTX
    DEBUG HOME," Remove Memory and Press 1 ",CR
    DO WHILE idx=0
    GP_WORD=GP_WORD+1
    DEBUGIN DEC1 idx
    LOOP
    DEBUG CLS
    SEROUT DLTX, 240, ["IPA", CR]
    PAUSE 200
    SEROUT DLTX, 240, ["SCS", CR]
    PAUSE 200
    SEROUT DLTX, 240, [$14,$20,$71,$02,$00,$0D]  'SET BAUD TO 4800
    SERIN DLRX, 500,[WAIT(">")]
    DEBUG "Initialized ",CR
    PAUSE 200
    
    
    
Sign In or Register to comment.