Making a usb host for arduino - Page 1
Forum section: electronics / general

author: carbon dude oxide
author_rank: Frequent Contributor
timestamp: May 08, 2013, 09:58:00 am
content: Hello, i am currently making an arduino project and i would like it to be a stand alone arduino project without the arduino board. Currently i have been using a standard atmega328 in a DIP package ad plugging it into an arduino board and then transfering the chip to my project but now i would like to use the TQFP of the atmega328 to reduce the height of the project. So in order to program this is need to be able to connect via a usbWhat do i need to do to attach a usb host and is there a schematic for it? I did have a look around but i could only find a schematic for the standalone board without the usb host on it.From memory aswell the TQFP does not come with the arduino boot loader on it so would that mean i need to put an isp header onto it? (I belive thats whats there called)

author: amspire
author_rank: Super Contributor
timestamp: May 08, 2013, 10:24:01 am
content: Quote from: carbon dude oxide on May 08, 2013, 09:58:00 amYou can use the circuit of the Arduino version you are using from the Arduino website to see how to wire up the USB circuit, or you can leave the USB off the project and just have the 6 pin header that you can plug a FTDI serial cable into:https://www.sparkfun.com/products/9718Achieves exactly the same result with a cheaper build for your project. The USB chip just moves from your project to the cable. If you want a reference circuit for an Arduino with a 6 pin header, you can use the RBBB (Really Bare Bones Board) Arduino circuit as a guide:http://cdn.shopify.com/s/files/1/0038/9582/files/RBBB_Instructions_06.pdf?1260749296

author: carbon dude oxide
author_rank: Frequent Contributor
timestamp: May 09, 2013, 07:05:29 am
content: Im guessing i cant use an arduino board and connect the 5v, ground, rx and tx to the corresponding pins on the stand alone to programs it or lead the bootloader?

author: blewisjr
author_rank: Frequent Contributor
timestamp: May 09, 2013, 11:11:54 am
content: In all honesty you don't need USB technically. Use can some jumper wires to set up ISP from the arduino to the chip. Then upload the Arduino ISP programmer sketch to your arduino you already have. Then if you setup ISP on your standalone board you can use the Arduino to burn your sketch hex files right to the flatpack bypassing the bootloader all together. This gives you the advantage of still being able to use the arduino libs and save some flash space where the bootloader was.Note you must keep in mind that the arduino messes up the pin layouts in their API's so you need to figure out which pin on the flatpack matches which pin on a standard arduino uno otherwise things will break with your code. Then again you could always set up headers to match the arduino pins if you wanted.Here is a link to a tutorial really easy to do.http://www.instructables.com/id/Turn-Your-Arduino-Into-an-ISP/#step1

author: Hideki
author_rank: Frequent Contributor
timestamp: May 09, 2013, 11:37:19 am
content: If you have a blank AVR, there's no program running that checks the serial lines, so you can't use them to program a blank chip.To initially get the bootloader in, you can do this:http://arduino.cc/en/Tutorial/ArduinoISPNote that it's also possible to get the bootloader in using this little "hack":http://playground.arduino.cc//Hacking/AvrdudeFTDIBitbangOnce that is done it's possible to use program it over serial. The most common way to get USB device support is the FT232R chip.http://www.ftdichip.com/Products/ICs/FT232R.htmThis is exactly what's inside an "FTDI" cable, so people use that for the convenience. Since you're doing you're own board you can include the chip and usb connector instead.Also get the terminology right. USB host means something that can host USB -- ie. you would be able to plug a mouse, keyboard or memory stick, etc. into the board.What you want is a USB _device_ that plugs into a USB host - typically a PC.For schematics, look athttp://arduino.cc/en/Main/arduinoBoardDuemilanove

author: carbon dude oxide
author_rank: Frequent Contributor
timestamp: May 09, 2013, 05:40:13 pm
content: QuoteI do like this idea, due to the arduino without the bootloader not bwing a dip package i will have to add some kind of header but it should work in the same principle.From what i cantell from this its uploading a program the the first arduino. The first arduino runs this program which loads the boot loader to the second arduino? Please correct me if i am wrong

author: blewisjr
author_rank: Frequent Contributor
timestamp: May 09, 2013, 05:51:47 pm
content: Actually it works a little differently than that. Essentially the first Arduino is acting more as a usb to serial converter. It reads the data bit by bit and passing the data over the ISP connections by manipulating the appropriate pins on the target chip which then burns the program into the target chip. Essentially the Arduino is being a hardware programmer like the USBtinyISP and AVRISPMKII. The sketch basically implements the STK500 protocol on the Arduino. After you get the chip programmed you can easily turn your Arduino back to other uses. It really will save you a lot of time and effort compared to trying to get USB setup on your target board for a bootloader.

author: carbon dude oxide
author_rank: Frequent Contributor
timestamp: May 09, 2013, 09:22:45 pm
content: Thank you very much i shall probably use that idea to do it then

author: jmole
author_rank: Regular Contributor
timestamp: May 10, 2013, 03:39:05 am
content: Quote from: Hideki on May 09, 2013, 11:37:19 amEchoing this comment. You want to use your Arduino as a USB DEVICE.Sorry to be redundant, but I had no idea why there was talk of ISPs and bootloaders in a thread about making a USB host.

author: blewisjr
author_rank: Frequent Contributor
timestamp: May 10, 2013, 01:05:28 pm
content: Quote from: jmole on May 10, 2013, 03:39:05 amThe OP was looking for a way to essentially get code on his standalone board. Originally he wanted to get a Arduino like usb interface on the board to use the bootloader. From what I read of course. So I suggested a easier way to do that without the bootloader by using his current arduino as an ISP which will save him both time and headaches. That is how ISP got into the thread I just mentioned and easier to implement alternative measure to accomplish his task of using the flatpack.

author: Stonent
author_rank: Super Contributor
timestamp: May 15, 2013, 05:27:52 am
content: Take a look at this video, the concept is the same, you're just using a bigger chip.