Go Down

Topic: uarts buffers on the arduino mega (Read 711 times) previous topic - next topic

PGT

Hi friends,

I was reading about the arduino mega, and learned it has 3 additional  USB ports, or uart connections through specific pins.
I am wondering about this because i have need for a micro controller to control 4 USB devices
Well my 4 questions are

1) Does each USB port has its own buffer.
    So that if two devices are simultaneously writing data, they each store it in their buffer until I read it out

2) Can there be multiple USB device configurations like 3 reading data 1 for writing data, or is there some limit here ?.

3) i was also thinking is it possible to use an external USB hub to extend the number of USB ports ? > and if so how to address them?

4) if i add an ethernet shield wil this cost me a USB port ?


CrossRoads

1. Yes.
2. Sure, why not? The device doesn't care what is on the other end of the Rx/Tx lines.
3.  Wouldn't that need a USB master? Like a SPI driven MAX3241E.
4. I think the Ethernet is controlled via SPI, not serial, so I would suspect not.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

retrolefty


Hi friends,

I was reading about the arduino mega, and learned it has 3 additional  USB ports, or uart connections through specific pins.
I am wondering about this because i have need for a micro controller to control 4 USB devices
Well my 4 questions are

1) Does each USB port has its own buffer.
   So that if two devices are simultaneously writing data, they each store it in their buffer until I read it out

Well you are confusing the word USB with UART. Even a mega board has but one USB serial converter chip on board that wires to one of the 4 hardware UART devices available on the avr2560 chip. These other 3 UART chips can be wired to any serial device that uses TTL voltage level serial comm, but to wire them to a PC's USB port would require a serial USB converter chip or cable assembly.

2) Can there be multiple USB device configurations like 3 reading data 1 for writing data, or is there some limit here ?.
Well there can be up to four active UARTS working independently and simultaneously on a AVR 2560 chip. Again USB communications channels requires addition external components for the AVR chip to support.

3) i was also thinking is it possible to use an external USB hub to extend the number of USB ports ? > and if so how to address them?
Again you need to study the difference between USB and UART based serial communications. They can be related but they are two different animals.

4) if i add an ethernet shield wil this cost me a USB port ?

Do you mean will it cost you one of the AVR's 4 serial UART channels? I guess it depends on the specific ethernet shield you use, but the one made by arduino uses SPI communications to and from the AVR chip so no UART channels are used by the ethernet shield board. Again are mixing up USB with AVR UART channels.
Lefty



CrossRoads

Re-reading, I see I was a little too brief.
You would need  a USB/Serial adapter such as mikroe483
http://www.mouser.com/ProductDetail/mikroElektronika/MIKROE-483/?qs=%2fha2pyFadugsEwyLV5fFyIWdPbushEDhRSvnBE0ODG8%3d
connected to Serial1, Serial2, Serial3 to be able to have 4 total USB ports.
None provide USB host capability, need a USB Host shield or equivalent for that
https://www.sparkfun.com/products/9947
to be able to control a USB hub as far as I know.
I don't know if code exists to control the hub either, might be breaking new ground there.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up