Go Down

Topic: MCUfriend_kbv not working with R61505W and R61505V LCD Driver Chip (Read 739 times) previous topic - next topic


 Yes, The ILI9340 is working fine .All the colors, directions and Software Scroll work 100% with Uno R3.

But when I am trying to using it with BLUE PILL it is identifying as 0xD3D3. but LCD_ID_Readreg is identifying it correctly. and result is same as previous.

Already I have modified and put the blocks of code as you posted last in mcufriend_special.h header file.

I am ready to do more testing as you advise to find fruitful solution for 0x1505.


I have posted a test_1505 branch on GitHub.
If you are running GitHub on your local PC,   you can just select that Branch.

If you are simply using the Library Manager,   clicking on [More Info]  takes you to GitHub.
Select the branch.   Download as ZIP.   Then install from ZIP.

I think you might have to use the Library Manager to delete the current MCUFRIEND_kbv library before you can install from a ZIP.

My new branch should detect the ILI9340 and the R61505 on the BluePill.
It might run the R61505 on the Uno.



Hi David,


Now code is working with bluepill, colors, scrolling and direction all working fantastic with STM32F103C8T6.

Nice piece of work. Only remaining piece is how to play 0x1505.

Now Wiring change to

Put All
Cotrol register under GPIOA
#define LCD_RD  PA0    
#define LCD_WR  PA1    
#define LCD_RS  PA2    
#define LCD_CS  PA3    
#define LCD_RST PA4  

And Data into GPIOB
#define LCD_D0  PB8  
#define LCD_D1  PB9  
#define LCD_D2  PB10
#define LCD_D3  PB11
#define LCD_D4  PB12
#define LCD_D5  PB13
#define LCD_D6  PB14
#define LCD_D7  PB15


So I think we can move to start testing with 0x1505


Just see your reply, So want to share you I am using the mcufriend 2.9.6 lib.After modifying code. as suggested by you.It is working well. and sketch is now able to identifying LCD ID as 0x9340.


I solder a BluePill onto a Protoshield pcb.   Then solder flying wires from the BluePill to the Arduino header sockets.

This means that I write a SPECIAL once for this wiring scheme.
Then I simply unplug the Ilitek display and plug in the Renesas display.

I can move a display from Uno, Mega, Zero, ..., Teensy,  BluePill,  Nucleo, LogicGreen, ...

Have you tried tft.begin(0x9320); on your Renesas display?



Yes, After changing the ID to 0x9320.
I got response.

Code has given below for this.
 uint32_t when = millis();
 //    while (!Serial) ;   //hangs a Leonardo until you connect a Serial
 if (!Serial) delay(5000);           //allow some time for Leonardo
 Serial.println("Serial took " + String((millis() - when)) + "ms to start");
 tft.reset();                 //hardware reset
 uint16_t ID = tft.readID(); //
 Serial.print("ID = 0x");
 Serial.println(ID, HEX);
 if (ID == 0xD3D3) ID = 0x9481; // write-only shield
 if(ID=0x1505) ID=0x9320;
 //ID = 0x9320;                             // force ID

The Screen is displaying all colors. So only thing to check it with Bluepill.

Let me check and update you.


Sep 10, 2017, 03:00 pm Last Edit: Sep 10, 2017, 03:33 pm by Ravi_kanchan2004 Reason: .
Hi David,

I have downloaded and install the lib from test_1505. It is working partially until I commented the following line in mcushield_friend.h file.

//#define SSD1289_JUMPERS 2

After commented this the whole test was working fine.

The other thing is:-

With ILI9340 I found some color problem. Color is not displaying correctly. for example blue display as yellow. red display as light blue.

Please check the attached zip file which contains screenshot as displayed during gfx demo.


Hi David,

I have downloaded and install the lib from test_1505. It is working partially until I commented the following line in mcushield_friend.h file.

//#define SSD1289_JUMPERS 2

After commented this the whole test was working fine.
The SSD1289 macro should not make any difference to anything unless you #define USE_SSD1289_SHIELD_UNO.
Does tft.begin(0x1505); work properly?
Are the colours correct?
Is the SoftwareScroll correct?
Note that Band Scroll moves the whole screen on a ILI9320 class of controller.

The ILI9340 is just showing "Inverted Colours".   Either call tft.invertDisplay(1); at the bginning of loop() or edit MCUFRIEND_kbv.cpp
Code: [Select]

    case 0x9340:
        _lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | MV_AXIS | READ_24BITS | REV_SCREEN;
        goto common_9341;
    case 0x9341:
        _lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | MV_AXIS | READ_24BITS;

I will add this to the Master Branch for the next Release.   I wish that other users would report things like "Inverted Colours"



All the colors on 0x1505 are displaying correct.
SoftwareScroll is working fine. but faster then Arduino.

All the thigs are working fine with ILI9320 class of controller except color.
So let me check and update you.


Please be more accurate.

1.  does tft.begin(0x1505) work 100% ?   i.e. with no changes from my GitHub test_1505 branch.
2.  does tft.begin(0x9320) work 100% ?   i.e. edit setup() in graphictest_kbv.ino
3.  is 0x1505 better than 0x9320 ?

Yes,  of course the STM32 will be faster than a Uno.

If 0x9320 works as well as 0x1505,   I will simply move the case 0x1505: to the 0x9320 block.

Did you see how I added the USE_RAVI code to the SPECIALs ?
What had you done differently?



Bump.   Please answer those two questions. Or ask if you don't understand.

I would like to resolve any remaining R61505 problems and close this Branch.
Then I can merge into the Master Branch for a new Release.



Sorry for delay response.

During the testing I observe the given below results.in both cases: (with 0x1505 and 0x9320)
i) Graphics demo is working perfect.
ii) All the slides are working fine.
iii) Scrolling is working.
iv) color grades are displaying properly.

results are similar in both cases.
I saw USE_RAVI_KANCHAN_BLUEPILL in mcufriend_special.h file.

But I found during scroll, the font shape is going to disturb, may be possibly some optimization in code require .

and other thing I want to know that  how to I can use touch.


You have an ILI9340 and a R61505U.   The Software Scroll should look exactly the same i.e. yellow text moving sideways across the screen.  

Band Scroll on the ILI9340 will just scroll the small Band.
Band Scroll on a R61505 (or any other ILI9320 style) will move the whole screen by 64 rows.

I am not at a PC.   You should find that the TouchScreen_Calibr_new example from your test_1505 Branch should diagnose your Touch Pins,  Calibrate and report to both TFT and Serial Terminal.

You should find that the TouchScreen_Calibr_native example from your test_1505 Branch should diagnose your Touch Pins,  Calibrate and report to both TFT and Serial Terminal.

If you have a problem,  copy-paste the Serial Terminal to your message.

Thanks very much for your feedback.   It makes all the difference.   (previous 9340 and 1505 users went silent)


Edit.  I have updated your "test_1505" Branch on GitHub.  And merged your R61505U and ILI9340 changes to the Master Branch.   Also added the Beta TouchScreen_Calibr_native sketch to the examples.


Hi David,

I have tested various example of touch screen. I observe the given below results.

i)   touch is working fine.

ii)  The return X and Y co-ordinate value is not accurate.I think reason of behind is 10 bit and 12 bit ADC .Arduino have 10bit and STM32 have 12 bit ADC.

iii) Can you please suggest me that the voltage which is I am using with LCD in current is 3.3 v (I am not using 5 v with                                                               Arduino) will change the behaviour of touch screen output.

iv) while I am not touching the Touch it is also returning some random value.

The Pin sketch has given below:-

#define XM  PA2
#define YP  PA1
#define XP  PB14
#define YM PB15

I am using the given below touch_screen_lib: 

in source code I found that LIB already have 12bit ADC aware code. But I am not understanding why accurate co-ordinate is not return while reading.So need some advise regarding this. if you know any other Lib which I can use with mcufriend_kbv please suggest me.


My apologies.    The TouchScreen_Calibr_native example was not tested when I put it on your Branch.
I have just updated your "test_1505" Branch with the corrected sketch.

Note that it is not really possible to diagnose the Touch Pins on an ARM.   So you will need to do it manually.

Both TouchScreen_Calibr_native and TouchScreen_Calibr_new examples should work on your STM32.

I have never tried SteveStrong's Touch library.   Steve uses the Maple Core which returns the wrong ADC resolution.    The STMicroelectroncs Core returns the correct 10-bit ADC result.   My example should work with both Cores.

Please let me know how you get on.   I am happy to test Screens plugged into proper Shield headers like the Nucleo.
I have no intention of choosing some custom SPECIAL wiring.


Go Up