Shop OBEX P1 Docs P2 Docs Learn Events
Need help with communication between Prop and linux running BST (Brad's Spin To — Parallax Forums

Need help with communication between Prop and linux running BST (Brad's Spin To

RobofreakRobofreak Posts: 93
edited 2010-07-14 01:42 in Propeller 1
Hello all,

I switched from windows to linux about a year ago (one of the best decisions I've ever made haha) and downloaded BST from Parallax. I've had no problems with it: I can program the Prop, like uploading a program to the RAM and/or EEPROM. But when it comes down to communication with the built in serial terminal, that's where I run into problems... The odd thing is that the serial terminal will transmit characters to the Prop (I've tested that, telling the Prop to light an LED when receiving a certain character), but when I transmit characters from the Prop to the computer, it doesn't receive them. I've tested it with my own serial terminal program running in Python, and I got the same result. I know it works, because when I switch over to windows and run a serial terminal it receives characters fine.

Help please!

Thanks,
Robofreak

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Austin Bowen,


"One must watch out for mechanics. They start out with a sewing machine, and end up with the atomic bomb" - A quote from someone that I saw on Addall.com

"Not only do I see the glass as half empty, I wonder if anyone poisoned the glass with arsenic" - My dad, inside joke haha

Comments

  • AleAle Posts: 2,363
    edited 2010-07-13 18:05
    Did you test in "loopback" mode both for the computer and the prop ?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Visit some of my articles at Propeller Wiki:
    MATH on the propeller propeller.wikispaces.com/MATH
    pPropQL: propeller.wikispaces.com/pPropQL
    pPropQL020: propeller.wikispaces.com/pPropQL020
    OMU for the pPropQL/020 propeller.wikispaces.com/OMU
    pPropellerSim - A propeller simulator for ASM development sourceforge.net/projects/ppropellersim
  • RobofreakRobofreak Posts: 93
    edited 2010-07-13 19:25
    I did a software loopback with the propeller, pretty much just this:

    DIRA[noparse][[/noparse]30]~~
    DIRA[noparse][[/noparse]31]~
    REPEAT
      OUTA[noparse][[/noparse]30] := INA[noparse][[/noparse]31]
    
    



    I know it's working, because I also made it output to an LED whenever something was happening.
    The LED flickers whenever I type something in the terminal, but the terminal isn't reading anything...

    I also just physically connected the two lines (TX and RX on the serial port) and it's echoing whatever I type, so I know it's receiving.
    I guess the only thing I can think the problem is, would be that the Prop isn't giving enough voltage. But it works when the computer's running windows! haha Maybe linux just doesn't like anything significantly below the +/- 12V of the serial line..? But I figured that'd be a purely hardware aspect of the computer.

    Maybe I'll just make a little converter cable to go from my Prop's existing serial circuitry to a max232 circuit, then to the computer.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Austin Bowen,


    "One must watch out for mechanics. They start out with a sewing machine, and end up with the atomic bomb" - A quote from someone that I saw on Addall.com

    "Not only do I see the glass as half empty, I wonder if anyone poisoned the glass with arsenic" - My dad, inside joke haha

    Post Edited (Robofreak) : 7/13/2010 8:28:47 PM GMT
  • jazzedjazzed Posts: 11,803
    edited 2010-07-13 19:40
    Do you have any code in your top spin file to define the clock setup? For example ...

    CON
      _clkmode = xtal1 + pll16x
      _xinfreq = 5_000_000
    
    


    What baudrate are you using?
    What is your BST version?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Propeller Pages: Propeller JVM

    Post Edited (jazzed) : 7/13/2010 7:45:08 PM GMT
  • RobofreakRobofreak Posts: 93
    edited 2010-07-13 20:41
    I don't have any clock settings right now. It's fast enough for me to just let it use the internal crystal with my example code, and the terminal's baud is set low (like 600), so I know it's slow enough for it. So I know baud isn't the problem here..

    BST version 0.19.3

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Austin Bowen,


    "One must watch out for mechanics. They start out with a sewing machine, and end up with the atomic bomb" - A quote from someone that I saw on Addall.com

    "Not only do I see the glass as half empty, I wonder if anyone poisoned the glass with arsenic" - My dad, inside joke haha
  • SapiehaSapieha Posts: 2,964
    edited 2010-07-13 21:53
    Hi Robofreak.

    Due to unsuitability of internal Clock sources You can't have functioning Serial communication.


    Regards.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nothing is impossible, there are only different degrees of difficulty.
    For every stupid question there is at least one intelligent answer.
    Don't guess - ask instead.
    If you don't ask you won't know.
    If your gonna construct something, make it·as simple as·possible yet as versatile as posible.


    Sapieha
  • RobofreakRobofreak Posts: 93
    edited 2010-07-14 00:05
    On the contrary @Sapieha, I have tested serial communication with my own program running the clock on internal high speed mode, and got TX and RX communication up to 2400 baud. This may probably just be due to the fact that my clock is actually a little faster than it is rated at, but even so I could run the program at =< 1200 baud on other props.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Austin Bowen,


    "One must watch out for mechanics. They start out with a sewing machine, and end up with the atomic bomb" - A quote from someone that I saw on Addall.com

    "Not only do I see the glass as half empty, I wonder if anyone poisoned the glass with arsenic" - My dad, inside joke haha
  • hover1hover1 Posts: 1,929
    edited 2010-07-14 00:37
    What is the "Prop's existing serial circuitry"?· It almost sounds like you are running directly off a Prop pin to the PC.
    Quote " I guess the only thing I can think the problem is, would be that the Prop isn't giving enough voltage."
    Voltage to the PC or you "serial circuitry"?
    Jim
    Robofreak said...
    I guess the only thing I can think the problem is, would be that the Prop isn't giving enough voltage. But it works when the computer's running windows! haha Maybe linux just doesn't like anything significantly below the +/- 12V of the serial line..? But I figured that'd be a purely hardware aspect of the computer.

    Maybe I'll just make a little converter cable to go from my Prop's existing serial circuitry to a max232 circuit, then to the computer.

  • RobofreakRobofreak Posts: 93
    edited 2010-07-14 01:42
    @jim, the existing serial circuitry I have connected to the prop consists of transistors providing a simple interface between the high pc voltage and the prop. I've attached a pdf of the schematic from Parallax. Mind you, the circuitry I use is somewhat simpler than the pdf shows. no transistor for the Res line, just a series cap which works perfectly fine, and not so many resistors on the NPN transistor (2N3904). Despite the simplifications, it works perfectly fine on other pc systems. Lucky for me because my programming board was running out of room haha

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Austin Bowen,


    "One must watch out for mechanics. They start out with a sewing machine, and end up with the atomic bomb" - A quote from someone that I saw on Addall.com

    "Not only do I see the glass as half empty, I wonder if anyone poisoned the glass with arsenic" - My dad, inside joke haha
Sign In or Register to comment.