• AVR Freaks

Helpful ReplyHot!PIC16F with MAX3421E or MAX3420E

Author
ric
Super Member
  • Total Posts : 24600
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: online
2019/07/12 05:26:58 (permalink)
5 (1)

PIC16F with MAX3421E or MAX3420E

Edit: The requirement has now changed. See post#7 for the new one. :)
https://www.microchip.com/forums/m1104910.aspx#1115012
 
 
Has anyone here done any work with the MAXIM USB Peripheral/host controllers (MAX342x) ?
The MAX3421E is controlled via SPI, and can act as either a USB2 host or device. They've been around for years, and you can now get very cheap boards on eBay with one already mounted.
A work colleague asked if there was an easy way to sniff the data flowing from an HID controller to a USB host, and I think it could be done fairly simply using a pair of these MAXIM chips, one acting as a host and the other as a device.
I could then implement a "man in the middle" to accept data from the controller (with one interface acting as "host"), and pretend to be that same device, passing the data through the second controller acting as a device.
There's an app note on the Maxim website showing how to act as an HID device using the MAX3420 chip. That is an older device which can only act as a peripheral. The MAX3421 emulates a MAX3420 when in device mode, so the code should be perfectly usable, it just needs a little massaging to compile with XC8 and control a PIC SPI port.
I haven't yet found the equivalent code to act as a host, and I'm hoping not to have to reinvent too many wheels.
 
So, I'm looking for anyone else who may have already gone down the same road. :)
 
 
post edited by ric - 2019/10/15 03:07:46

I also post at: PicForum
Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
NEW USERS: Posting images, links and code - workaround for restrictions.
To get a useful answer, always state which PIC you are using!
#1
ric
Super Member
  • Total Posts : 24600
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: online
Re: PIC16F with MAX3421E or MAX3420E 2019/07/17 15:54:32 (permalink) ☄ Helpfulby mlp 2019/07/18 07:48:04
+1 (1)
No-one?
I've ordered a couple of these cheapie boards from eBay:
https://www.ebay.com.au/i...d=p2057872.m2749.l2649

and I'm planning to make a prototype board with two of them and a PIC16F1459. That would potentially let me use either the PIC's embedded USB device interface OR one of the modules to act as the device, and the second module as the host.
This is just an experiment, but I think it should be fun. :)

I also post at: PicForum
Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
NEW USERS: Posting images, links and code - workaround for restrictions.
To get a useful answer, always state which PIC you are using!
#2
Jim Nickerson
User 452
  • Total Posts : 6371
  • Reward points : 0
  • Joined: 2003/11/07 12:35:10
  • Location: San Diego, CA
  • Status: online
Re: PIC16F with MAX3421E or MAX3420E 2019/07/18 07:47:21 (permalink)
0
I am guessing you/ your colleague want to do more than just sniff to watch the exchange.
#3
mlp
boots too small
  • Total Posts : 825
  • Reward points : 0
  • Joined: 2012/09/10 15:12:07
  • Location: previously Microchip XC8 team
  • Status: offline
Re: PIC16F with MAX3421E or MAX3420E 2019/07/18 07:56:36 (permalink)
0
ric
No-one?
I've ordered a couple of these cheapie boards from eBay:

Nifty.
I found multiple vendors selling what looks from the photos to be exactly the same board, and helpfully(not!) none of them mention the Maxim chip.
 
[gah, firewall; OK, no link]
eBay keywords: Mini-USB-Host-Shield-2-0-ADK-Module-SPI-Interface-Expansion-Board-For-Arduino
 

Mark (this opinion available for hire)
#4
ric
Super Member
  • Total Posts : 24600
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: online
Re: PIC16F with MAX3421E or MAX3420E 2019/07/18 08:03:28 (permalink)
0
JANickerson
I am guessing you/ your colleague want to do more than just sniff to watch the exchange.

He's actually building a full size car dashboard to connect into a driving game on an XBOX, and wants to monitor the throttle, brake etc. inputs.
Apparently they are all potentiometers going into a black box that then connects to the XBOX via USB, so plan B is just to use several ADC channels to measure them directly.

I also post at: PicForum
Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
NEW USERS: Posting images, links and code - workaround for restrictions.
To get a useful answer, always state which PIC you are using!
#5
ric
Super Member
  • Total Posts : 24600
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: online
Re: PIC16F with MAX3421E or MAX3420E 2019/07/18 08:10:24 (permalink)
0
I think it's a Chinese copy of an original board.
The differences are discussed at https://www.arduino.cn/thread-81435-1-1.html
You can see a schematic of the original board at https://github.com/Linux-...sheets/UHS_mini_10.pdf
 
 

I also post at: PicForum
Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
NEW USERS: Posting images, links and code - workaround for restrictions.
To get a useful answer, always state which PIC you are using!
#6
ric
Super Member
  • Total Posts : 24600
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: online
Re: PIC16F with MAX3421E or MAX3420E 2019/10/10 16:41:06 (permalink)
0
Turns out the XBOX project didn't need this, but I now have another idea for the MAX3421E.
 
I would like to add a cheap printer output to some PIC16F based devices. Thermal POS printers are very cheap on eBay, but only with a USB interface.
I've looked inside, and can't find an easy point to bypass the USB input and access a serial interface inside the unit, so the next best option is to use a MAX3421E in host mode to talk to it. I'm confident it's just using bulk transfers to send ASCII strings to the printer (using ESC/POS for formatting), so no fonts or graphic commands required.
 
Step one, to prove the concept, will be to make up a little test board with a PIC16 (probably a PIC16F1829), a direct connection to a cheap USB/Serial module (for power, control and debug output), and one of these mini USB host shield boards, and see if I can enumerate the printer.
 
Anyone been down this path before?
 

I also post at: PicForum
Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
NEW USERS: Posting images, links and code - workaround for restrictions.
To get a useful answer, always state which PIC you are using!
#7
acharnley
Super Member
  • Total Posts : 404
  • Reward points : 0
  • Joined: 2016/05/01 06:51:28
  • Location: 0
  • Status: offline
Re: PIC16F with MAX3421E or MAX3420E 2019/10/14 15:34:45 (permalink)
0
I'm in the same boat but so far I'm using a PIC16 interfaced to a PIC32MM. It seems the cost effective way to do it since MAX3421E are 4x the price.
#8
Antipodean
Super Member
  • Total Posts : 1778
  • Reward points : 0
  • Joined: 2008/12/09 10:19:08
  • Location: Didcot, United Kingdom
  • Status: online
Re: PIC16F with MAX3421E or MAX3420E 2019/10/15 02:38:35 (permalink)
+1 (1)
Isn't the PIC32MM one of the chips with a dual USB on it? Should be possible to do that in a single chip that way.
 

Do not use my alias in your message body when replying, your message will disappear ...

Alan
#9
ric
Super Member
  • Total Posts : 24600
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: online
Re: PIC16F with MAX3421E or MAX3420E 2019/10/15 02:46:20 (permalink)
+1 (1)
I'm interested in the PIC32MM if it's much cheaper than the MAX3421E
(and easier to hand solder in the SOIC package).
I only need one USB (host) port for my POS printer project, will just use TTL serial to communicate with it.
I actually think a 32 pin PIC32MM pre-programmed to act as a serial-USB bridge to a POS printer would be a pretty useful standalone product.
The argument against is I have never done a PIC32 project, and don't know if I want to learn MCC with something as complex as this...
The MLA solution is looking more promising anyway.
 
 
post edited by ric - 2019/10/15 02:48:08

I also post at: PicForum
Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
NEW USERS: Posting images, links and code - workaround for restrictions.
To get a useful answer, always state which PIC you are using!
#10
Jump to:
© 2019 APG vNext Commercial Version 4.5