Hi everyone, I am trying to interface a TFT display in the Arduino Due, however I need to use the "PORTC = " command instead of the digitalwrite command in order to have the fastest speed to drive the display. But the program cannot compile and it said"error: 'portC' was not declared in this scope" , while I can compile the same program without any problem if I select Arduino Uno.
I cannot believe they took out this simple command for Aruduino Due, what is the point ???
P.S is there other way to write the port faster than "digitalwrite" ?
PORTC = is not a command, it is an assignment statement. The only reason you would get such an error is if PORTC is not defined. Have you looked the the SAM3X datasheet and looked to see what it calls its various IO ports?
In an 8 bit micro controller the output ports are 8 bits wide. PORT C is one such.
On a 32 bit processor the output ports are 32 bits wide. The Due's processor does not have a PORT C it has a PC
This shows the mapping:-
However the extra functions on the pins mapped to PORT C on the 328 chip are not the same on the Due chip. So even when you define the port correctly in your code it will not work.
I am trying to interface a TFT display in the Arduino Due
You may use the EMB SMC bus - with Parallel library - it could be used for displays as well. There is an example for connecting an LCD too…
The replacing register is REG_PIOC_ODSR afaik.
thanks you all, I will take a look in the SAM datasheet first.