You don't seem to have any provision for programming the ATmega328P. You should, at a minimum, have an ICSP header. That will let you upload a sketch with an ISP device. If you want to use a bootloader or provide for debug serial output, you will need at least a programming header and external USB-to-Serial adapter ("FTDI Cable").
Even if you are making your own PCB, it makes little sense to use a raw ATmega328 when Pro Mini modules are inexpensive and automatically contain all the parts you need.
And as @johnwasser points out, you need to provide for programming. A Pro Mini can be mounted as a "daughterboard" to your main PCB.
Not sure why you have your four way selector switch connected to 5 V, why you have a 100 Ohm series resistor or why you have capacitors attached. Or indeed why you connect all four ways on the switch as the fourth position is denoted by the absence of the other three.
Connecting the switch to ground is far more sensible and practical, you do not need the capacitors and could probably make do with the internal pull-ups.
@johnwasser
Thanks for your feedback ! I was planning to use the TP (testing points) to connect my FTDI to the PCB.
I have followed your feedback and introduced a J1-FTDI to provide proper connectivity for programming.
See updated picture.
Even if you are making your own PCB, it makes little sense to use a raw ATmega328 when Pro Mini modules are inexpensive and automatically contain all the parts you need.
You are right, but I would like to have a single PCB as constain (soldering, will be also a good challenge)
Not sure why you have your four way selector switch connected to 5 V, why you have a 100 Ohm series resistor or why you have capacitors attached. Or indeed why you connect all four ways on the switch as the fourth position is denoted by the absence of the other three.
Connecting the switch to ground is far more sensible and practical, you do not need the capacitors and could probably make do with the internal pull-ups.
Thanks a lot, this looked very complicated for nothing. I will rework the whole switch part and repost it.
What is with all the test points and resistors?
I wanted to used the TP in order to connect my FTDI -> Already corrected. About the resistors I have read that adding small resistor to external interface would be a good idea. According to your remark this isn't ...
It may be a good idea if the external device is subject to accidental mis-connection. That should be extremely unlikely if it is your programming adapter.
Of course, as always you would shut down the power while you connect and disconnect the adapter. We all do that don't we?
@johnwasser
I wanted to use a Arduino Duemilanove board I have around to burn the bootloader as decribed here.
Do you see any limitation / issue of this approach regarding my current design ?
The problem is that you are using a QFP chip on a PCB and not a DIP chip in a breadboard. How did you plan to connect your Arduino board (as ISP) to the tiny pins on your surface-mount chip? That is why you should add an ICSP header.
@johnwasser
Thanks a lot for pointing this out. I have updated the schematic.
2 questions:
Since I am using the SPI interface to interface the TMC2130 and the ATMEGA328, will the burning of the boot loader be successful if on the MOSI/MISO/SCK.. BUS there are 2 chips connected ?
Just to confirm the ICSP header will be used to burn the boot loader, the usual flashing operations will be done using the FTDI port right ?
It should work. You may want a pull-up resistor on the CS pin of the TMC2130 so it keeps off the SPI bus.
The ICSP header can be used to both burn a bootloader and upload sketches. The FTDI header can only be used to upload sketches and only if a bootloader has been burned first.
I recommend you order a USBasp ISP device. It's MUCH easier to use the ICSP header that way and they cost less than $10 (See: eBay or Amazon).