Prototyping platform

Hi ALl,

I am in the process of designing a board to evaluate some sensors.

I want to design a board that can show up as a comm port on the PC. So I can us simple python(py.serial) to communicate with the chip on board.

This platform will allow rapid prototyping.

PC_USB --->FTDI ---->Microcontroller---SPI-->components.

I do not want to completely reply on the audurio platform. I want to be able to design the PCB using native Atmel uC and thier IDE.(It is a better learning experience for me)

I believe that is a very common and useful platform for my future projects.(PCB design)

I was looking at arduino due(It has enough IO for my needs) as a reference design,The board implemented a ATMEGA16U2-MU instead of a FTDI chip.

My question is :

What is the purpose of this ATMEGA16U2?
Can this micro be replaced by a FTDI chip?

Also, The website mentioned the following in the communication section:

"The Native USB port is connected to the SAM3X. It allows for serial (CDC) communication over USB. This provides a serial connection to the Serial Monitor or other applications on your computer. It also enables the Due to emulate a USB mouse or keyboard to an attached computer. To use these features, see the Mouse and Keyboard library reference pages."

I plan to buy a board first and start from a working solution.
My question is :

Will this board shows up as the comm port(Allow me to use py.serial) when i connect to my PC?

Any suggestions in meeting my goal will be much appreciated.

Thank you so much,
Eddy

What is the purpose of this ATMEGA16U2?

It does USB/Serial conversion, allowing uploading using serial protocols (built into the SAM3X, actually) and the use of the SAM UART for talking to the PC. It can also be reprogrammed to allow the board to be recognized as other types of USB device (mouse, keyboard, midi, etc.)

Can this micro be replaced by a FTDI chip?

Yes, if you only need the USB/Serial functionality.

"The Native USB port is connected to the SAM3X..."
Will this board shows up as the comm port(Allow me to use py.serial) when i connect to my PC?

The Due "programming port" will show up as a comm port. Whether the "native usb" port will also show up depends on the firmware running on the chip at the time. I believe that if you use the Arduino IDE, it will include firmware that makes the native port show up as a comm port as well. Also, the SAM3X includes boot code that will bootload from USB even with no user software (if various pins are tied appropriately and etc.) In theory, you can build a SAM3X board that can boot over USB and appear as a com port without any FTDI or 16u2 chip.

Hi westfw,
Thank you for the detailed reply.

Here is my plan of action, I am sure there are better way of doing it. So bear with me :).

Let me know if this makes senses to you.

I think I can basically use the programming port only to achieve my goal.

  1. write a code to flash the uC through programming port.( Adorno IDE)
  2. the code can identify a list of serial command from pc host which will control to the sensor.
    3)The PC host will issue above commands to the uC which will address the sensor.(Etc take data from sensor, or set sensor data rate)
  3. native usb port is no longer needed in the board.

I think I will keep the 16u2 for now, and replace it with FTDI in my next design.(safer since I know this will at least this way)

My concerns:
How do I flash the 16u2 in my board to have it behave as a USB/serial converter?

Will this USB/serial by 16u2 allow bi-directional transfer?
Etc I can flash the uC, but can I get the data out from sensor to the PC?(in another word, will py.serial work?)

Thanks,
Eddy

Sounds fine. I think you'd be better off with an FTDI chip instead of the 16u2. In theory, you'd need your own USB Vendor ID for the 16u2 firmware.

Either one should work fine with py.serial, given appropriate drivers on the PC side.

You could "prototype" all of this on an actual Arduino Due while you're working on designing the hardware...