I've bought a female Micro-USB connector, and I was wondering if there's an easy way to plug the +D and -D into any arduino board (Mega, Uno, Nano, whatever...) and use the Wire, Serial or SPI (or any) libraries to send messages through the port (Hence make it a virtual serial port), like when you plug the builtin USB port to program it.
The idea is to communicate the machine with the PC through a custom software, well in fact I have not a clear idea.
For now I'll just write test programs into Processing I guess.
Cheers!
PD: Sorry if the question is stupid and the answer plain dead simple
I think one of the ATTiny AVRs has a software USB implementation in its bootloader. Beyond that I know little else about it. Hopefully somebody else will pitch in and advise.
SigmaSoldi3R:
I've bought a female Micro-USB connector, and I was wondering if there's an easy way to plug the +D and -D into any arduino board (Mega, Uno, Nano, whatever...) and use the Wire, Serial or SPI (or any) libraries to send messages through the port (Hence make it a virtual serial port), like when you plug the builtin USB port to program it.
If you are thinking that sending I2C or SPI signals through the data lines of a USB connector will be properly interpreted as normal USB data by the PC then the answer is a very firm NO.
USB works at a much higher frequency (480MHz IIRC). If you want to communicate using USB then you need a microchip that is designed to produce USB signals.
The simplest way to have a USB connection is to get a USB-TTL cable and connect it to a serial port (perhaps using SoftwareSerial) on your Arduino.
You can use the wire, SPI or serial interfaces on your chip to acquire the data and then maybe, depending on your skill level, implement the V-USB interface on some spare pins.
However, I don't know the processing resources the V-USB implementation takes or whether it uses specific pins or functionality provided by a particular AVR variant.
This is the link to the V-USB page where you can find more details: