Shop OBEX P1 Docs P2 Docs Learn Events
I need help using serial to Pc — Parallax Forums

I need help using serial to Pc

grasshoppergrasshopper Posts: 438
edited 2007-11-20 17:28 in Propeller 1
I am using the Propeller DIP and made the serial circuit as shown in the manual.
pic1.JPG

I can program the IC but can not send data to the PC. I think it is because i am using 3V to send data can i change to this.
pic2.JPG
864 x 533 - 32K

Comments

  • SapiehaSapieha Posts: 2,964
    edited 2007-11-19 16:08
    Hi grasshopper

    On standart Com port you can have 3 to 12 Volt on it

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nothing is impossible, there are only different degrees of difficulty.

    Sapieha
  • AribaAriba Posts: 2,685
    edited 2007-11-19 17:20
    Your problem is not the 3.3V supply, but the fact that DTR goes high on normal RS232 communication (the Propeller Tool holds it Low).
    So the Rx of the PC never can go LOW. The simplest solution is to connect the 4.7k Resistor from Rx to Vss instead of DTR (this one at the PC Serial Port Connector).

    Andy
  • grasshoppergrasshopper Posts: 438
    edited 2007-11-19 17:25
    I will give it a try. Thanks Ariba
  • grasshoppergrasshopper Posts: 438
    edited 2007-11-19 17:53
    I still can not get the comunication to work, i dont even see the signal on a scope. So now i am wondering if i have the code correct.
    Take a look and let me know what you think.

    {{ Test serial com 1 }}

    CON
    _clkmode = xtal1 + pll16x
    _xinfreq = 5_000_000

    OBJ
    SER : "FullDuplexSerial"

    pub start
    ser.start(31, 30, 0, 9600)

    repeat

    waitcnt (1_000_000 * 20 + cnt )
    ser.str(string("Test"))
    ser.tx(13)
    ser.tx(10)
  • hippyhippy Posts: 1,981
    edited 2007-11-19 18:01
    @ grasshopper : Assuming you've got indentation right and it's not hanging in that 'repeat', that code works okay for me on a ProtoBoard via a PropPlug.
  • SapiehaSapieha Posts: 2,964
    edited 2007-11-19 18:04
    Hi grasshopper.

    In Com Properties you must have ..... NO hardware flow

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nothing is impossible, there are only different degrees of difficulty.

    Sapieha
  • grasshoppergrasshopper Posts: 438
    edited 2007-11-19 18:23
    Ergh this is frustrating all i need to do is get this prototype working and i can make the boards with a USB connection.

    Sapieha,
    I tried as you suggested. i am using hyper terminal for what it is worth. I am now going to try using visual basic but already foresee no positive results.

    I can program the thing so i assume the hardware is correct. I tryed different baud rates maybe i need to invert the signal?

    Any help is going to stop me going postal at work. [noparse]:)[/noparse]

    [noparse][[/noparse]*edited]
    here is my new schematic

    pic3.JPG

    Post Edited (grasshopper) : 11/19/2007 6:31:42 PM GMT
  • SapiehaSapieha Posts: 2,964
    edited 2007-11-19 22:57
    Hi grasshopper
    It is not corect.

    Standart Com have -3 -12 to +3 +12 Volt so it is not corect to conect RX signal to Vss.

    Look on this link
    http://en.wikipedia.org/wiki/RS-232

    Conect RTS to CTS and from this resistor to RX and it must funktion

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nothing is impossible, there are only different degrees of difficulty.

    Sapieha
  • grasshoppergrasshopper Posts: 438
    edited 2007-11-19 23:13
    Thanks for your help. I tossed the transistor deal and went with this

    Again all i can do is program the dam thing. I think it is either the DTR line or a programming issue.

    here is my current schematic

    pic4.JPG
  • SapiehaSapieha Posts: 2,964
    edited 2007-11-19 23:23
    Hi grasshopper

    Cros conect RTS and CTS lines on conector.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nothing is impossible, there are only different degrees of difficulty.

    Sapieha
  • grasshoppergrasshopper Posts: 438
    edited 2007-11-19 23:34
    Yea i now did this

    pic6.JPG


    Still no luck i am going to sleep on it. I will check in tomorrow

    Thanks;;
  • RoadsterRoadster Posts: 209
    edited 2007-11-19 23:49
    I too how problems comunicating with PC with the transistor circuit but with a simple change I got it to work.

    I attahed my modifed schematic, you might want to also try the basic stamp debug window on the basic stamp editor
    703 x 579 - 60K
  • AribaAriba Posts: 2,685
    edited 2007-11-20 09:12
    grasshopper

    If you can program the Propeller then the RX/TX levels can not be the problem. At programming, the interface has to work in both directions.
    Most PCs have no problem with 0V and 3.3 V level at RX. Some need a negativ voltage instead of 0V, then the MAX circuit or Roadster's solution may help.
    But what can be the real problem?
    Perhaps you get a Reset between Upload the program and switching to the Terminal. Because the state of DTR changes on Open and Close, you can only 1 time open the port again after Upload. After closeing it a Reset occure.

    You can try it with PropTerminal, this is a Terminal with intergrated Loader. After upload a binary with PropTerminal, the Port stays open, and you can communicate without changeing the Program.
    See: http://forums.parallax.com/showthread.php?p=649540

    Andy
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2007-11-20 12:39
    grasshopper,
    There is nothing mysterious about the transistor circuit or the RS-232 port. The circuit that shows the 4k7 to ground should work but you could try changing the value to 1K to sharpen up those edges. As long as the PC sees something less than 1V or so there should be no problem even though RS-232 "standard" (not) states otherwise. The circuit with the pnp emitter tied to +5V would never work as the prop could never turn the transistor off with 3.3V (the transistor would see 1.7V which is enough to turn it on).

    If you are ever unsure about your terminal setup you can always disconnect and short pin 2&3 of the DB9 together and the terminal should echo everything you type. If it doesn't then check that your handshake settings are set to "none".

    Your code should be indented after the repeat (or else it won't).

    *Peter*
  • Fred HawkinsFred Hawkins Posts: 997
    edited 2007-11-20 14:34
    Peter, which of these alternative schematics is worth retaining?
  • grasshoppergrasshopper Posts: 438
    edited 2007-11-20 16:54
    Ok to recap i am using this schematic

    pic6.JPG


    And this code
    
    {{
    ***********************************************************************
    Com Testing   using a RS232 IC
    ***********************************************************************
    
    }}
    CON
      _clkmode = xtal1 + pll16x
       _xinfreq = 5_000_000
    
    OBJ 
        SER  : "FullDuplexSerial" 
    pub start
     ser.start(31, 30, 0, 9600) 
    
    
    repeat
      ser.tx(10)                          'line feed
      ser.tx(13)                          'carriage return
      waitcnt (1_000_000 * 25 + cnt )
      ser.str(string("Hello"))
      ser.str(string("WORLD")) 
      ser.tx(13)                          'line feed
      ser.tx(10)                          'carriage return
                 
    
    



    * i can program the thing but can not receive the string using hyperterminal and various other programs
    * Hypertermianl is Set up as this
    Bits per secound 9600
    Data bits 8
    PArity none
    Stop bits 1
    Flow control None

    I NEED HELP I AM GOING INSANE !!!!!!!!!
    turn.gif
  • grasshoppergrasshopper Posts: 438
    edited 2007-11-20 17:28
    I give up, I use my demo board and the code works. I think it has something to do with the RES line or just serial communication.

    Thanks everyone for helping and sorry for sending so many post and getting no where.
Sign In or Register to comment.