Relation between actual pins and header number

hii

i have mu own custom board for arduino and lets say i want to use pins of port E
PE7, PE4

now in the file pins_arduino.h

pins_arduino.h i can see that pin PE4 can be defined as pin number 2 but where i can find the pin number for PE7 , it is not defined in the pins_arduino.h!!

i need the number for PE7 to declare my own define in my code

i be glad for help

And which processor are you using for this custom board ?

hii atmega2560 :slight_smile:

Assuming you are using an Atmega2560 as used on the Mega, PE7 is not connected, so there would be no need for a reference in the pins_arduino.h file.

See the schematic https://www.arduino.cc/en/uploads/Main/arduino-mega2560-schematic.pdf

your would need information:
what chip is used in your case
what CPU frequency is used
If it matches any "standard" arduino board just use table Ardino<-> port & pin number table from the "standard" board documentation

Try Megacore, that supports all the pins on the 2560.

hii thanks , but for example if i wand to use PE7 to read an digital input how do i use this pins

lets say for PE4 in setup i can use something like
pinMode(2, INPUT);

and
digitalRead(2); to read the pin

how can i do the same for PE7

You need to make a custom board support package and create your own pins_arduino.h

do you have an example for custom board package that can illustrate the point,thanks

No I do not, maybe another forum menber has one.

atmega2560

see the existed board definitions in the megacore as an example