# Specifying Pins

Pins can be specified by Arduino pin number or by AVR port and pin/bit number. The syntax used for avr port and pin number is PIN_Pb where Pb represents a PORT and a bit#. For example, to specify port D bit 3 you would use PIN_D3 The following sets glcdCSEL1 (the first chip select) to port D bit 3

    #define glcdCSEL1       PIN_D3 //example of using AVR Port and bit number

There are no restristions as to which Arduino/AVR pins are used. Any Arduino/AVR pin on any port can be used for any glcd function. Simply specify the pin and at compile time, the code will automagically figure out the best possible mode for the configured pins and generate the smallest/fastest code including single instructions when possible. If all the data pins are on the same AVR port and in the proper order, byte mode will be used, if pins span ports but are are sequential and nibble aligned, then nibble mode will be used. The code will drop down to individual bit i/o if necessary. The code is even smart enough to use nibble mode for one nibble an then bit i/o for the other bits in the data byte.

While the code does support any Arduino/AVR pin for any glcd function, if pins are grouped appropriately on the AVR ports, the code can take advantage of byte or nibble mode to offer a potential performance increase.

Note:
  See the avrio.h file for more details.

All Classes Functions Variables