henla464 / USB_Host_Shield_Library_2.0

Forked "USB Host Shield Library 2.0" with CP210x driver
15 stars 2 forks source link

Library for MediaTek UART/USB Driver #4

Open leocrg opened 3 years ago

leocrg commented 3 years ago

Hi! First of all, I would like to congratulate and thank you for your help in developing the CP21x driver library for the Arduino. It was an impeccable job that inspired me to develop a similar library for Mediatek's UART/USB converter chipset (VID: 0E8D & PID: 0023).

I'm Trying to use a GPS Tracker with mediatek chipset to comunicate with the USB Host Shield 2.0 and Arduino MEGA.

When I used the example "hub_demo.ino" I received this respose from the USB:

01
--
String Descriptors:
Manufacturer:       MediaTek Inc
Product:        Product

Device descriptor: 
Descriptor Length:  12
Descriptor type:    01
USB version:        0200
Device class:       EF
Device Subclass:    02
Device Protocol:    01
Max.packet size:    08
Vendor  ID:     0E8D
Product ID:     0023
Revision ID:        0100
Mfg.string index:   05
Prod.string index:  06
Serial number index:    00
Number of conf.:    01

Configuration descriptor:
Total length:       008D
Num.intf:       04
Conf.value:     01
Conf.string:        00
Attr.:          80
Max.pwr:        FA
Unknown descriptor:
Length:     08
Type:       0B
Contents:   00020A0000010904

Interface descriptor:
Intf.number:        00
Alt.:           00
Endpoints:      02
Intf. Class:        0A
Intf. Subclass:     00
Intf. Protocol:     00
Intf.string:        01

Endpoint descriptor:
Endpoint address:   81
Attr.:          02
Max.pkt size:       0040
Polling interval:   00

Endpoint descriptor:
Endpoint address:   01
Attr.:          02
Max.pkt size:       0040
Polling interval:   00

Interface descriptor:
Intf.number:        01
Alt.:           00
Endpoints:      01
Intf. Class:        02
Intf. Subclass:     02
Intf. Protocol:     01
Intf.string:        02
Unknown descriptor:
Length:     05
Type:       24
Contents:   0010010424
Unknown descriptor:
Length:     04
Type:       24
Contents:   020F0524
Unknown descriptor:
Length:     05
Type:       24
Contents:   0601000524
Unknown descriptor:
Length:     05
Type:       24
Contents:   0103000705

Endpoint descriptor:
Endpoint address:   84
Attr.:          03
Max.pkt size:       0010
Polling interval:   03
Unknown descriptor:
Length:     08
Type:       0B
Contents:   02020A0000030904

Interface descriptor:
Intf.number:        02
Alt.:           00
Endpoints:      02
Intf. Class:        0A
Intf. Subclass:     00
Intf. Protocol:     00
Intf.string:        03

Endpoint descriptor:
Endpoint address:   82
Attr.:          02
Max.pkt size:       0040
Polling interval:   00

Endpoint descriptor:
Endpoint address:   02
Attr.:          02
Max.pkt size:       0040
Polling interval:   00

Interface descriptor:
Intf.number:        03
Alt.:           00
Endpoints:      01
Intf. Class:        02
Intf. Subclass:     02
Intf. Protocol:     01
Intf.string:        04
Unknown descriptor:
Length:     05
Type:       24
Contents:   0010010424
Unknown descriptor:
Length:     04
Type:       24
Contents:   020F0524
Unknown descriptor:
Length:     05
Type:       24
Contents:   0603020524
Unknown descriptor:
Length:     05
Type:       24
Contents:   0103020705

Endpoint descriptor:
Endpoint address:   83
Attr.:          03
Max.pkt size:       0010
Polling interval:   03

Addr:1(0.0.1)

I wonder if you could help me develop this library and make it available on this git. I don't know what I need to know about these drivers and how to get them. Whatever you can do to help me, I would appreciate it very much!

thaanstad commented 3 years ago

Do you have a part number and link to the datasheet for MediaTek's UART/USB converter? Is this an IC similar to the FT232RL and CP210x?

leocrg commented 3 years ago

My gps module ST210U is a "black box" and I don't have a good documentation, but I found the module linkit ON (https://seeeddoc.github.io/LinkIt_ONE/#Installing_Mediatek_LinkIt_ONE_SDK) that communicate with the same mediatek driver for PC. When I opened the schematic on EAGLE (https://docs.labs.mediatek.com/resource/linkit-one/en/documentation), I saw that the usb interface is connected in MT2502A IC (https://datasheetspdf.com/pdf-file/947458/MediaTek/MT2502A/1).

thaanstad commented 3 years ago

henla464,

I downloaded and reviewed ftd2xx.h from ftdi's windows VCP driver and I didn't understand how the configuration registers match up with the info in cdcftdi.h of this library. I was under the impression leocrg could use the info in the header file of the driver library for his device to create the appropriate header file and cpp file for his device. Can you point us in the right direction? What method did you use to find the appropriate registers that allow communication with cp210x?