Sparkfun USB Host Shield working with oleg USB Host Shield 2.0

Hi,

[EDITED] The updated sparkfun product 9628, SparkFun USB-C Host Shield - DEV-21247 - SparkFun Electronics have FIXED this issue...

I've searched the forum and could not find any posting on this...

I've a Sparkfun USB Host Shield ( SparkFun USB-C Host Shield - DEV-21247 - SparkFun Electronics ) and got it working with the original USB Host Shield library ( https://github.com/felis/USBHostShield )

Have anyone got this USB Host Shield working with the latest USB Host Shield library V2 ( http://www.circuitsathome.com/mcu/usb-host-shield-library-version-2-0-released )

It seems the library uses a different method of configuring the pins.

The schematics from Sparkfun :
Sparkfun Schematic http://www.sparkfun.com/datasheets/DevTools/Arduino/USBHostShield-v13.pdf

RST - D7
GPX - D8
INT - D9
SS - D10
MOSI - D11
MISO - D12
SCK - D13

Circuit@Home is connected to the 2x3 ICSP pins
Circuit@Home Schematic http://www.circuitsathome.com/wp/wp-content/uploads/2011/02/UHS_20.pdf

MISO - 1
MOSI - 4
SCK - 3
RST - 5
GND - 6

SS - D10
INT - D9

Can someone guide me on how to change the version 2.0 library to point it back similar to the Sparkfun
schematic ?

The verison 2.0 seems to define the pins using avrpins.h that uses AVR low level pins settings.

What is the name for the ICSP pin name in AVR ?

Attached is the avrpins.h

Thanks

avrpins.h (13.5 KB)

The ICSP pins are connected to the hardware SPI pins of the Arduino processor. The reason to use the ICSP pins for MISO, MOSI and SCK instead of D11, D12 and D13 is that they work on an Arduino Mega as well as the regular Arduino (the Arduino Mega has the SPI pins connected to D50-D53). On the regular Arduino there is no difference between using D11-13 and the ICSP header.

It looks like the new library no longer uses an Arduino output to drive the RESET signal of the MAX3421E. It looks like the circuitsathome version uses the RESET signal from the Arduino to reset the MAX3421E,

It looks like the GPX output of the MAX3421E is no longer connected to an Arduino input.

Thanks for the clarifications. I only found out about the ICSP pins after looking at the UNO schematics.

I also compared both the USB Host schematics and found the same about the RESET you mentioned.

I jumpered a wire from D7 ( original RST on sparkfun ) to RST on the Arduino pin 1 and manage to get V2.0 library working and detected a USB device..

If it works, I will permanently solder a wire below the shield.

Will you write a quick tutorial when you're finished testing? Hardware and software changes?

Very simple tutorial...

Hardware changes, connect Digital pin 7 to RST pin ( the pin beside the 3.3V pin )

Software changes, NONE, just install the usb host shield ver 2.0

Then just run the example board_qc to test the SPI and detect some USB devices..

I connected it to a Nikon DSLR USB cable to do a remote trigger and got it working using the PTP libraries and examples..

Funny
Sparkfun schematic shows pin 7 already connected to the reset pin (of the arduino ? ) SparkFun USB-C Host Shield - DEV-21247 - SparkFun Electronics

johnwasser:
It looks like the new library no longer uses an Arduino output to drive the RESET signal of the MAX3421E. It looks like the circuitsathome version uses the RESET signal from the Arduino to reset the MAX3421E,

It looks like the GPX output of the MAX3421E is no longer connected to an Arduino input.

So shouldn't the arduino reset line or D7 (or maybe either) be connected to Pin 9 of the hex converter which is then connected to Pin 12 on the MAX3421E to reset it ?

I'm confused -when the circuit says D7 is connected to 'reset' do they mean on the shield bus line or the arduino reset line ?

tytower:
Funny
Sparkfun schematic shows pin 7 already connected to the reset pin (of the arduino ? ) SparkFun USB-C Host Shield - DEV-21247 - SparkFun Electronics

No, digital Pin7 is connected to the MAX3421E reset pin, NOT the Arduino reset (atmega328 pin 0)

To support board like Mega, MAX3421E reset it was routed to Arduino reset pin instead of Pin 7.

When running the Sparkfun board on USB Host Shield 2.0 library, it did not reset the MAX3421E at all..

The 2.0 library will pull the Arduino reset pin low to reset the MAX3421E IC but there was no connection to the MAX3421E reset pin on Sparkfun shield.

Yes thanks Stanley I think I see it now

The mega ADK does not work either with this version.
Is there a similar fix to make this board work with this lib?

johnwasser:
The ICSP pins are connected to the hardware SPI pins of the Arduino processor. The reason to use the ICSP pins for MISO, MOSI and SCK instead of D11, D12 and D13 is that they work on an Arduino Mega as well as the regular Arduino (the Arduino Mega has the SPI pins connected to D50-D53). On the regular Arduino there is no difference between using D11-13 and the ICSP header.

It looks like the new library no longer uses an Arduino output to drive the RESET signal of the MAX3421E. It looks like the circuitsathome version uses the RESET signal from the Arduino to reset the MAX3421E,

It looks like the GPX output of the MAX3421E is no longer connected to an Arduino input.

So I wired from D7 to reset pin also and it seems to now accept and run the code
Does the GPX output of the MAX3421E need to be connected to an arduino input for anything in the library?

@bob 1810 I don't know the mega ADK but the shield needs the reset pin of the arduino connected into the reset bus of the shield

Connecting D7 (PWM 7?) to reset does not help;same result.
I would advice anyone NOT to buy this Mega ADK board if you want to use version 2
of the USB host libs,
it simply does NOT work !

I believe Tytower's idea and the instructions above apply specifically to the Sparkfun USB Shield.

johnwasser:
It looks like the new library no longer uses an Arduino output to drive the RESET signal of the MAX3421E. It looks like the circuitsathome version uses the RESET signal from the Arduino to reset the MAX3421E,
It looks like the GPX output of the MAX3421E is no longer connected to an Arduino input.

I find on my Sparkfun board that GPX output of the MAX3421E is connected to D8 Olegs board shows it left disconnected I think .
I have a Duemielanove board and noticed-In max3421e.h he defines pins for the Duemielanove so I have un-commented those does not seem to make a difference that I have seen yet
/
/
MAX3421E register/bit names and bitmasks /
#ifndef max3421e_h
#define max3421e_h
/
Arduino pin definitions /
/
pin numbers to port numbers */
//#define MAX_INT 9 // Duemielanove
//#define MAX_GPX 8

I made this mod and now I can't use pin 7 - it stays high all the time. I have another project where pin 7 is used - do I have to buy another Arduino board for it?

The mod should not fry the D7 pin.. it is just pulling the D7 LOW via the RST pin..

I did this modification as I did not want to cut the connection on the Sparkfun board to D7 and solder it directly to the Arduino RST pin.. ( bypassing D7 )..

I would assume you do NOT have anything else connected to D7 to have this working...

No, I don't have anything connected to D7 - I have Atmega chip replaced and now D7 is working. I'm not going to connect it to ground again though.

hi Stanley.

I am quite a beginner. I just got the Uno and the Usb host shield from sparkfun,, any chance you can upload a pic or tell me what do i need to connect from the uno to the usb shield?.. an image would help a lot. By the way. I am tryin to get it to work with the Host shield library 2.0 too. Thanks and really hope someone can help me, I seem to get no support from sparkfun or oleg but well .. thanks

by the way.. maybe its a dumb question but.. where are you checkin out the error messages? do you have a display or can I view this messages in arduino software? when I say messages I refer to the data the usb shield displays for the usb device you connect.. thanks again

kind regards
xto

I will try to make it as easy as possible , so hope u understand my simple instructions..

I would assume you know how to operate the Arduino IDE s/w and know how to upload the arduino sketches into the Uno..

If you do not know these knowledge, I suggest you google or read up some documentations on arduino.cc first..

Here are the simple steps :-

  1. Download the host shield 2.0 library, unzip and install into Arduino

  2. Goto Menu : Files -> Examples -> USB_Host_ShieldV2 and select board_qc

  3. Compile and upload the sketches into Arduino UNO

  4. Plug Usb host shield on top of Uno AND take a jumper wire to connect Digital Pin 7 to RESET pin across the Uno board beside 3.3V pin

  5. Click on the Serial Monitor button and set speed to 115200

  6. You should see something like below

  7. Insert a USB device and let it detect it automatically..

  8. If it passed, you have got the USB host shield v2.0 working...

Circuits At Home 2011
USB Host Shield Quality Control Routine
Reading REVISION register... Die revision 03
SPI long test. Transfers 1MB of data. Each dot is 64K..
Circuits At Home 2011
USB Host Shield Quality Control Routine
Reading REVISION register... Die revision 03
SPI long test. Transfers 1MB of data. Each dot is 64K................ SPI long test passed
GPIO test. Connect GPIN0 to GPOUT7, GPIN1 to GPOUT6, and so on
Test failed. Value written: 00 Value read: FF 
Press any key to continue...
GPIO test passed.
PLL test. 100 chip resets will be performed
Resetting oscillator

Reset complete. Waiting for the first SOF...
Getting device descriptor
Descriptor Length:	12
Descriptor type:	01
USB version:		0200
Device class:		00
Device Subclass:	00
Device Protocol:	00
Max.packet size:	08
Vendor  ID:		0403
Product ID:		6001
Revision ID:		0600
Mfg.string index:	01
Prod.string index:	02
Serial number index:	03
Number of conf.:	01

Hi Stanley thanks for the detailed instructions.

I followed them but still I got some doubts before connecting.

Should I have an external power source other than the usb cable?
(and once the usb host shield board is on top of the arduino) with a jumper I connected the pin with Reset and the pin with a 7 (of the sparkfun shield as it is on the top) . this the part im not understanding the connection...

should I leave something disconnected or should i connect all pins to the arduino with the two (6 wire connector set) and the two (8 wire connector set) ? thanks again for the help. i just wanna be sure i got it right.

i attach an image maybe its easier .(there i show how i connected it)

kind regards
xto