Loading [MathJax]/extensions/Safe.js

Author Topic: Making a usb host for arduino  (Read 6849 times)

0 Members and 1 Guest are viewing this topic.

Offline carbon dude oxideTopic starter

  • Frequent Contributor
  • **
  • Posts: 429
  • Country: gb
Making a usb host for arduino
« on: May 08, 2013, 09:58:00 am »
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 usb :)

What 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)
-----
Everything Should Be Made as Simple as Possible, But Not Simpler
-----
 

Offline amspire

  • Super Contributor
  • ***
  • Posts: 3802
  • Country: au
Re: Making a usb host for arduino
« Reply #1 on: May 08, 2013, 10:24:01 am »
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 usb :)

What 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 as well 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)
You 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/9718

Achieves 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
« Last Edit: May 08, 2013, 10:26:04 am by amspire »
 

Offline carbon dude oxideTopic starter

  • Frequent Contributor
  • **
  • Posts: 429
  • Country: gb
Re: Making a usb host for arduino
« Reply #2 on: May 09, 2013, 07:05:29 am »
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?
-----
Everything Should Be Made as Simple as Possible, But Not Simpler
-----
 

Offline blewisjr

  • Frequent Contributor
  • **
  • Posts: 301
Re: Making a usb host for arduino
« Reply #3 on: May 09, 2013, 11:11:54 am »
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
« Last Edit: May 09, 2013, 11:20:48 am by blewisjr »
 

Offline Hideki

  • Frequent Contributor
  • **
  • Posts: 256
  • Country: no
Re: Making a usb host for arduino
« Reply #4 on: May 09, 2013, 11:37:19 am »
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/ArduinoISP
Note that it's also possible to get the bootloader in using this little "hack": http://playground.arduino.cc//Hacking/AvrdudeFTDIBitbang

Once 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.htm
This 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 at http://arduino.cc/en/Main/arduinoBoardDuemilanove
 

Offline carbon dude oxideTopic starter

  • Frequent Contributor
  • **
  • Posts: 429
  • Country: gb
Re: Making a usb host for arduino
« Reply #5 on: May 09, 2013, 05:40:13 pm »
Quote
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/ArduinoISP

I 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 :)
-----
Everything Should Be Made as Simple as Possible, But Not Simpler
-----
 

Offline blewisjr

  • Frequent Contributor
  • **
  • Posts: 301
Re: Making a usb host for arduino
« Reply #6 on: May 09, 2013, 05:51:47 pm »
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.
 

Offline carbon dude oxideTopic starter

  • Frequent Contributor
  • **
  • Posts: 429
  • Country: gb
Re: Making a usb host for arduino
« Reply #7 on: May 09, 2013, 09:22:45 pm »
Thank you very much i shall probably use that idea to do it then :)
-----
Everything Should Be Made as Simple as Possible, But Not Simpler
-----
 

Offline jmole

  • Regular Contributor
  • *
  • Posts: 211
  • Country: us
    • My Portfolio
Re: Making a usb host for arduino
« Reply #8 on: May 10, 2013, 03:39:05 am »
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.

Echoing 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.
 

Offline blewisjr

  • Frequent Contributor
  • **
  • Posts: 301
Re: Making a usb host for arduino
« Reply #9 on: May 10, 2013, 01:05:28 pm »
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.

Echoing 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.

The 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.
 

Offline Stonent

  • Super Contributor
  • ***
  • Posts: 3824
  • Country: us
Re: Making a usb host for arduino
« Reply #10 on: May 15, 2013, 05:27:52 am »
Take a look at this video, the concept is the same, you're just using a bigger chip.


« Last Edit: May 15, 2013, 05:32:21 am by Stonent »
The larger the government, the smaller the citizen.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf