I am trying to use an Adafruit 2.8in TFT with capacitive touchscreen on a Mega 2560 board.
I know the SPI pins are different than an Ono so where do I change the SDI pin assignment in the include files??
I am an experienced embedded C programmer as well as an EE of 40 years. I was writing raw SPI drivers long before they were included in the libraries so I know how it works. iust need the location of where these are assigned in the ILI9341 library?
The assignment may be done automatically by the library. It is informed via the Arduino IDE which Arduino board you have chosen, and each has its specific set of definitions for "standard" pins. And of course, you need to physically wire the display to the correct pins.
You usually have some freedom as to which pin is chosen for SS.
Well nowhere on the 2560 board or in the PINOUT diagram are SPI pins defined. Somewhere in the code there has to be a processor specific pin assignment for the SPI signals. ANY microcontroller with at least three I/O pins is capable of generating SPI packets.
So where is MEGA2560.h or what ever they call it located?
Habit I guess. Multiple protocols? Just write a function as required. Like I do for the serial ports. When I started with 8051s there were no I/O functions pre written. You had a standard K&R C compiler with a relocator for the specific processor and that was it. When I had to use VGA chips, you programmed the registers one by one as needed.
Not only faster, they also are independent from any other signals (interrupts...). Hardware can receive further data by UART or I2C while you are bit banging SPI. Hardware also can output multiple PWM pulses without dependencies on any other signals.