November 09, 2024, 02:49:25 AM

USB Host on Duinomite Mega

Started by Mr Hammond, December 09, 2016, 03:09:59 PM

Previous topic - Next topic

Mr Hammond

Hi,
I cannot get the USB OTG to work in host mode.  Do I need to give a configuration or setup command to get it in that mode versus Client?
Thanks

JohnS

What software are you using and does it support host mode?  Have you configured it to do it?

John

Mr Hammond

Hi JohnS,
I have V1.5
I have not configured it.  I cannot find anywhere in the manual or elsewhere how to configure or option it for host mode.  Other than plugging in a client device, what do I need to type in?
Thanks for your help

JohnS

V1.5 of what?

I understand the hardware supports what you want but likely the software does not.

John

Mr Hammond

OK Let me give full details:
I have an Duinomite mega.  When I power up it says DM Basic, build data DEC 20,2012(I think this is the latest)
When I type Setup, it says Duinomite Setup Menu - V1.5 Dec 20,2012.  It shows USB enabled

If I connect the USB port to a Computer Host port, using hyperterminal, the computer acts like a console and everything works fine.  I can write and run programs - so the USB port on the duinomite is working as a Client
If I then disconnect the computer, plug in a VGA monitor and PS2 keyboard and external power supply, this also works fine.
In that last configuration, if I plug in a USB peripheral (like a keyboard) into the USB OTG connector on the Duinomite, I can scope the power pins and see that the duinomite is not providing power which it should if it was in Host Mode.
The manual says this is supported in the Mega Version

So, my question is do I need to somehow tell the duinomite that I want it to be in Host mode with a setup or config command?

KeesZagers

Hello mr. Hammond,
Your Duinomite is running DMBasic 2.7. Setup is only a Basic command to configure some parameters and cannot be used to configure the USB. In DMBasic the USB can only work in client mode. If you want to use the USB in host mode you need to flash a different firmware. I don't know of any standard firmware of the Duinomite which supports both modes. So yes Duinomite hardware supports both modes, however probably you have to write your own C program to support it.

Mr Hammond

Thanks KeesZagers,
Good to know.  I can see from the schematic that VBUSON controls providing power to the USB.  I will experiment with using assembly language (poke, peek), to control this.  I will post if I make any progress.
Thanks for all the help.