Society of Robots - Robot Forum
Electronics => Electronics => Topic started by: weebly on September 17, 2012, 10:03:12 AM
-
I wan't to control my robot using usb cable from the PC. I have already a robot, usb cable and PC.
Simply I wan't to know how to drive a motor front,revers,left and right. I have a motor control circuit, and PIC development board.
I want to know about ,,
1.usb input/output circuit.(IC??? If there any cct diagram please post here)
2.controlling interface of PC
Please tell me clearly. I wan't to make this how ever. Before I did it using rs232. Now I want to do it using a usb cable.
-
weebly,
I don't know much about the PIC's but if they have UART pins you may be able to use a USB breakout board and your RS232 shifter to send commands to the UART pins.
-Arkboy
-
Thank you. Can I do it without using a PIC? If so how I should do it?
Just think now I have,
1.motor
2.usb cable
3.pc with a usb port
4.usb breakout board
Please tell me how to do this .
-
weebly,
The reason I said PIC was because you said you were using a PIC development board with your robot. I'm not sure how you would drive it without a micro controller. You would have to have an motor controller/H-bridge circuit to be able to drive the motors without killing your computer, but I don't know how to signal using USB. Basically you would need to find drivers to turn on and off the tx pin on the USB port. If the H-Bridge gets high logic level it will turn on your motor but you would need to have a USB cable for each H-Bridge channel so you are better off using a micro controller because you could tell the micro controller a lot more information and let it turn the motors on and off using the motor controller/H-bridge.
-Arkboy
-
Thnaks for interesting and share your knowledge with me.
I have a motor controller. No worries about that. I guess I can do you told things buy using my PIC. It has USART pins. So is it possible for me to use my PIC? I'm using 18F452. When I using a usb break out board, is ther any crash because pc is UART and my pic is USART?
-
Hi,
[...] using my PIC. It has USART pins. So is it possible for me to use my PIC? I'm using 18F452. When I using a usb break out board, is ther any crash because pc is UART and my pic is USART?
The '452 has got an AUSART (Addressable Universal Asynchronous Receiver Transmitter, The "S" just means "Serial" (as opposed to parallel) which they all are, synchronous or asynchronous, so the "S" is quite superfluous :)
Be aware that you have to set the PIC for the '232, as it is able to do '485 as well - apart from that, it's all semantics.
If you use an USB to (pseudo-) EIA/TIA-232 converter-cable, the PIC will just see the '232 signal, probably in a 0..5V logic, but you'll need to verify this before connecting up anything.
Personally, I'd just change to one of the USB enabled PICs, rather than having to mix two protocols.
-
Soeren,
The '452 has got an AUSART (Addressable Universal Asynchronous Receiver Transmitter, The "S" just means "Serial" (as opposed to parallel) which they all are, synchronous or asynchronous, so the "S" is quite superfluous :)
AUSART means: Addressable Universal Synchronous Asynchronous Receiver Transmitter.
It does have a Synchronous mode but the most common usage is for Asynchronous with an RS232 level translator.
weebly,
Microchip has lots of App Notes on how to use PICs. For serial read AN774.
Here is a link to a good tutorial on using and programming PICs:
http://www.gooligum.com.au/tutorials.html (http://www.gooligum.com.au/tutorials.html)
Almost all of the lessons can be done the the MPLAB SIMulator with a need to buy any hardware.
-
Thank you for all advice,,
According to your opinion
PC>>>>USB PORT>>>USB CABLE>>>USB BREAKOUT BOARD>>>>PIC(18f452)>>>MOTOR CONTROLLER>>>MOTOR
Is this impossible or difficult to do???I already have done rs232. That's why now I'm trying for usb mode.
-
Hi,
AUSART means: Addressable Universal Synchronous Asynchronous Receiver Transmitter.
It does have a Synchronous mode but the most common usage is for Asynchronous with an RS232 level translator.
My bad assumption - based on Microchips website that describes it as:
and Addressable Universal Asynchronous Receiver Transmitter (AUSART)
and I've seen this "S" on several instances on devices that don't do synchronous comms.
Nice that there's always a keen eye to catch the errors ;D
-
Thank you for all advice,,
According to your opinion
PC>>>>USB PORT>>>USB CABLE>>>USB BREAKOUT BOARD>>>>PIC(18f452)>>>MOTOR CONTROLLER>>>MOTOR
Is this impossible or difficult to do???I already have done rs232. That's why now I'm trying for usb mode.
If you know how to program for serial comm (RS232) on both the micro and PC sides then its just connecting some pieces to use a USB port as a virtiual Comm port. You could use an FTDI chip (USB to serial) or a adapter cable (USB to RS232).
PIC to motor controller can be very easy or a big challenge depending what if you buy the controller or build it.
Again, Microchip has a lot of App Notes including basics on motor control that are worth reading.
-
Usb breakout board has GND , D+ , D- and VBUS .
The problem I have is where to connect these output? PIC 18F452 has TX and RX two pins. When I use a RS232 board there was direct two output for PIC RX and TX pins.
But in this case I have no idea about how to connect output to my PIC. Can anyone please help about that case.
-
Hi,
Could you post a link to your USB board?
-
Usb breakout board has GND , D+ , D- and VBUS .
The problem I have is where to connect these output? PIC 18F452 has TX and RX two pins. When I use a RS232 board there was direct two output for PIC RX and TX pins.
But in this case I have no idea about how to connect output to my PIC. Can anyone please help about that case.
Which USB break-out board??????????????
A link to its data sheet would help.