Electrical – Connecting AVR Microcontroller to USB

atmegaavrmicrocontrollerusb

I am working with an ATmega328. What I want to do is finding a way to save any value in any GPR of the microcontroller using the PC.

I found this video where an already made interface is shown. Apparently, that is very user-friendly. But does it what I'm trying to achieve? For example, if I want to save the value 0x3B in register R16, could I use that software to do it via USB?

Also, I don't know how to connect the USB with the microcontroller pins. I've found this image

enter image description here

but I would have expected the pins TXD and RXD to be used. Is this connection alright?

Sorry if the question is a bit messy, I'm a beginner with this stuff. If you need any further information please let me know.

Best Answer

TXD and RXD would be used if you were using the UART - that is, connecting the chip to a USB to UART (TTL) adaptor. You aren't, you're interfacing directly to USB and bit-banging the USB protocol (which is IMHO one of the nastiest things anyone could ever do on a USB bus), so you have to use the pins mandated by the software that is doing said bit-banging.

Can you get it to set registers? Sure - if you write the software (using the V-USB library) to do it.