Shop OBEX P1 Docs P2 Docs Learn Events
Serial coms — Parallax Forums

Serial coms

SiriSiri Posts: 220
edited 2010-07-14 20:30 in Propeller 1
I am trying to use the serial objects - Simple serial,FullDuplexSerial,ExtendedFullDuplexSerialand FullDuplexSerialPlus - to send non-inverted,8-N-1 signals to a
Pololu Dual serial Motor Driver.


The driver does work as it is suppose to as all tests suggested by Pololu memebers results confirm.
What was suggested is to confirm that the PROP does send the correct commands and in the correct format.
I have confirmed that the commands are correct by using PST to debug.The commands are correctly displayed on the PST screen.The cmmands are also received by the
Pololu motor Driver.

The motor does NOT respond to commands.

So what left to be confirmed is the serial format - non-inverted,8-N-1 serial communicatio.The baud rate is fixed at 38400.- and the serial objects are
initialized with the correct baud rate.

Attached are1.Pololu driver info.
2.The prop Trial code

Post Edited (Siri) : 7/14/2010 1:49:46 PM GMT

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-07-14 14:26
    You're sending string of characters like "1", "7", "0", 13 while the Pololu expects these values as individual 8-bit bytes. Try
    
    Pub MotorData
    
        repeat
          Serial.Str(string(170,13))
           waitcnt(clkfreq/100+cnt)
          Serial.Str(string(141,127))   
          waitcnt(clkfreq*5+cnt)
    '      Serial.Str(string(141,0))  ' You can't have a zero byte in a string, so you have to do that using Tx
           Serial.Tx(141)
           Serial.Tx(0)
           waitcnt(clkfreq*5+cnt) 
           Serial.Str(string($8E, 127))  ' In Spin, you use $ instead of 0x
           waitcnt(clkfreq*5+cnt)
    
    


    If you want, you could use Serial.Tx for all the bytes sending them one at a time.

    Post Edited (Mike Green) : 7/14/2010 2:31:25 PM GMT
  • SiriSiri Posts: 220
    edited 2010-07-14 15:55
    Thanks Mike

    I knew you would help me as you have bailed me out many times.

    I will try what you suggested and post back.

    Siri
  • SiriSiri Posts: 220
    edited 2010-07-14 20:30
    Mike,

    Your solution worked like a charm

    Thanks,

    Siri
Sign In or Register to comment.