Electronic – How to establish communication between microcontroller on a bread board and laptop using usb cable

atmegamicrocontrollerusb

I want to learn about microcontrollers and use them in some projects. But I do not want to buy an Arduino, although that is what would be easy for doing projects. This creates a problem in programming the microcontroller. Although a programmer can be used, I noticed that many microcontrollers have an SPI. I thought I could use this along with a USB to programming it serially. I may also read the data serially (using shift registers) into the computer. This way, I think, I can establish communication of some sort between the two. But I am not sure if my computer will allow me to write to a USB port without any identifiable device being connected.

I am aware I would have to write some code to make this smooth since, both the microcontroller and the computer have different clock speeds.

Best Answer

An Arduino does not have to be a pre-fabricated board - it can be as simple as a microcontroller IC and some support components.

An eg basic Arduino Nano clone from Asia for under $US3 incl shipping gives you a few basic ICs a voltage regulator, a USB to serial interface and some support firmware to allow bootloading from USB. You gain nothing by not starting with a few parts on a board and the bootloader and free environment. Once running you can pursue whatever purist directions that seem good.

Struggling with months to achieve what can be done in hours in setting up an Arduino will teach you much, but there are far far far better ways to use the same learning time.

I built my first microcontroller system on strip board about 45 years ago!!!
Based on a Nat Semi SC/MP.
NO O/S,
Binary toggle switch program and data input.
(No keyboard or keypad initially).
LED I/O (yes, we had LEDs :-) ).
No assembler (let alone an HLL).
Later we graduated to using Baudot code teleprinetrs - that we wrote our own code for.

So, yes, I know what you can learn the hard way.
Buy an Arduino to start :-).

You can learn far far far more quickly by starting with an Arduino and working DOWN once you have it running. Arduino use in no way misses out on ANY computer architecture aspects. You are doing yourself a massively large disservice by not starting with Arduino.


Arduino Bootloader:

What it does and why use it, & How to turn any appropriate AVR microcontroller IC into an Arduino.

An Arduino-less Arduino here
and
Adding a bootloader with ICSP here
and here
and here
Stack Exchange discussion here

What it is and what it does here