Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Connecting to PC

  1. Question Connecting to PC

    Does anyone have experience using a PC to talk to a one-wire UART on a microcontroller? We are trying to use LabView, but may be able to use C or C++ if possible. We’re also playing around with trying to create a circuit that will turn the two-wire serial communication to a one wire UART. Any ideas? We're trying to get our robot's motor controllers working with the computer. Thanks!

  2. #2

    Re: Connecting to PC

    This circuit will connect a serial port to a single wire TTL device.




    Serial port pins
    Rx: 2
    Tx: 3
    Gd: 5

  3. Re: Connecting to PC

    You need a bootloader, compiler, and MCU with rx tx pins first

  4. #4
    Join Date
    May 2008
    Posts
    2,228
    Images
    155
    Rep Power
    127

    Re: Connecting to PC

    Quote Originally Posted by Remus View Post
    Does anyone have experience using a PC to talk to a one-wire UART on a microcontroller? We are trying to use LabView, but may be able to use C or C++ if possible. We’re also playing around with trying to create a circuit that will turn the two-wire serial communication to a one wire UART. Any ideas? We're trying to get our robot's motor controllers working with the computer. Thanks!
    It might help if you tell us which motor controller.

    As for duplex->half-duplex, the important part of your code will be to make sure you give sufficient time to read back data before you start writing the port.

    -Fergs

  5. #5
    Join Date
    May 2008
    Posts
    2,228
    Images
    155
    Rep Power
    127

    Re: Connecting to PC

    Quote Originally Posted by No0bert View Post
    You need a bootloader, compiler, and MCU with rx tx pins first
    What? He says he has a motor controller already, and just needs to get half-duplex serial out of a PC, how would that require a bootloader, compliler, and MCU?

    -Fergs

  6. #6
    Join Date
    Apr 2008
    Location
    Sacramento, CA, USA Area
    Posts
    5,341
    Rep Power
    176

    Re: Connecting to PC

    The schematic posted will take serial, just plain ol', so I concur with Fergs - you don't have substantial requirements. Just a language you can bash bits with. Anything reasonably competant.

    Oh - +Rep to MikeG for the schematic!
    I Void Warranties�

  7. Re: Connecting to PC

    Quote Originally Posted by MikeG View Post
    This circuit will connect a serial port to a single wire TTL device.




    Serial port pins
    Rx: 2
    Tx: 3
    Gd: 5
    I tried using this circuit with the Parallax 27971 position controller with limited success. When transmitting from the computer to the device, the circuit works just fine. However, the receive side is not working. I'm using a MAX232 level shifter on the receive side of this circuit to change what should be logic level to RS-232 voltages. Furthermore, in the circuit's current configuration, the reply bytes from the position controller are not at 0-5 Volts, but rather at 3-5 Volts. I determined that the 10k pull-up resistor is unnecssary with my hardware as the device is pulling the one-wire line high anyway. By changing the 1K resistor on the gate of the 2N3906 to a larger value, I can make the receive bytes almost span from 0-5V. However, when I oscilloscope probe the circuit on its output back to the computer, I get no data at all. Any suggestions on what is going on and/or how to fix it?

    I also tried using a MOSFET circuit with identical results.

    Thanks
    Last edited by Remus; 03-03-2009 at 01:49 PM. Reason: Add more info

  8. #8

    Re: Connecting to PC

    I double checked the circuit. It looks right... no MAX232.

  9. #9
    Join Date
    Jun 2009
    Location
    Little Elm, Texas (Dallas Area)
    Posts
    13
    Rep Power
    33

    Re: Connecting to PC

    Darn! A few years ago I did a pretty big application I called Super Stepper that basically allowed the communications from the PC and to up to 32 microcontroller devices doing stuff such as stepper, DC, Servo motor control, inductive load outputs, digital input and output, etc. It has been quite a while, but all of this material is open source so you are free to use it as you need. You can find some of the information on the www.superstepper.com website, but the code and related material would be on www.avayanelectronics.com.

    This is not for a single wire com link, though. But I am thinking it can easily be changed to that as the communications were pretty much half duplex anyway. It would require changing the hardware a little bit, as suggested above.

    BTW, all the Super Stepper code was done in assembly and for the AVR microcontrollers.
    Check out my Open Source electronic designs at www.avayanelectronics.com

  10. #10
    Join Date
    Jul 2008
    Location
    Belgium
    Posts
    633
    Images
    2
    Rep Power
    61

    Re: Connecting to PC

    Quote Originally Posted by Remus View Post
    I tried using this circuit with the Parallax 27971 position controller with limited success. When transmitting from the computer to the device, the circuit works just fine. However, the receive side is not working. I'm using a MAX232 level shifter on the receive side of this circuit to change what should be logic level to RS-232 voltages. Furthermore, in the circuit's current configuration, the reply bytes from the position controller are not at 0-5 Volts, but rather at 3-5 Volts. I determined that the 10k pull-up resistor is unnecssary with my hardware as the device is pulling the one-wire line high anyway. By changing the 1K resistor on the gate of the 2N3906 to a larger value, I can make the receive bytes almost span from 0-5V. However, when I oscilloscope probe the circuit on its output back to the computer, I get no data at all. Any suggestions on what is going on and/or how to fix it?

    I also tried using a MOSFET circuit with identical results.

    Thanks
    Very untimely reply.. but you may want to try using a pull-down resistor of say 10k from the RX line to ground.
    As it is now, a low RX signal - ie. not driving the PNP resistor- would yield a voltage of ~Vbe + Vce, since the only reference to ground is through the NPN resistor, which should be off during RX read.


    I'm only theorizing though, if I find a little time at work I'll try it and get back..
    Artificial Intelligence is no match for Natural Stupidity

    "For a list of all the ways technology has failed to improve life, press three" - Alice Kahn

    Resistance is futile! (if < 1)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Discussion Remote PC control
    By Wingzero01w in forum Robot Computers
    Replies: 22
    Last Post: 11-23-2012, 01:37 PM
  2. Question(s) Stream webcam from PC based robot
    By anandoc in forum Sensors
    Replies: 9
    Last Post: 11-07-2008, 06:07 PM
  3. PC Robots
    By Droid Works in forum Robotics General Discussion
    Replies: 20
    Last Post: 08-09-2008, 04:36 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •