Shop OBEX P1 Docs P2 Docs Learn Events
Paul_USBDrive Memory Stick Datalogger / baudrate — Parallax Forums

Paul_USBDrive Memory Stick Datalogger / baudrate

Rob v.d. bergRob v.d. berg Posts: 86
edited 2009-01-27 21:54 in Propeller 1
Hi,

I'm playing with "Paul_USBDrive.spin" and "Paul_USBDemo.spin" program.
It uses serial uart 9600 baudrate,·it works good.
I have tried to speed up the baudrate with 19200 and 115200, with no luck

Is there anyone who did·this ?

Regards,
Rob.

·

Comments

  • StefanL38StefanL38 Posts: 2,292
    edited 2009-01-26 16:31
    Hello Rob,

    not much info provided from you yet
    so I have to ask the obvoius

    did you read the VDAPFirmwareSpec(.pdf) ?

    which tells how to change the baudrate

    best regards

    Stefan
  • Rob v.d. bergRob v.d. berg Posts: 86
    edited 2009-01-26 21:47
    Hello Stefan,

    Yes·i know the tabel, in·the driver "Paul_USBdrive.spin"·is a PUB methode·to set the baudrate.·I have done the following steps:

    1) set the uart to 9600 baud for default communication to the datalogger

    2)·send the three byte $9C $80 $00 (LSB first) via PUB setBaudRate(divisor) (see tabel Vinculum)

    3) restart the uart with 19200 baudrate

    this did not work.

    rob
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2009-01-26 23:37
    Hi Rob, I don't have a lot of experience with Spin so someone please correct me if I am wrong. Looking at Pauls object (Ver 1.0 ) the parameters should be passed :- setBaudRate($00809C) which is opposite to what I would have expected but that seems to be the way the·object is set up. Once you return from that routine then stop the UART and restart at the new baudrate. I don't know if it makes a difference but I would normally make the change in baudrate my first program reference to the Datalogger·.

    Jeff T.
  • Rob v.d. bergRob v.d. berg Posts: 86
    edited 2009-01-27 21:54
    Hi Jeff,

    that's the trick,·i add in·the main of "Paul_USBDemo.spin" after the·standard uart setting (9600 baudrate) the following:

    USB.setBaudRate($00809C) 'for baudrate 19200·or $00001A for 115200 baud

    USB.Restart(txUSB,rxUSB,19200)·'or·115200·

    waitcnt(clkfreq / 10 + cnt) 'wait 100 msec

    *********************************************************

    In·"Paul_USBdrive.spin"·i·add an extra PUB·to restart the uart at 19200 baudrate

    PUB Restart(tx_USB,rx_USB,baudrate) | okay
    · okay := USB.start(rx_USB, tx_USB, 0, baudrate)


    *********************************************************

    It al works·now also at 115200 baudrate!

    thanks.

    Rob.
Sign In or Register to comment.