I am really a noob when it comes to arduino and microcontrollers, so please, be kind.
I just recently bought an arduino uno clone (shows up as ch340g in windows) and an atmega328.
I can upload the blink sketch to the 328 and it works while being plugged into the arduino, but stops working as soon as i remove the sck, miso and mosi. I want it to work independently so I can solder it to a board.
What am I doing wrong guys? I've tried numerous fixes and methods to upload to the 328 chip, and none of the work for me... I've read online that I don't really need FTDI cable since I can use the arduino as ISP.
Current setup (using arduino ide):
chip pin 1 - arduino pin 10
chip pin 7 & 20 - arduino 5v
chip 8 & 22 - arduino gnd
chip 9 & 10 with 16mhz oscillator and 2 .22 ceramic to gnd
chip pin 17, 18 and 19 - arduino pin 11, 12 and 13;
chip pin 19 - long leg of the led (using a 220ohm resistor) and short leg to gnd
PS: I also bought a legit Arduino Uno rev 3 board and it should arrive shortly. Will this board change anything for this process?
Thanks in advance guys!
If you have 328P with bootloader, maybe the easiest way to program it is just removing the original chip from arduino and placing the chip to be programmed on place of the original.
Even experts rarely memorise the pin numbers, they think in terms of pin names
In a Schematic diagram, pins are always labelled with their names.
Hand-drawn is ok, as long as it is neat and readable.
You don't need these. The chip can run using it's 8MHz internal oscillator and this is fine for 95%+ of projects. This means you also get 2 more pins to use, which is often more valuable than some extra speed.
What you do need, and seems to be missing, are bypass capacitors. These should be 0.1uF ceramic capacitors and should be connected between VCC pins and ground. So for atmega328 you need 2 of them for the VCC and AVCC pins. They should be positioned as close to the pins as you can.
It's also wise to add a 10K resistor between the RST pin and VCC.
@pidzisbox note that if you have already set the fuses on the ATmega328 microcontroller to use an external clock, then removing the external oscillator as suggested by @PaulRB will "soft brick" the ATmega328. If you want to do that, then you must set the fuses on the ATmega328 to use its internal oscillator before you remove the external oscillator.
If this is something you want to do, you will need to use a board definition that is configured for the internal clock. This is provided by the excellent 3rd party "MiniCore" boards platform. You will find installation instructions for MiniCorehere, and information about configuring MiniCore it for the internal oscillator here.