uarts buffers on the arduino mega

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 ?

  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.

PGTBOOS:
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.

  1. 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.

  2. 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.

  3. 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

Re-reading, I see I was a little too brief.
You would need a USB/Serial adapter such as mikroe483

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

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.