Got an 3.97 LCD with ST7793 controller and resolution 400240pix. It seems to have problem with graphictest_kvb scroll function. It moves band of uninitialized memory across the screen. I suspect it is because chip is 432240 and screen only 400*240.
Hi David.
Can I change the TFT LCD digital pin (LCD_D0 to LCD_D7)?
Maybe to pin 22 to 29.
Because I need the PWM pin for my system output.
How to do that?
Thanks.
Yes, you can verify your wiring with those defines in ithe LCD_ID_readreg sketch.
But it is a very odd choice of wiring. It requires me to write the SPECIAL for you. Life would be simpler if you just copied my existing HOME_MADE_PROTOSHIELD
Thanks for your efforts to help support all of the displays out there.
Similar to a recent question about changing the mapping for some of the pins on the mcuFriend shield I need to free up D0 on pin 8 because I need to use the Input control function for the 16 bit timer and this is only on pin 8 for the Uno. Am I correct in that all I need to do is to move the D0 input to the LCD module to Pin 10 (I am not planning on using the SD reader)? Other than the hardware change can this be accomplished by simply declaring in my Sketch:
#define LCD_D0 10
and this will override the value that is in the library?
Also I do not understand what you mean when you say "there has always been a SPECIAL that does exactly this." I am not trying to make work for you but I am a bit new and do not quite understand.
Thanks again for the post for the SPECIAL for the mcufriend_kbv library.
I have tried using intuition as to how to utilize the special, unfortunately my attempts are not working.
I do not know what to do to the library or sketch to accommodate the special.
I have tried taking the content you posted and creating a mcufriend_special.h file with the contents and adding the define statement you posted to my sketch. The sketch compiled fine but no changes were seen and the display did not work without pin 8 going to D0.
I am afraid that I have the fix but do not know how to apply the fix. Sorry for not knowing better but I am very new to this platform.
You must define USE_SPECIAL for it to even include the mcufriend_special.h
If it finds a suitable SPECIAL, it will use it. Otherwise it just uses the regular shield code.
So you are editing two files.
If you do not understand, buy a pencil and trace through the header files.
Yes, they are enormous. But only a few lines are actually used. i.e. when an #if block is true.
I do understand what to do and I have made the necessary edits as you suggested to both the mcufriend_special and the mcufriend_shield files in the utility directory for the library.
I turned on the line that invokes the special in the mcufriend_shield file (#define USE_SPECIAL ).
I added the code you sent me to the content of the special file and made sure #define USE_D0_ON_D10 was the only use line not commented out.
Unfortunately I cannot get the compiler to work and I get the following error message. It does not look like you defined the CMASK in the special.
"C:\Users\tkillam\Documents\Arduino\libraries\MCUFRIEND_kbv-master\utility/mcufriend_special.h:944:50: error: 'CMASK' was not declared in this scope #define setWriteDir() { DDRB |= BMASK; DDRC |= CMASK; DDRD |= DMASK; }
^* C:\Users\tkillam\Documents\Arduino\libraries\MCUFRIEND_kbv-master\MCUFRIEND_kbv.cpp:320:9: note: in expansion of macro 'setWriteDir'
setWriteDir();*
^* exit status 1 Error compiling for board Arduino/Genuino Uno." I think everything else is OK. As always thanks for your help and patience. Thomas Killam