Welcome! Log In Create A New Profile

Advanced

Native USB instead of usb->serial convertor

Posted by james glanville 
Native USB instead of usb->serial convertor
September 19, 2008 08:39PM
Since I fried my second and last arduino and cannot get another one for a while I've been considering using an atmega8 instead, which would provide a native usb solution. While I know there are enough varients of the reprap firmware/hardware/software, I have been considering writing a firmware which acts as a HID device, which would make interfacing with it much easier. I hope to eventually write a program to take gcode as input, and pipe it over usb to the atmega8. So far I have only made the basic circuit and tried some basic usb comms test, but if anyone is interested/willing to help I'd be interested to hear.

James
Re: Native USB instead of usb->serial convertor
October 01, 2008 09:21AM
If you're using an atmega8, you have to implement the USB stack in software as this device has no built-in USB support. In addition, the 8KB memory on this one is far too little to fit the Reprap firmware.

..or did you mistype your device name?

Regarding USB, using CDC instead of HID would give us the same behavior from the host's point of view. This would simplify things a lot in terms of connectivity and keeping track of different HW.


~/= Marius

--
We are Elektropeople for a better living.
[reprap.soup.io]
[www.metalab.at]
Ant
Re: Native USB instead of usb->serial convertor
October 23, 2008 02:52AM
On our project, we are going to be writing new firmware and new software. I was thinking of adding a chip to convert USB to RS232, and then treat the USB port as a RS232 port, which for me would be easier to figure out, but I'd prefer to not need the chip and simply use it as a USB device.

How difficult is it to make a program which interfaces with a device through the USB port? Anyone got some simple C++ examples of such code? Ideally compilable in Code::Blocks.

The problem is all in getting the information. I know if I had the information it'd be very easy, but I don't have the information and I haven't been able to find it. So if someone could provide the necessary information, that'd be great.

Tony
Re: Native USB instead of usb->serial convertor
October 25, 2008 07:58AM
Hi,

You should just get your hands dirty winking smiley
Check out AVR-USB and libusb.

Some starting points:
[obdev.at]
[avrusb.wikidot.com]
[libusb.wiki.sourceforge.net]
[www.nongnu.org]
Re: Native USB instead of usb->serial convertor
October 25, 2008 11:08AM
Ant Wrote:
-------------------------------------------------------
>
> How difficult is it to make a program which
> interfaces with a device through the USB port?
> Anyone got some simple C++ examples of such code?
> Ideally compilable in Code::Blocks.
>
Jan Axelson, author of USB Complete, has a page on her website that gives basic USB HID interfaces for just about any language you'd care to name.

[www.lvr.com]

Just scroll down the page till you see Visual C++ 6.0 and you're good to go.

spinning smiley sticking its tongue out
Re: Native USB instead of usb->serial convertor
October 26, 2008 11:43AM
I'm not really a software guy, but i;m interested in knowing what benefits there are to using native USB...
anyone care to elaborate?
Re: Native USB instead of usb->serial convertor
October 26, 2008 11:59AM
Leav Wrote:
-------------------------------------------------------
> I'm not really a software guy, but i;m interested
> in knowing what benefits there are to using native
> USB...
> anyone care to elaborate?

Two basic ones...

1) when you use RS232 you have to add another chip, usually a MAX232 or similar plus a bunch of capacitors and a few other components, to convert what the microprocessor thinks of as RS232 to what your PC understands RS232 to be. As well, RS232 is becoming quite rare on new PC's and laptops.

2) Native USB can talk directly to your computer. All PC's come equipped with USB ports these days.

I personally have found that if you're running a milling operation (a Dremel tool in my case) on your Reprap machine, the EMI/RFI from it will knock your USB connection off-line rather regularly if you aren't using a USB 2,0-compliant (shielded) cable. Although I'm using a USB-HID (human interface device) connection, which supposedly doesn't need shielded cables), I need them all the same.

I found USB comms are a tiny bit trickier, using fixed blocks as they do, than RS232 to do firmware and software for. Now that I know how to use it, however, I would never think of going back to RS232.

Edited 1 time(s). Last edit at 10/26/2008 12:00PM by Forrest Higgs.
Re: Native USB instead of usb->serial convertor
October 26, 2008 12:32PM
Most micros with on board USB give you 12Mbits, 100 times faster than most serial ports. Even low speed USB is 1.5Mbits, more than 10 times faster.


[www.hydraraptor.blogspot.com]
Sorry, only registered users may post in this forum.

Click here to login