Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Making my first USB device

Status
Not open for further replies.

Mutad0r

Junior Member level 3
Joined
Feb 13, 2013
Messages
28
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,608
We're taking on micro-controllers at school and I REAAAALY wanted to be able to control my device through USB, problem is that my teacher has never made an USB device before, so this is a first for both of us.

I've been reading on the matter for a couple of weeks now, and I have learned some things, but not enough. We have ordered an USB demo board from microchip, and I've designed the device I want to make. As far as me and my teacher is concerned, it should work, it's just missing the programming. ( I haven't physically built it yet, just made a proteus 8 project)

The device controls 3 motors through h-bridges with PWM, so it mainly uses an external supply. It also has the possibility to set the speed and direction of the motors with variable resistors and buttons on the device itself, so that it can be used without being connected to a PC through USB, and that's probably going to be what I'll do first; get it working on it's own. But once it has been connected to a PC, I want to ignore the buttons on the device and take control through the PC.

Programming on the micro-controller side shouldn't be a problem, except for receiving the USB signal and making sense of it maybe. On the application side, I could probably manage on my own too, but the problem I have is the communication between the devices. While I could figure this out on my own, I fear the course is too short for me to complete it, it's only a couple of months.

Any help you can give, I shall welcome. The device is pretty simple, it only needs to receive data from the PC for the speed, direction and on/off for each of the 3 motors and possibly on/off for the laser ( I'll get to the laser in a bit)
Also it would be nice if you could check out this schematic I have made, and give me your semi-professional opinion whether it looks like it would work. My teacher says that it should work, but he can't be sure for the USB part. The micro- controller has internal pull-up resistors, so no need to add those.
And finally, would I need to make a driver, or could this be used with any pre-made ones?

Before the schematic, here's what the device will do: 3 motors have mirrors attached to them, they are arranged in a way that when the laser is turned on, goes from one to the other to the third, and then exits the device. Since the mirrors aren't perfectly aligned with the center of the motor and are at a very slight angle, the light reflects in different directions. Depending on the speed and direction of the motors, when the device is pointed at a wall, the laser draws a simple "picture" on it(the wall). Imagine lighting a stick on fire in the dark and then moving that around very fast. with one motor there would be just a circle, but additional motors and directions add and speeds make it possible to have more complex images. No drawing unicorns of-course. Also, once I have this thing working, I could tweak the application on the pc to respond to music and send filter it to Low pass, band pass and high pass and send them to different motors.

ANYWAY, the schematics.

mo.jpg
 

It's way simpler to use the USB if you go through an RS232 interface like an FT232 chip and then use the standard drivers that produce a virtual serial port through USB and then use either a terminal emulator on your PC or write your own code to send commands to the serial port. This way you avoid all the USB configuration problems on your PIC that appears to trip most people up as it's so complicated. Trust me it's way easier than a full USB interface implementation.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top