Black Lives Matter - Action and Equality. ... Adafruit is open and shipping.

Using the Metro Mini USB Serial port
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Using the Metro Mini USB Serial port

by peteread on Thu Apr 25, 2019 7:35 am

I have started programming a Metro Mini using the Atmel Studio 7 IDE . It works well - the USB serial port is used in conjunction with AVRDude in the IDE to load programs written in C to the Metro Mini.
Has anyone used the Metro Mini USB serial port as part of a user application?
Ultimately I want to connect my Metro Mini to a Raspberry Pi and since I have experience with serial data links I thought that the Pi could 'talk' to the metro mini to send it data that would cause the metro mini to change some aspect of its programmed behaviour on the fly - for example, say I have a program on the Metro Mini to flash a LED at a certain rate, I would like to be able to send data to the mini from the PI via a serial link that changes the flash rate. Only thing is, how do I do this if the same USB-Serial interface is used to program the Metro Mini !!
Thinking aloud, I imagine the built-in boot loader in the Metro Mini sets up the UART in the ATMega 328 to enable the Mini to be programmed serially by the Atmel IDE. Maybe my *user* program would have to re-program the UART after booting has completed, or at the very least, determine where the UART stores the bytes it receives - or maybe just change the interrupt vector for the UART to something relevant to my user program. At any rate, the UART would no longer function as a programming port while my user program runs - so somehow I need a mechanism to re-init the UART to allow chip reprogramming, and a switch input to test so I can restart the user program AFTER is has been loaded by the IDE.
If anyone has any ideas, please respond. Thank You.

Posts: 1
Joined: Thu Apr 25, 2019 7:11 am

Re: Using the Metro Mini USB Serial port

by adafruit_support_mike on Fri Apr 26, 2019 2:21 am

Using the Metro Mini's hardware Serial port is pretty much the same as using an Arduino Uno's. As long as the USB cable isn't connected to the computer, you can use pins 0 and 1 for other Serial devices.

Posts: 61222
Joined: Thu Feb 11, 2010 2:51 pm

Please be positive and constructive with your questions and comments.