Welcome, Guest

Author Topic: USB Host on Duinomite Mega  (Read 2422 times)

Mr Hammond

  • Newbie
  • *
  • Posts: 6
  • Karma: +1/-0
USB Host on Duinomite Mega
« on: December 09, 2016, 03:09:59 PM »
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

  • Hero Member
  • *****
  • Posts: 1674
  • Karma: +33/-45
Re: USB Host on Duinomite Mega
« Reply #1 on: December 09, 2016, 06:15:35 PM »
What software are you using and does it support host mode?  Have you configured it to do it?

John

Mr Hammond

  • Newbie
  • *
  • Posts: 6
  • Karma: +1/-0
Re: USB Host on Duinomite Mega
« Reply #2 on: December 09, 2016, 07:17:42 PM »
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

  • Hero Member
  • *****
  • Posts: 1674
  • Karma: +33/-45
Re: USB Host on Duinomite Mega
« Reply #3 on: December 09, 2016, 08:45:25 PM »
V1.5 of what?

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

John

Mr Hammond

  • Newbie
  • *
  • Posts: 6
  • Karma: +1/-0
Re: USB Host on Duinomite Mega
« Reply #4 on: December 09, 2016, 11:54:46 PM »
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

  • Full Member
  • ***
  • Posts: 173
  • Karma: +2/-0
Re: USB Host on Duinomite Mega
« Reply #5 on: December 10, 2016, 04:13:37 PM »
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

  • Newbie
  • *
  • Posts: 6
  • Karma: +1/-0
Re: USB Host on Duinomite Mega
« Reply #6 on: December 10, 2016, 05:06:02 PM »
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.