Pages: 1 [2] 3 4 ... 6   Go Down
Author Topic: USB Host controller  (Read 12286 times)
0 Members and 1 Guest are viewing this topic.
Louisville, CO
Offline Offline
Full Member
***
Karma: 2
Posts: 174
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I finished porting USB transfers. There is a new code in the repository and an article http://www.circuitsathome.com/mcu/programming/arduino-usb-host-part-3-descriptors

It took a while but I'm getting there:-). Next one will be describing talking to USB keyboard. Also, I started studying Nikon SDK to see how they implement camera control - doesn't seem too difficult.

Logged

/felis

Louisville, CO
Offline Offline
Full Member
***
Karma: 2
Posts: 174
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Not quite software related, but still - I recently routed a shield for MAX3421E and just received first prototype of a PCB from a boardhouse. Take a look -> http://www.circuitsathome.com/mcu/usb-host-shield-for-arduino-first-prototype
Logged

/felis

Louisville, CO
Offline Offline
Full Member
***
Karma: 2
Posts: 174
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Limping along, slowly but surely :-). I posted an example, demonstrating how to poll USB keyboard, take a look -> http://www.circuitsathome.com/mcu/programming/arduino-usb-host-part-4-peripherals  I'm now cobbling together a "LCD via GPIO" code so that I can actually see what I'm typing.
Logged

/felis

North Yorkshire, UK
Offline Offline
Faraday Member
**
Karma: 104
Posts: 5531
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Cool... I have been using the PS2 library currently but I have a mini USB keboard that I would like to use...

What capabilities does the shield have? Can it in theory read text from USB flash drives like the microSD card shield can do?

Mowcius
Logged

Louisville, CO
Offline Offline
Full Member
***
Karma: 2
Posts: 174
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

This is standard USB host. It supports all USB 2.0 transfers, even isochronous (if device is slow enough). So in theory, working with anything that talks USB is possible - flash drives, webcams, audio, printers, etc.; limiting factor would be Arduino's program memory size.

The shield also have 16 general purpose lines - 8 inputs and 8 outputs, where inputs can also be programmed as interrupt lines. Can be used to control LCD, buttons, and such.
Logged

/felis

North Yorkshire, UK
Offline Offline
Faraday Member
**
Karma: 104
Posts: 5531
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
This is standard USB host. It supports all USB 2.0 transfers, even isochronous (if device is slow enough). So in theory, working with anything that talks USB is possible - flash drives, webcams, audio, printers, etc.; limiting factor would be Arduino's program memory size.

Ok, even cooler... I presume that from your experience, it is easier to use old devices that don't require so much coding, such as old printers etc. I think that the limiting factor with this would be my coding experience before a lack of program memory. smiley-grin

 I shouldn't have thought I would run out of space as I am just thinking of coding for a mini USB keyboard and a 'simple' USB mini printer...

From reading the pages you have written about it and the examples you have done, I presume that the arduino could be programmed to run different code depending on what device is plugged in...

Quote
The shield also have 16 general purpose lines - 8 inputs and 8 outputs, where inputs can also be programmed as interrupt lines. Can be used to control LCD, buttons, and such.


On this image, are the 16 lines the ones on the left?
Also, from the looks of it, the shield is not stackable/it has to be on the top, correct?

What configuration options are there regarding pin use?
If I have missed a page that tells me that then please just point me to it...

Mowcius
Logged

Louisville, CO
Offline Offline
Full Member
***
Karma: 2
Posts: 174
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Ok, even cooler... I presume that from your experience, it is easier to use old devices that don't require so much coding, such as old printers etc.

Keyboard and mouse are the easiest. They support so-called "Boot protocol" intended for use in PCs before OS loading - such as POST, BIOS config and such. In this protocol, keyboard data format is fixed - the fact that you don't need to parse report descriptor simplifies code significantly.

Quote
From reading the pages you have written about it and the examples you have done, I presume that the arduino could be programmed to run different code depending on what device is plugged in...

Current code supports single device on the bus; switching devices on the fly is possible. At present, multiple devices on the bus are supported in data structures of the USB library only; in the future, I may add code to support multiple devices or throw it away altogether to save space depending on how people would like to use the thing. The limitation is, again, Arduino resources - the keyboard polling sketch I mentioned earlier in the thread compiles into ~6500 bytes binary; this does not look like much, but, again, keyboard is the simplest of all USB devices.

Quote
On this image, are the 16 lines the ones on the left?

This is correct. Inputs are on the top, outputs on the bottom. To support 5V levels GPIO lines are also equipped with level translators (74AHC245 and 74HCT245 ), which can be mounted in the spaces provided.

Quote
Also, from the looks of it, the shield is not stackable/it has to be on the top, correct?

This is correct.

Quote
What configuration options are there regarding pin use?

There is an article about this -> http://www.circuitsathome.com/mcu/arduino-usb-host-shield-build-log-part-4

3 SPI signals are hardwired, 4 control signals have jumpers and can be re-routed.


If you have more questions, please ask.
Logged

/felis

North Yorkshire, UK
Offline Offline
Faraday Member
**
Karma: 104
Posts: 5531
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Keyboard and mouse are the easiest. They support so-called "Boot protocol" intended for use in PCs before OS loading - such as POST, BIOS config and such. In this protocol, keyboard data format is fixed - the fact that you don't need to parse report descriptor simplifies code significantly.

Ok, how's your project going with the LCD display showing what you type?

Quote
Current code supports single device on the bus; switching devices on the fly is possible. At present, multiple devices on the bus are supported in data structures of the USB library only; in the future, I may add code to support multiple devices or throw it away altogether to save space depending on how people would like to use the thing. The limitation is, again, Arduino resources - the keyboard polling sketch I mentioned earlier in the thread compiles into ~6500 bytes binary; this does not look like much, but, again, keyboard is the simplest of all USB devices.

That's about what I thought. Presumably a small amount of that is standard 'USB' code. I'm sure I will manage to fit the code on for the mini USB label printer I have... If not then I will just buy an arduino mega or use a serial label printer instead...

Quote
This is correct. Inputs are on the top, outputs on the bottom. To support 5V levels GPIO lines are also equipped with level translators (74AHC245 and 74HCT245 ), which can be mounted in the spaces provided.

Ok, I will mount it on the top of my stack then...


Quote
There is an article about this -> http://www.circuitsathome.com/mcu/arduino-usb-host-shield-build-log-part-4

3 SPI signals are hardwired, 4 control signals have jumpers and can be re-routed.
Ok...
Logged

Louisville, CO
Offline Offline
Full Member
***
Karma: 2
Posts: 174
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote

Ok, how's your project going with the LCD display showing what you type?

I'm playing with idea to reuse official LCD library code or at least function names/behaviour; the biggest problem is that I don't need any flexibility during initialization since I only have 8 lines out, which is just enough for 4-bit LCD mode.
Logged

/felis

North Yorkshire, UK
Offline Offline
Faraday Member
**
Karma: 104
Posts: 5531
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I think that I would use a serial LCD display and maybe break out a pin below the USB shield to control it.

Out of interest, any reason why you did not make the shield stackable?

Mowcius
« Last Edit: September 29, 2009, 05:44:10 am by mowcius » Logged

Louisville, CO
Offline Offline
Full Member
***
Karma: 2
Posts: 174
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Out of interest, any reason why you did not make the shield stackable?

I can make it - just request stackable headers when buying.
Logged

/felis

North Yorkshire, UK
Offline Offline
Faraday Member
**
Karma: 104
Posts: 5531
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Oh yes, of course it can be stacked doing that... I hadn't thought if that to be honest!

Is there any way that you can stack 2 together? You said that some of the pins are hardwired, I presume that means, only one USB host shield per arduino stack...

Can you use a 4 port hub for example, to control two keyboards for a simple multiplayer game? Any idea of how the hubs work coding wise? Could the chip support it?

Thanks,

Mowcius
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 180
Arduino does the job
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Have you looked at the ShiftReg LCD lib?  Would free up some pins for you:

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1243195750

Logged

Louisville, CO
Offline Offline
Full Member
***
Karma: 2
Posts: 174
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Is there any way that you can stack 2 together? You said that some of the pins are hardwired, I presume that means, only one USB host shield per arduino stack...

It is possible to run two. The code needs to be modified and running 2 instances of it would be hard on memory. Using a hub would be better solution.
Logged

/felis

Louisville, CO
Offline Offline
Full Member
***
Karma: 2
Posts: 174
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Here is the next step - USB keyboard control with character output and LED control. Enjoy!

http://www.circuitsathome.com/mcu/programming/how-to-drive-usb-keyboard-from-arduino
Logged

/felis

Pages: 1 [2] 3 4 ... 6   Go Up
Jump to: