Im struggling to find the answer to this - and i'm sure the question must have been asked before, so apologies if I haven't searched using the correct terms.
I'm starting the move to using a bare microcontroller (in this case a 328p) in a project where I am going to build the pcb myself, and program the 328p in circuit.
What I am struggling with is understanding how to 'map' the pins of, say, a nano board to the 328p when writing the code.
Can someone point me to the working out / understanding which pin arduino thinks is pin 1 on the nano and how it is going to address that on the 328p (its a tqfp package).
If it is a part from an official board, and using the official board definitions, just Google "arduino pinout" and the part number. There are some great diagrams for '328p.
If it is a part not used on an official board, or you are using a third party board package for it (ex, a 328pb with minicore, or an attiny with one of my cores), a pinout diagram will be in the documentation included with the third party board package.
DrAzzy:
If it is a part from an official board, and using the official board definitions, just Google "arduino pinout" and the part number. There are some great diagrams for '328p.
If it is a part not used on an official board, or you are using a third party board package for it (ex, a 328pb with minicore, or an attiny with one of my cores), a pinout diagram will be in the documentation included with the third party board package.
Ah - yes my original question didn't really make clear what I am struggling with, which I thought might be the case.
So say for example I write in the arduino IDE
digitalWrite (4, LOW);
This sends digital pin 4 on the nano board low.
However the bare microcontrollers do not have neatly numbered digital I/O pins, they have a series of ports so for example Port B I/O number 3 (PB3).
So what I guess I am asking, is where abouts I find the conversion table for how the arduino IDE 'looks up' what digital pin 4 is for example when writing to the port on the microcontroller.
I hope that makes more sense?... its still a bit muddled I guess.
they show the arduino pin number, the port number (eg, PC2), the analog pin number (if applicable), list any special functions, all showing which physical pin that corresponds to
they show the arduino pin number, the port number (eg, PC2), the analog pin number (if applicable), list any special functions, all showing which physical pin that corresponds to
Thanks - the pinouts I have been using / seen have never included the arduino pin reference as per the one you posted, which is why I have been struggling.
Having done another google search (the same one I think I did the first time - 'atmega 328pu tqfp pinout' a few of them have the arduino pins listed, just by chance I must have only clicked on the ones that didn't or I would not have asked the question!