I need to use a microSD card in my sketch. I'm wondering, is there any way to add one more USB port and use it as a card reader?
The SD library is for SPI connect.
Yes, there is already one USB port. Can't I use that one for programming, and add another one just for reading the card?
I don't have any card reader on my computer, that's why I'm asking
Arduino board has a USB chip only to bridge USB to RS-232 that the ATmega328P uses. To program that USB chip is advanced work to say the least.
Check this out: PJRC Store
Warning the pictures are magnified, the long side of the adapter is 3/4".. they are small! Be sure to get 2 of the 5x1 pins, should fit into breadboard and yes will need soldering to the adapter.
.>
There is an USB port...
Serial USB.
There is an USB port...
Serial USB.
Once more, in the form of a question, please.
There is a USB chip but it's not under your control normally. It is there to bridge PC to Arduino.
The chip that you normally control has no USB and can only get -to- the USB chip at RS-232 speed. The SPI bus is capable of many times 115,200 baud.
Why don't you read into how SD adapters -are- used with Arduino instead of chasing a rainbow?
I think that I phrased it wrong.
I got the Ethernet shield, which already has a microSD card reader.
I'll use it in my sketch. What I'm trying to do, is to add one more USB port, through which the computer can read the microSD card in the Arduino.
What I'm trying to do, is to add one more USB port, through which the computer can read the microSD card in the Arduino.
That will not happen. The PC will never be able to see the SD card reader as an external device.
You can create an application on the PC that talks to the Arduino, via the one serial port, and have the Arduino read/write the serial data to/from the SD card.
I could, but that'd be extremely slow.
I could, but that'd be extremely slow.
Slow is better than impossible, is it not?
If the Arduino isn't doing anything with the SD card, why isn't the SD card in the PC?
No, the Arduino will use the SD card.
bogdacutu:
I think that I phrased it wrong.I got the Ethernet shield, which already has a microSD card reader.
I'll use it in my sketch. What I'm trying to do, is to add one more USB port, through which the computer can read the microSD card in the Arduino.
And the "microSD card in the Arduino" is the one in the Ethernet shield?
And for some reason you can't use the Arduino USB that is probably already connected to your PC? Or the Ethernet that should be faster than that by over a magnitude?
Atmel does make USB-capable MCU's. There's one on the UNO, a tiny little surface mount. Maybe you are good enough to add one of those but it's still not going to be a picnic getting data out from the 328P at any great speed.
The Teensy runs off an ATMEGA32U4 at full USB speed, but oh great heavy sigh, has only 1 port. Maybe you could communicate to a Teensy through (fast) SPI and use the USB on that in your complex scheme. Because no matter HOW you add another USB port you still have to talk to it and you only have a few ways to do that.
IMO you're being blind to what you have in favor of a rather lame idea.