Giter VIP home page Giter VIP logo

Comments (92)

xxxajk avatar xxxajk commented on July 16, 2024

first important part from the example:
https://github.com/felis/UHS30/blob/master/libraries/UHS_FS/examples/USB_HOST_SHIELD/UHS_FS_NEW_DEMO/UHS_FS_NEW_DEMO.ino#L1

In other words you need to know the label on the target volume. No label defaults to "/", AKA root part of the filesystem tree.

UHS30's filesystem automatically will mount upon initial detection, and there is a way to know when that event happens. See here: https://github.com/felis/UHS30/blob/master/libraries/UHS_FS/examples/USB_HOST_SHIELD/UHS_FS_NEW_DEMO/UHS_FS_NEW_DEMO.ino#L273

After that point, you are free to read/write as needed. Just do not forget to close all files, and sync the filesystem when all writes are done. You do not need to unmount it, that happens automatically as well once you remove or power down the target storage.

from uhs30.

shadeyinka avatar shadeyinka commented on July 16, 2024

Thanks a lot.
My problem wit UHS30 had been that code execution does not go beyond
while(KINETIS_Usb.Init(1000) != 0);
the Aduino ADK just sits hear endlessly. Is there something i am doing wrong.
I use Arduino 1.6.8, Arduino AVR Board manager 1.6.11, Mega ADK Arduino, Windows 7.
Thanks a lot

from uhs30.

xxxajk avatar xxxajk commented on July 16, 2024

Sounds to me like a pin conflict, or I don't have something right for supporting the particular board.
I don't own one of these boards, so I can only make a guess that it is indeed a conflict.
If the SDcard library uses SPI, this indeed could be the case, especially if it does not use transactions.
Can you tell me which SDcard library you are using?

from uhs30.

shadeyinka avatar shadeyinka commented on July 16, 2024

For now, the problem is with the UHS30 example files. Even without the SD card shield, the code hangs when executing the line

while(KINETIS_Usb.Init(1000) != 0);

UHS20 example testusbHostFAT.into works on my board. I don't know why UHS30 examples will not work.

Could it be the cs_pin for the max3421 chip? On my board, max3421 seems to be on pin 10, the SD card shield is on pin 8

from uhs30.

xxxajk avatar xxxajk commented on July 16, 2024

Ok, that is fine, what are the MISO/MOSI/CLK line pin numbers?

from uhs30.

shadeyinka avatar shadeyinka commented on July 16, 2024

It uses the standard ICSP pins on Arduino mega

from uhs30.

xxxajk avatar xxxajk commented on July 16, 2024

Ok, did you connect 9 to pin 3 with a jumper wire?
https://github.com/felis/UHS30#avr-arduino

from uhs30.

shadeyinka avatar shadeyinka commented on July 16, 2024

I did. Nothing happened

from uhs30.

xxxajk avatar xxxajk commented on July 16, 2024

Do you know where the INT pin from the MAX3421E is routed?
Connect that to pin 3, and it should wake up and work.
UHS30 uses interrupts and does all the work in the background, which means no polling...

from uhs30.

shadeyinka avatar shadeyinka commented on July 16, 2024

I don't know where the INT pin of max3421 is, however, I will find out and do what you suggested.

I also noticed that the UHS20 with the examples from your github page didn't work either. I found one (probably modified) that ended up working. I will upload it to you in a few minutes. The difference might show something

from uhs30.

xxxajk avatar xxxajk commented on July 16, 2024

Try the following:
Connect pin 54 to pin 3
then... specify the SS/INT pins like so...
MAX3421E_HOST MAX3421E(53, 3); // SS on pin 53, IRQ on pin 3

from uhs30.

xxxajk avatar xxxajk commented on July 16, 2024

...if that works, I'll place this fix in the library

from uhs30.

shadeyinka avatar shadeyinka commented on July 16, 2024

I will check it out and give you a feedback if it works. Meanwhile, the link to the UHS2 that worked on my board is presented here:

https://github.com/Microduino/Microduino_Tutorials/tree/master/Microduino_Libraries/_06_Microduino_USBHOST_MAX3421E

from uhs30.

Lauszus avatar Lauszus commented on July 16, 2024

@xxxajk please see how I have done it in UHS2.0: https://github.com/felis/USB_Host_Shield_2.0/blob/ff8bdb24c19f254aa0496d3933920f3ae92f85a0/avrpins.h#L31-L32, https://github.com/felis/USB_Host_Shield_2.0/blob/ff8bdb24c19f254aa0496d3933920f3ae92f85a0/avrpins.h#L514-L517, https://github.com/felis/USB_Host_Shield_2.0/blob/ff8bdb24c19f254aa0496d3933920f3ae92f85a0/UsbCore.h#L37, and https://github.com/felis/USB_Host_Shield_2.0/blob/ff8bdb24c19f254aa0496d3933920f3ae92f85a0/usbhost.h#L158-L162.

from uhs30.

xxxajk avatar xxxajk commented on July 16, 2024

@Lauszus difference--- UHS30 needs an actual real IRQ pin....

from uhs30.

shadeyinka avatar shadeyinka commented on July 16, 2024

Thanks so much. I will check it out. However in your previous post

I guess you meant,
"Connect pin 53 to pin 3" and not "Connect pin 54 to pin 3".
Pin 54 & Pin 55 are GND in Aduino Mega

from uhs30.

xxxajk avatar xxxajk commented on July 16, 2024

If this is a regular Arduino mega with a USB host shield, then the jump from 9 to 3 should work.
The ADK isn't the same thing and those pins are in a different location.

from uhs30.

shadeyinka avatar shadeyinka commented on July 16, 2024

I think I found out something on the Aduino Mega ADK for use as USB Host

  1. The MAX3421E communicate with Arduino with the SPI bus. So it uses the following pins:
    Digital: 7 (RST), 50 (MISO), 51 (MOSI), 52 (SCK)

  2. Digital pin 7 should not be used as input or output because is used in the communication with MAX3421E

  3. There are three Connections to the MAX3421E through Non broken out on Headers:
    PJ3 (GP_MAX), Pin66 on ATMEGA 2560
    PJ6 (INT_MAX), Pin69,pin8 on ATMEGA 2560
    PH7 (SS). Pin27 on ATMEGA 2560 Pin53 on Arduino ADK Header

http://www.electroschematics.com/7965/arduino-mega-adk-pinout/

  1. There seems to be an error in USB_HOST_SHIELD.h for the Aduino ADK.
    lines
    81 #elif defined(BOARD_MEGA_ADK)
    82 #define UHS_MAX3421E_SS_ 53
    83 #define UHS_MAX3421E_INT_ 54

54 in line 84 should be referenced to PJ6 (since it has no broken out header, I don't know how to properly label it). *I could be wrong about this Sir

Pin 54 on Aduino Mega and ADK is GND
http://download.arduino.org/products/MEGAADK/arduino-mega-adk-schematic.pdf

  1. Is there any other library files that needs to be modified in UHS30 appart from USB_HOST_SHIELD.h to effect this changes.

Thanks

from uhs30.

shadeyinka avatar shadeyinka commented on July 16, 2024

Hi,
In USB_Host_Shield_2.0: avrpins.h
P54 and P55 (line 514-517) were properly defined. I am not sure of whether it was so done in UHS30

#ifdef BOARD_MEGA_ADK // These pins are not broken out on the Arduino ADK
#define P54 Pe6 // INT on Arduino ADK
#define P55 Pj2 // MAX_RESET on Arduino ADK
#endif

Sorry for my troubling.
Here is my Board
https://www.aliexpress.com/store/product/MEGA-ADK-2560-R3-Enhanced-version-Swith-for-I-O-5V-3-3V-USB-CH340G-USB/1950989_32672086405.html?spm=2114.12010608.0.0.2995e5c0nS6V2R

from uhs30.

xxxajk avatar xxxajk commented on July 16, 2024

You will need to locate where the INT_MAX pin is, and connect it to pin 3.
The MEGA ADK has different pin numbers than the regular MEGA.
What I see in your picture is basically a MEGA2560 with the MAX3421E on-board.

Do they provide a schematic?
Perhaps you need to compile for plain MEGA2560?

from uhs30.

xxxajk avatar xxxajk commented on July 16, 2024

FYI the official Arduino Mega ADK is totally different from this board too.

from uhs30.

xxxajk avatar xxxajk commented on July 16, 2024

Any chance on donating one to me so i can figure it out?

from uhs30.

shadeyinka avatar shadeyinka commented on July 16, 2024
  1. They did not provide a schematic. I have wriien the sellers though, they promised to get back to me.
  2. INT_MAX seems to be hardwired to MAX3421E chip...I am still trying to confirm that though.
  3. I will attemt to comple of the plain MEGA2560 as suggested.
  4. I could donate a board if you send me your shipping address in private. (You know my email address).
  5. In the mean while, can you help me with solving this problem of moving data from SD card to USB Flashdrive with UHS20?(Since I already have a working code with the ADK)..

The working code is:
https://github.com/Microduino/Microduino_Tutorials/tree/master/Microduino_Libraries/_06_Microduino_USBHOST_MAX3421E

Thanks

from uhs30.

xxxajk avatar xxxajk commented on July 16, 2024

Definitions seem to be identical, I'll see what I can find out as far as the actual tie points for these pins.

from uhs30.

xxxajk avatar xxxajk commented on July 16, 2024
#ifdef BOARD_MEGA_ADK // These pins are not broken out on the Arduino ADK
#define P54 Pe6 // INT on Arduino ADK
#define P55 Pj2 // MAX_RESET on Arduino ADK
#endif

Looks like you will have to find a good place to tap in on these two wires.

Are you capable of doing fine soldering?

from uhs30.

xxxajk avatar xxxajk commented on July 16, 2024

P54 I mean, not the reset one :-)

from uhs30.

xxxajk avatar xxxajk commented on July 16, 2024

Looks like this is actually a valid /INT pin!

from uhs30.

shadeyinka avatar shadeyinka commented on July 16, 2024

Thanks. I will check out the Board for the possibility of tapping PE6 and PJ2. I am not sure I can do fine soldering though but I am willing to givebit a try.

Is there no way round UHS20 for the working code code, while solution is being sought for the ADK board?

https://github.com/Microduino/Microduino_Tutorials/tree/master/Microduino_Libraries/_06_Microduino_USBHOST_MAX3421E

Thanks

from uhs30.

xxxajk avatar xxxajk commented on July 16, 2024

Well, there are two options to get this to work without soldering.
1: make a new set of read/write/mode for the digital pins.
OR
2: fix the definitions for the ADK in the Arduino definitions....

I think the first one makes the most sense at this point, and is very easy to do.

from uhs30.

shadeyinka avatar shadeyinka commented on July 16, 2024
  1. Which of the libraries need to be tweeked to Making a new set of read/write/mode for the digital pins in the library and How do you suggest it be implemented.
    (I wouldn't mind going by this as a first option before having a permanent and generic solution to the problem-at least to have a working project).
    The problem looks so simple, yet daunting.

  2. I assume it is more difficult to get the UHS20 move data between SD card and USB FlashDrive.

from uhs30.

xxxajk avatar xxxajk commented on July 16, 2024

Easier to work around in UHS30, UHS2 is horrible for this.
Working on the patch for you to test, it seems to only be half broken :-)

from uhs30.

shadeyinka avatar shadeyinka commented on July 16, 2024

I just got the schematic to the Arduino Mega ADK board by Robotdyn. I will send it now through my mail.

from uhs30.

xxxajk avatar xxxajk commented on July 16, 2024

Please send to my personal email, available off of my own github page. Just click my Avatar :-)

from uhs30.

shadeyinka avatar shadeyinka commented on July 16, 2024

from uhs30.

xxxajk avatar xxxajk commented on July 16, 2024

Send to my personal email as an attachment please.

from uhs30.

shadeyinka avatar shadeyinka commented on July 16, 2024

Thanks in anticipation for the patch. A million cheers to you if it works.

Thanks

from uhs30.

xxxajk avatar xxxajk commented on July 16, 2024

On your board, which of the following resistors are populated (IF THESE ARE MARKED!)
R11
R12
R13
R16

from uhs30.

shadeyinka avatar shadeyinka commented on July 16, 2024

I hope you can confirm this from the schematic
MAX3421E. ATMEGA2560. ADUINO ADK
RST_3V3 PH4/PJ2. PIN7
SCK_3V3. PB1. PIN52
SS_3V3. PB0. PIN53
MOSI_3V3. PB2. PIN51
MISO_3V3. PB3. PIN50
GPC_3V3. PH5/PJ3. PIN10
INT_3V3. PH6/PE6. PIN9

If this is true, an easy work around should be possible

from uhs30.

shadeyinka avatar shadeyinka commented on July 16, 2024

Sorry. This is gabbled up. The formating was messed up. I will send it through my mail again

from uhs30.

shadeyinka avatar shadeyinka commented on July 16, 2024

I just resent it as an *.rtf attachment.

from uhs30.

shadeyinka avatar shadeyinka commented on July 16, 2024

All the resistors mentioned are marked

from uhs30.

xxxajk avatar xxxajk commented on July 16, 2024

Try now...

from uhs30.

shadeyinka avatar shadeyinka commented on July 16, 2024

What about the following changes

  1. In USB_HOST_SHIELD.h
    81 #elif defined(BOARD_MEGA_ADK)
    82 #define UHS_MAX3421E_SS_ 53
    83 #define UHS_MAX3421E_INT_ 9 //modified from 54 to 9

  2. In what other files can one rectify this?

from uhs30.

xxxajk avatar xxxajk commented on July 16, 2024

Leave it as 54

from uhs30.

shadeyinka avatar shadeyinka commented on July 16, 2024

Sorry, I checked a wrong Board.
None of the components were labelled.

from uhs30.

xxxajk avatar xxxajk commented on July 16, 2024

Not a problem. Does the new code work?

from uhs30.

shadeyinka avatar shadeyinka commented on July 16, 2024
  1. I havent seen the New Code. Did you send it to my mail or you uploaded it to your github page?

  2. I hope you have confirmed this from the schematic. They look normal and INT can be taken fro Pin9, I dont know why it is not working
    MAX3421E............... ATMEGA2560............... ADUINO ADK
    RST_3V3 __________PH4/PJ2.______________PIN7
    SCK_3V3__________PB1___________________PIN52
    SS_3V3____________PB0___________________PIN53
    MOSI_3V3________PB2___________________PIN51
    MISO_3V3________PB3___________________PIN50
    GPC_3V3__________PH5/PJ3______________PIN10
    INT_3V3___________PH6/PE6______________PIN9

I reverted back line 83 to #define UHS_MAX3421E_INT_ 54

from uhs30.

xxxajk avatar xxxajk commented on July 16, 2024

Do a pull from github :-)

from uhs30.

shadeyinka avatar shadeyinka commented on July 16, 2024

Ok.
I will feed you back as soon as I test it. Thanks

from uhs30.

xxxajk avatar xxxajk commented on July 16, 2024

no problem :-)

from uhs30.

shadeyinka avatar shadeyinka commented on July 16, 2024

The new code still get stuck when executing the line

while(KINETIS_Usb.Init(1000) != 0);

I have put the jumper
between pin9 and pin3
between pin53 and pin3
with no jumper

from uhs30.

xxxajk avatar xxxajk commented on July 16, 2024

Should be no jumpers needed with new code.

from uhs30.

xxxajk avatar xxxajk commented on July 16, 2024

Also compile with board as the MEGA ADK

from uhs30.

shadeyinka avatar shadeyinka commented on July 16, 2024

Even with no jumper.
It prints Start. on the serial monitor and then waits indefinitly

from uhs30.

xxxajk avatar xxxajk commented on July 16, 2024

Try this with the board_qc example.

from uhs30.

shadeyinka avatar shadeyinka commented on July 16, 2024

Yes. I did compile it as

  1. Mega ADK
  2. Mega 2560
  3. Changed Board in case it is faulty
    Nothing seem to work

from uhs30.

xxxajk avatar xxxajk commented on July 16, 2024

Please try board_qc as Mega ADK, no jumpers, and it should print something out, after you pull this new patch.

from uhs30.

shadeyinka avatar shadeyinka commented on July 16, 2024

What do you mean by board_qc?
Did you upload a new patch?

from uhs30.

xxxajk avatar xxxajk commented on July 16, 2024

https://github.com/felis/UHS30/blob/master/libraries/UHS_host/USB_HOST_SHIELD/examples/board_qc/board_qc.ino
It is under the examples for USB Host Shield.
Yes I uploaded a new patch. :-)

from uhs30.

shadeyinka avatar shadeyinka commented on July 16, 2024

This is the Result from the Serial Display

Circuits At Home 2011
USB Host Shield Quality Control RoutineInitial reset failed.
Unrecoverable error - test halted!!
0x55 pattern is transmitted via SPI
Press RESET to restart test

from uhs30.

xxxajk avatar xxxajk commented on July 16, 2024

Please see if you have +5v on pin 12 on the MAX3421E.
I will send you a picture of where to test to your private email.

from uhs30.

xxxajk avatar xxxajk commented on July 16, 2024

Sorry, 3.3v

from uhs30.

shadeyinka avatar shadeyinka commented on July 16, 2024

There is 0.85V between Pin12 and GND

from uhs30.

shadeyinka avatar shadeyinka commented on July 16, 2024

Sorry my error. Pin12 on the MAX3421E chip you mean?

from uhs30.

xxxajk avatar xxxajk commented on July 16, 2024

Yes.

from uhs30.

xxxajk avatar xxxajk commented on July 16, 2024

Sent you the pin to check to your email.

from uhs30.

shadeyinka avatar shadeyinka commented on July 16, 2024

I am on it. The pins are so tiny I want to activate my usb microscope to see where i am probing

from uhs30.

xxxajk avatar xxxajk commented on July 16, 2024

No problem, I am probing here as well on the ATMega, using mine.

from uhs30.

xxxajk avatar xxxajk commented on July 16, 2024

Pushed a new patch, pull, try board_qc again.

from uhs30.

shadeyinka avatar shadeyinka commented on July 16, 2024

Just Did that. The same Result on Serial Port

Circuits At Home 2011
USB Host Shield Quality Control RoutineInitial reset failed.
Unrecoverable error - test halted!!
0x55 pattern is transmitted via SPI
Press RESET to restart test

from uhs30.

xxxajk avatar xxxajk commented on July 16, 2024

Unsure what the exact issue is, the port/pins should be correct now.
I probed them on my regular Arduino Mega2560 at the actual MCU.

Try this short sketch, it will toggle the reset and int pins.

#define PULSE_DELAY 100 

void setup() {
        DDRJ |= 0x04; // output
        PORTJ |= 0x04; // HIGH
        DDRE &= 0x40; // outputput
        PORTE |= 0x40; // HIGH
        pinMode(LED_BUILTIN, OUTPUT);
        digitalWrite(LED_BUILTIN,HIGH);
}

void loop() {
        PORTJ |= 0x04; // HIGH
        PORTE |= 0x40; // HIGH
        digitalWrite(LED_BUILTIN,HIGH);
        delay(PULSE_DELAY);
        PORTJ &= ~0x04; // LOW
        PORTE &= ~0x40; // LOW
        digitalWrite(LED_BUILTIN,LOW);
        delay(PULSE_DELAY);
}


Do you have an oscilloscope or multimeter with the ability to sense frequency? If so, the RESET and INT pins should be pulsing in the above test.

from uhs30.

shadeyinka avatar shadeyinka commented on July 16, 2024

I do not have the Oscilloscope around, but I was able to do a work around by slowing down the oscillation (delay 2000) and viewing the Output with LED.

My observations:

  1. Pin7 and Pin8 Toggles ON/OFF
  2. The Oscillations on Pin7 and Pin8 are in Phase
  3. I am not sure which one of them is INT and which is RST
  4. Pin9 is permanently ON

Was this your intention?

from uhs30.

shadeyinka avatar shadeyinka commented on July 16, 2024

of course Pin13 goes in sync with Pin8 and Pin7. Same phase and Same Frequency

from uhs30.

xxxajk avatar xxxajk commented on July 16, 2024

All right, in that case, the creators of this board tied pin 7 an 8 to the "hidden" pins.
That's pretty interesting, and not really how the official ADK works, but should not pose a problem as long as you don't use pins 7 and 8.

This is actually progress :-)

Are you certain it is pins 7 and 8 and not 7 and 9?

from uhs30.

shadeyinka avatar shadeyinka commented on July 16, 2024

I am certain.
Pin 7 and Pin 8 Oscillates
Pin 9 is permanently ON

from uhs30.

shadeyinka avatar shadeyinka commented on July 16, 2024

Hi,
I noticed an important difference in the port assignment between the Standard ADK and the Robotdyn ADK
Except if the supplied schematic is wrong.

RobotDyn ADK______________________MAX3421E______________________Arduino ADK(Standard)
PH4/PJ2_____________________________RST_3V3_________________________PH4/PJ2
PB1 (Pin52)__________________________SCK_3V3________________________PB1_SCK (Pin 52)
PB0 (Pin 53)_________________________SS_3V3__________________________PB0_SS/PH7 Pin (53)
PB3 (Pin 50)_________________________PB3_MISO_______________________PB3_MISO (Pin 50)
PB2 (Pin 51)_________________________MISO_3V3_______________________PB2_MOSI (Pin 51)
PH5/PJ3_____________________________GPX_MAX________________________PJ3
PH6/PE6_____________________________INT_MAX_______________________PJ6/PE6
FROM:
http://download.arduino.org/products/MEGAADK/arduino-mega-adk-schematic.pdf
and the RobotDyn Supplied Schematic
The major problem seems to be that
PH6/PE6_____________________________INT_MAX_______________________PJ6/PE6
INT_MAX is connected in addition to PE6 differently:
Robotdyn allowed a connection to PH6 while the Standard Arduino ADK allowed connection to PJ6
the non critical difference is the connection
PB0 (Pin 53)_________________________SS_3V3__________________________PB0_SS/PH7 Pin (53)
where the standard connected SS_3V3 to PH7, whereas PH7 was unconnected in Robotdyns board.

What do you think?
It is even possible that bot schematics have been reviewed since published.

from uhs30.

shadeyinka avatar shadeyinka commented on July 16, 2024

From Robodyns Schematic,(if it is correct),
Pin_____PORT________MAX3421E
Pin 6= PH3
Pin 7= PH4/Pj2---->RST_3V3
Pin 8= PH5/PJ3--->GPX_3V3
Pin 9= PH6/PE6--->INT_3V3
Pin10= PB4
Pin13= PB7
Pin53=PB0--------->SS_3V3
Pin50=PB3--------->MISO_3V3
Pin52=PB1--------->SCK_3V3
Pin51=PB2--------->MOSI_3V3

Seems all the connections to the MAX3421E chip were made accessible

from uhs30.

xxxajk avatar xxxajk commented on July 16, 2024

I made a spreadsheet, and should be able to run some kind of test to determine what kind of "ADK", official, or quirky clone.

Part of the difference should actually not matter, however it is wired differently for /INT.

uhs

from uhs30.

shadeyinka avatar shadeyinka commented on July 16, 2024

Whao!
So much difference between the Official and Robotdyn ADK. I am sure except for their own library as in https://github.com/Microduino/Microduino_Tutorials/tree/master/Microduino_Libraries/_06_Microduino_USBHOST_MAX3421E , No other library would work with the MAX3421E chip.

I guess this is the problem with Chinese clones: with almost no documentation. I am surprised you were able to get the Table above. The schematic supplied by the seller to me actually seems not the same that was implemented.

I guess I have learnt a lesson. "Never use a Chinese Clone for prototyping: to avoid endless Headaches and Time waste".

Thanks so much for spending so much time on this.

  1. From your earlier Port Test Sketch,

#define PULSE_DELAY 100
void setup() {
DDRJ |= 0x04; // output
PORTJ |= 0x04; // HIGH
DDRE &= 0x40; // outputput
PORTE |= 0x40; // HIGH
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN,HIGH);
}
void loop() {
PORTJ |= 0x04; // HIGH
PORTE |= 0x40; // HIGH
digitalWrite(LED_BUILTIN,HIGH);
delay(PULSE_DELAY);
PORTJ &= ~0x04; // LOW
PORTE &= ~0x40; // LOW
digitalWrite(LED_BUILTIN,LOW);
delay(PULSE_DELAY);
}

I assumed you did intended to toggle PJ2(RST ) and PE6(INT), and by the Table, it should correspond to Pin7(PH4) and Pin9(PH6)
but
Pin7(PH4) and Pin8(PH5) Toggles ON/OFF while Pin9(PH6) is permanently ON.

This would mean that INT on Robotdyn ADK is actually PH5/PE6 and not PH6/PE6 as the table suggests.
2. How critical is the connection to PH6 which seems to be missing in Robotdyn ADK?
Thanks

from uhs30.

xxxajk avatar xxxajk commented on July 16, 2024

Yup, that's where even sometimes it is actually even better to build your own boards too.
Considering that the code was tweaked to use PE6, it should actually work.
One huge difference also is that on the official Arduino ADK, the alternate pins are not connected, and are optional connections.
This difference could possibly be part of the issue as well.
One possible solution would be to locate where on the board the junction is made, and disconnect the secondary connections.
Another possible problem with this board (judging by the schematics) is that there are no buffer chips to convert the signal levels from the MAX chip to the ATMega. While typically this shouldn't be an issue, it could actually be, since the waveform characteristics would be very different.
Another problem with doing it the way they did is that if the INT/MISO/GPX lines are set to PULL_UP, the backwash of +5v to the +3.3V signal may damage the MAX3421E.
Furthermore, MISO should be gated via the buffer IC so as when /SS is not low, that MISO is tristated, and not visible on the SPI BUS. Even if the MAX3421E DOES tristate alone, this is not enough, because anything ELSE connected to the SPI BUS is goping to be talking at +5V, and fry the MAX3421E that way too.

from uhs30.

shadeyinka avatar shadeyinka commented on July 16, 2024

My only consolation now is that their own library seems to work.
Start

_Current UsbDEBUGlvl 81
'+' and '-' increase/decrease by 0x01
'.' and ',' increase/decrease by 0x10
't' will run a 10MB write/read test and print out the time it took.
'e' will toggle vbus off for a few moments.

Long filename support: Enabled
Total EXT RAM banks 0
Available heap: 7132 Bytes
SP 21ef
Available heap: 7105 Bytes
VBUS on
USB state = 20
USB state = 40
USB state = 50
USB state = 51
USB state = 90
LUN: 0
Total Sectors: 00772c80 7810176
Sector Size: 0200 512
Partition 0 type 0xb

Open an existing file (message.txt).
Error 4, message.txt not found.

Create a new file (hello.txt).

Write a text data. (Hello world!)
14 bytes written.

Close the file.

Open root directory.

Directory listing...
Available heap: 5982 Bytes
-rw--a 14 HELLO.TXT (Hello.TxT)

Test completed.
Available heap: 5984 Bytes_

An easy solution will be to purchase the Standard Arduino ADK and get on with the project, but that will take approximately 3 weeks of waiting for the shipment. It is sometimes impossible to trust the schematics you get from China. They could have done 21 revisions after the publication for their own consumption.

It looks like they have buffer chips to convert the signal levels from the MAX chip to the ATMega

I have tried to compare what they did (they heavily modified your code) with your USB_Host_Shield_2.0
with a view of noting the important difference to no avail. ...my coding skill isn't that strong.

Can you please help with the easiest solution that you think while I try to get a Standard Arduino ADK? I will surely appreciate this.

from uhs30.

shadeyinka avatar shadeyinka commented on July 16, 2024

Hello
My Arduino MEGA ADK (original and direct from https://store.arduino.cc/arduino-mega-adk-rev3 ) finally arrived yesterday

The Good News:
Board is OK. Compiles and executes your UHS20 example testusbhostFAT
The Bad News:

  1. UHS_FS/UHS_KINETIS_FS_HOST/UHS_FS_NEW_DEMO
    Give a Compile Error
    C:\Users\HP\Documents\Arduino\libraries\UHS_host/UHS_KINETIS_FS_HOST
    /UHS_KINETIS_FS_HOST.h:24:2: error: #error include dyn_swi.h first
    #error include dyn_swi.h first
  2. UHS_FS/UHS_HOST_SHIELD/UHS_FS_NEW_DEMO
    Compiles OK
    Execution gets stuck at while(KINETIS_Usb.Init(1000) != 0);
  3. UHS_host/UHS_BULK_STORAGE/UHS_KINETIS_FS_HOST/TEST_BULK_K
    Give a Compile Error
    In file included from C:\Users\HP\Documents\Arduino\libraries\UHS_host/UHS_host.h:54:0,
    from C:\Users\HP\Documents\Arduino\libraries\UHS_host\UHS_BULK_STORAGE\examples\UHS_KINETIS_FS_HOST\TEST_BULK_K\TEST_BULK_K.ino:40:
    C:\Users\HP\Documents\Arduino\libraries\UHS_host/UHS_KINETIS_FS_HOST/UHS_KINETIS_FS_HOST.h:24:2: error: #error include dyn_swi.h first
    #error include dyn_swi.h first
  4. UHS_host/UHS_BULK_STORAGE/USB_HOST_SHIELD/TEST_BULK
    Compiles OK
    Execution gets stuck at while(KINETIS_Usb.Init(1000) != 0);

Is there a setting specifically for Arduino Mega ADK?
Thanks for your understanding
Arduino IDE 1.8.3
Arduino AVR Board manager 1.6.11

from uhs30.

shadeyinka avatar shadeyinka commented on July 16, 2024

Display from board_qc

Circuits At Home 2011
USB Host Shield Quality Control RoutineInitial reset failed.
Unrecoverable error - test halted!!
0x55 pattern is transmitted via SPI
Press RESET to restart test

from uhs30.

xxxajk avatar xxxajk commented on July 16, 2024

You may need to reroute the int line to pin 3, plus some other stuff, possibly.
Quite busy with work currently.
As far as what board to compile for/what demos, use only the demos for the host shield, and select mega ADK.
Again, I do not actually have this board, so I can't really tell you why it doesn't work. If you can send me one, then I could probabbly get it running in a couple minutes, and tell you what to modify.

from uhs30.

shadeyinka avatar shadeyinka commented on July 16, 2024

I did a checkup for Arduino Mega ADK from their site
https://store.arduino.cc/arduino-mega-adk-rev3
the board seem to be out of stock. Is there a local site near you where I can purchase it online?

I can pay for it once I know your shipping address.
Pls use my private mail to ensure confidentiality.

Thanks so much.

from uhs30.

xxxajk avatar xxxajk commented on July 16, 2024

Click my avatar, you'll get my email address and I'll give details.
No, there is no local stores that carry any such items.

from uhs30.

xxxajk avatar xxxajk commented on July 16, 2024

Test 1 board_qc


Circuits At Home 2011
USB Host Shield Quality Control Routine
Reading REVISION register... Die revision 03
SPI long test. Transfers 1MB of data. Each dot is 64K 
................
SPI long test passed
PLL test. 100 chip resets will be performed
Reset oscillator test.
Reset number 1	Time to stabilize, about 2748 microseconds
<SNIP!>
Reset number 99	Time to stabilize, about 2740 microseconds
Reset number 100	Time to stabilize, about 2744 microseconds
Checking USB device communication.

Device connected. Resetting...
USB Device detected.
Performing a bus reset... 
Got device pointer at 0
Getting device descriptor

Descriptor Length:	0x12
Descriptor type:	0x01
USB version:	0x0200
Device class:	0x00
Device Subclass:	0x00
Device Protocol:	0x00
Max.packet size:	0x40
Vendor  ID:	0x0457
Product ID:	0x0151
Revision ID:	0x0100
Mfg.string index:	0x00
Prod.string index:	0x02
Serial number index:	0x03
Number of conf.:	0x01



All tests passed. Press RESET to restart test

Test 2 UHS_FS_NEW_DEMO

Start.


USB HOST READY.
USB HOST state 1d
No media. Waiting to mount /
USB HOST state 02
USB HOST state 0a
USB HOST state 03
USB HOST state 0c
USB HOST state 0d
USB HOST state 60
/ mounted.
Removing '/HeLlO.tXt' file... completed with 4

Starting Write test...
File opened OK, fd = 1
Wrote 19 bytes, File closed result = 0.

Starting Read test...
File opened OK, fd = 1, displaying contents...
]-[ello \/\/orld!

Read completed, last read result = -1 (20), file close result = 0.
Testing rename
file rename result = 0.

Removing '/1MB.bin' file... completed with 0
1MB write timing test  2048 writes, (0), (0),  9485 ms (9 sec)
completed with 0
1MB read timing test 2048 reads, (20),  10413 ms (10 sec)
completed with 0
Directory of '/'
-rw--a      1048576 2017-10-16 20:16:30 1MB.bin
-rw--a           19 2017-10-16 20:16:20 newtest.txt
265003008 bytes available on disk.

Flushing caches...
Remove and insert media...

Let me know here if it also works for you, it should.
I shall be pushing the patch very soon.

from uhs30.

shadeyinka avatar shadeyinka commented on July 16, 2024

Hi,
Your patch works like a charm on both my ADk clone Robotdyn Arduino Mega ADK and the Official Arduino Mega ADK. I gues the patch can now be made public.
Thanks so much for the effort you have put.

Unfortunately, it doesnt support the SD card all the SD card libraries i know. I have tried SD.h, SdFat.h, SdFs.h and SduFat.h.

'Sorry to ask, What does UHS_KINETIS_FS_HOST Do? The two examples do not compile on the ADK. You might want to check them out.

I am happy the code works but will prefer both the SD and the USB card shields work together.

The Output of the UHS3 I paste Here Below:
Thanks so much.

_**Start.

USB HOST READY.
USB HOST state 1d
No media. Waiting to mount /
USB HOST state 02
USB HOST state 0a
USB HOST state 03
USB HOST state 0c
USB HOST state 0d
USB HOST state 60
/ mounted.
Removing '/HeLlO.tXt' file... completed with 4

Starting Write test...
File opened OK, fd = 1
Wrote 19 bytes, File closed result = 0.

Starting Read test...
File opened OK, fd = 1, displaying contents...
]-[ello //orld!

Read completed, last read result = -1 (20), file close result = 0.
Testing rename
file rename result = 0.

Removing '/1MB.bin' file... completed with 0
1MB write timing test 2048 writes, (0), (0), 15134 ms (15 sec)
completed with 0
1MB read timing test 2048 reads, (20), 14176 ms (14 sec)
completed with 0
Directory of '/'
-rw--a 1048576 2017-10-17 16:24:04 1MB.bin
-rw--a 19 2017-10-17 16:23:48 newtest.txt
-rw--- 5000000 2000-01-01 01:00:00 bench.dat
-rw--- 11 2000-01-01 01:00:00 TESTFI1.TXT (test file.txt)
-rw--- 53 2000-01-01 01:00:00 DATA00.CSV (Data00.csv)
drwhs- 0 2017-09-06 09:34:08 SYSTEM
1 (System Volume Information)
-rw--- 54 2000-01-01 01:00:00 DATA01.CSV (Data01.csv)
-rw--- 54 2000-01-01 01:00:00 DATA02.CSV (Data02.csv)

-rw--a 376971 2017-09-14 11:49:56 TINYFA1.ZIP (tinyFAT(1).zip)
-rw--a 18261 2017-09-14 11:51:38 ARDUIN
2.ZIP (Arduino_SDuFAT_Library.zip)
3774201856 bytes available on disk.

Flushing caches...
Remove and insert media...

from uhs30.

shadeyinka avatar shadeyinka commented on July 16, 2024

Since the UHS30 and the SD card FAT system seem to share a lot in common, wouldn't it be nice if the UHS30 can also handle SD card functions?

from uhs30.

shadeyinka avatar shadeyinka commented on July 16, 2024

I guess the easiest solution by which to resolve the namespace conflicts is to modify an SD card library specifically for the UHS30.

from uhs30.

xxxajk avatar xxxajk commented on July 16, 2024

Closing, problems assumed resolved.

from uhs30.

xxxajk avatar xxxajk commented on July 16, 2024

Heads-up... SD card on SPI is now supported. You must have the SDcard detect pin connecting to a real interrupt pin or ARM MCU with built-in pin interrupts for it to work.

from uhs30.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.