Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 06:16 12 May 2021 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Armmite F4: PCB adaptor for IPS/OTM8009A 800*480 LCD

Author Message
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 1338
Posted: 04:58pm 13 Apr 2021
Copy link to clipboard 
Print this post

This adaptor enables you to use the 16-bit IPS/OTM8009A LCD with the F4--converting the 32 pins to the 34-pin IPS.

One anomaly I noticed--if I power-cycled after OPTION LCDPANEL IPS_4_16,L without doing OPTION TOUCH, the LCDPANEL setting reverted to the default. After OPTION TOUCH PB12, PC5 all was fine.

The image is very crisp--this photo doesn't do it justice (aside from the fact that the screen is highly reflective and in the camera, catches what is facing it--though not so noticeable when not taking a picture).



Another anomaly: SAVE IMAGE did a very poor job of rendering the screen, especially compared to the SSD1963 and other displays.



The adaptor works with the F4 hat PCB recently published, and so also with the 2x20 expansion port PCB.

Attached are the zipped gerber files which can be sent directly to JLCPCB, and the EagleCad .sch and .brd files.

F4_800_LCD_2021-02-22.zip

F4_800_LCD.zip
 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 498
Posted: 10:43pm 13 Apr 2021
Copy link to clipboard 
Print this post

Hi Lizby,
It looks like the colours are not being mapped properly when doing the save image. I will see what it does for me.Its saving enough pixels, just not the correct colours.

Do you have the pump controller demo converted to run 480 * 320. If so can I have a copy to reference for the manual.

Regards
Gerry
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 1338
Posted: 12:28am 14 Apr 2021
Copy link to clipboard 
Print this post

Hi, Gerry,

The pump controller demo is just the 320x240 version. I can try converting it to 480x320 if you like.
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 1338
Posted: 02:04am 14 Apr 2021
Copy link to clipboard 
Print this post

Here's the 480x320 version. I basically increased all the X,Ys and the widths and heights by 50%, and changed font 1 to font 4 and font 2 to font 5. And then fiddled to adjust.



'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Demonstration program for the Micromite+
' It does not do anything useful except demo the various controls
'
' Geoff Graham, October 2015
'   Modified to 480x320 by Lance Benson (lizby) April 2021
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Option Autorun On
Option Explicit
' gui calibrate

Dim ledsY
Colour RGB(white), RGB(black)
' reference numbers for the controls are defined as constants
Const c_head = 1, c_pmp = 2, sw_pmp = 3, c_flow = 4, tb_flow = 5
Const led_run = 6, led_alarm = 7
Const frm_alarm = 20, nbr_hi = 21, nbr_lo = 22, pb_test =23
Const c_hi = 24, c_lo = 25
Const frm_pump = 30, r_econ = 31, r_norm = 32, r_hi = 33
Const frm_log = 40, cb_enabled = 41, c_fname = 42, tb_fname = 43
Const c_log = 44, cb_flow = 45, cb_pwr = 46, cb_warn = 47
Const cb_alarm = 48, c_bright = 49, sb_bright = 50
' now draw the "Pump Control" display
CLS
dim integer f1=4,f2=5
' LB GUI Interrupt TouchDown, TouchUp
' display the heading
Font f2 : GUI Caption c_head, "Pump Control", 10, 0
Font f1 : GUI Caption c_pmp, "Pump", 10, 37, , RGB(brown)
' now, define and display the controls
' first display the switch
Font f1
GUI Switch sw_pmp, "OFF|ON", 10, 67, 115, 50, RGB(white),RGB(brown)
CtrlVal(sw_pmp) = 1
' the flow rate display box
Font f1 : GUI Caption c_flow, "Flow Rate", 5, 119,, RGB(brown),0
Font f2 : GUI Displaybox tb_flow, 5, 150, 157, 37
CtrlVal(tb_flow) = "20.1"
' the radio buttons and their frame
Font f2 : GUI Frame frm_pump, "Power", 5, 210, 157, 135,RGB(200,20,255)
Font f1
GUI Radio r_econ, "Economy", 22, 240, 12, RGB(230, 230, 255)
GUI Radio r_norm, "Normal", 22, 277
GUI Radio r_hi, "High", 22, 315
CtrlVal(r_norm) = 1 ' start with the "normal" button selected
' the alarm frame with two number boxes and a push button switch
Font f2 : GUI Frame frm_alarm, "Alarm", 172, 172, 147, 172,RGB(green)
Font f1
GUI Caption c_hi, "Hi:", 180, 225, LT, RGB(yellow)
GUI Numberbox nbr_hi, 230,MM.VPos-6,70,MM.FontHeight+6,RGB(yellow),RGB(64,64,64)
GUI Caption c_lo, "Lo:", 180, 262, LT, RGB(yellow),0
GUI Numberbox nbr_lo, 230,MM.VPos-6,70,MM.FontHeight+6,RGB(yellow),RGB(64,64,64)
GUI Button pb_test, "TEST", 187, 300, 105, 37,RGB(yellow), RGB(red)
CtrlVal(nbr_lo) = 15.7 : CtrlVal(nbr_hi) = 35.5
' draw the two LEDs
Const ledsX = 187, coff = 75 ' define their position
ledsY = 75 : GUI LED led_run, "Running", ledsX, ledsY, 15, RGB(green)
ledsY = ledsY+37 : GUI LED led_alarm, "Alarm", ledsX, ledsY, 15, RGB(red)
CtrlVal(led_run) = 1 ' the switch defaults to on so set the LED on
' the logging frame with check boxes and a text box
Colour RGB(cyan), 0
Font f2
'GUI Frame frm_log, "Log File", 210, 10, 110, 160, RGB(green),0
GUI Frame frm_log, "Log File", 343, 15, 220, 240, RGB(green)
Font f1
GUI Checkbox cb_enabled, "Log On", 350, 30, 30, RGB(cyan)
GUI Caption c_fname, "File Name", 350, 67
GUI Textbox tb_fname, 350, 90, 195, 30, RGB(cyan), RGB(64,64,64)
GUI Caption c_log, "Record:", 350, 127, , RGB(cyan), 0
GUI Checkbox cb_flow, "Flow", 358, 150, 30
GUI Checkbox cb_alarm, "Alarms", 358, 180, 30
GUI Checkbox cb_warn, "Warnings", 358, 210, 30
CtrlVal(cb_enabled) = 1
CtrlVal(tb_fname) = "LOGFILE.TXT"
' define and display the spinbox for controlling the backlight
GUI Caption c_bright, "Back Light", 368, 275,,RGB(200,200,255),0
GUI Spinbox sb_bright, 353, 315, 165, 37,,,10, 10, 100
CtrlVal(sb_bright) = 100
' All the controls have been defined and displayed. At this point
' the program could do some real work but because this is just a
' demo there is nothing to do. So it just sits in a loop.
Do : Loop
' the interrupt routine for touch down
' using a select case command it has a different process for each
' control
Sub TouchDown
Select Case Touch(REF) ' find out the control touched
Case cb_enabled ' the enable check box
If CtrlVal(cb_enabled) Then
GUI Restore c_fname, tb_fname, c_log, cb_flow, cb_alarm, cb_warn
Else
GUI Disable c_fname, tb_fname, c_log, cb_flow, cb_alarm, cb_warn
EndIf
Case sb_bright ' the brightness spin box
BackLight CtrlVal(sb_bright)
Case sw_pmp ' the pump on/off switch
Print CtrlVal(sw_pmp)
CtrlVal(led_run) = CtrlVal(sw_pmp)
CtrlVal(tb_flow) = Str$(CtrlVal(sw_pmp) * 20.1)
CtrlVal(r_norm) = 1
Case pb_test ' the alarm test button

Open "Test.txt" For Append As #1
Print "File Opened"
Print #1, "Hello World", Time$
Print "Hello World", Time$
Close #1
Print "File Closed"

CtrlVal(led_alarm) = 1
GUI beep 250
Case r_econ ' the economy radio button
CtrlVal(tb_flow) = Str$(CtrlVal(sw_pmp) * 18.3)
Case r_norm ' the normal radio button
CtrlVal(tb_flow) = Str$(CtrlVal(sw_pmp) * 20.1)
Case r_hi ' the high radio button
CtrlVal(tb_flow) = Str$(CtrlVal(sw_pmp) * 23.7)
End Select
End Sub
' interrupt routine when the touch is removed
Sub TouchUp
Select Case Touch(LASTREF) ' use the last reference
Case pb_test ' was it the test button
CtrlVal(led_alarm) = 0 ' turn off the LED
End Select
End Sub
 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 498
Posted: 06:24am 14 Apr 2021
Copy link to clipboard 
Print this post

Hi Lance,

Try this LCD Integrity test program and see what the results are. One of my OTM8009As passes every time, one does get a couple of pixels wrong about half the time, so something may be marginal, I think on the reading side.

Are you running the display on 3.3v (I am) and is it just from USB power or a good 5v source.
Regards
Gerry

  Quote  'Program to verify LCDPanel read and write
'Writes a pixel to every point and reads it back to check
'Does a BLIT and check is still correct
Option explicit
Option default NONE

Dim INTEGER s,t, x, y, r, red, green, blue, c, b,i=0
Dim INTEGER x1,y1,la
Dim INTEGER x2,y2,tp,hmax,vmax,shorttest
DIM Integer pwr=0,pb=0,tx=0,ty=0,tbx=0,tby=0,pir=0,pirw=0,top,bottom
DIM Integer pwre=0,pbe=0,txe=0,tye=0,tbxe=0,tbye=0,pire=0,pirwe=0
DIM INTEGER myWHITE,rgbWHITE,nearWHITE,getscanlineSupported=1,blitsupport=1
myWHITE=
RGB(&HFF,&HFF,&HFF)
'myWHITE=RGB(&HF8,&HFC,&HF8)
'nearWHITE=RGB(&HF8,&HF0,&HF8)
rgbWHITE=RGB(&HF8,&HFC,&HF8)

CLS
if MM.INFO$(LCDPANEL)="ILI9341" then getscanlineSupported=0
if MM.INFO$(LCDPANEL)="ILI9488" then getscanlineSupported=0
if MM.INFO$(LCDPANEL)="ILI9481" then getscanlineSupported=0:blitsupport=0
if MM.INFO$(LCDPANEL)="ILI9486" then getscanlineSupported=0
if MM.INFO$(LCDPANEL)="ST7789" then getscanlineSupported=0:blitsupport=0

shorttest=
1
If shorttest=0 then
 vmax=
MM.VRES-1
 hmax=
mm.hres-1
else
 vmax=
99
 hmax=
99
endif  
tp=(vmax+
1)*(hmax+1)
?
"LCDPANEL Integrity Test Armmite F4"
?
"----------------------------------"

if shorttest=0 then
?
"Long Test - All pixels tested"
else
?
"Short Test - 100*100 pixels tested"
endif
? MM.INFO$(
LCDPANEL)
? MM.INFO$(LCDPANELID)
backlight 50

?
"TEST RGB colour order"
CLS RGB(RED)
TEXT MM.HRES/2,MM.VRES/2,"RED","CM",1,6,RGB(BLACK),RGB(RED)
pause 1000
CLS RGB(GREEN)
TEXT MM.HRES/2,MM.VRES/2,"GREEN","CM",1,6,RGB(BLACK),RGB(GREEN)
pause 1000
CLS RGB(BLUE)
TEXT MM.HRES/2,MM.VRES/2,"BLUE","CM",1,6,RGB(BLACK),RGB(BLUE)
pause 1000
CLS RGB(BLACK)
TEXT MM.HRES/2,MM.VRES/4,"WHITE","CM",1,3,RGB(WHITE)
TEXT MM.HRES/2,MM.VRES/2,"on","CM",1,3,RGB(WHITE)
TEXT MM.HRES/2,3*MM.VRES/4,"BLACK","CM",1,3,RGB(WHITE)
pause 1000
? "**************************************************"
? "  BACKLIGHT TEST 10-100%                          "
? "**************************************************"

CLS RGB(BLUE)
for x=10 to 100 step 10
   backlight x
   pause 1000
  ' TEXT MM.HRES/2,2.2*x,"BACKLIGHT "+str$(x),"CM",1,2,RGB(RED)
  ' TEXT MM.HRES/2,2.2*x,"BACKLIGHT "+str$(x),"CM",1,2,RGB(BLUE)
   TEXT MM.HRES/2,2.2*x,"BACKLIGHT "+str$(x),"CM",1,2,RGB(white)
   pause 800
next x


backlight 50
? "**************************************************"
? "  TRANSPARENT TEXT TEST                          "
? "**************************************************"
CLS rgb(CYAN)
Text mm.hres/2,50,"TRANSPARENT",CM,2,1,RGB(RED),-1
Text mm.hres/2,100,"TEXT",CM,2,1,RGB(RED),-1
if blitsupport=1 then
Text mm.hres/2,150,"SUPPORTED",CM,2,1,RGB(BLACK),RGB(WHITE)
else
Text mm.hres/2,150,"NOT SUPPORTED",CM,2,1,RGB(RED),RGB(WHITE)
endif
pause 3000


? "************************************"
? " Doing write to Pixels colour gradiant"
? " and then read of pixels."
? "************************************"
? "writing ",tp," pixels..."
cls
timer=0
for x1=0 to hmax
 for y1=0 to vmax
   c=RGB((x1<<3 AND &HF8 )OR 5 ,((x1+y1)<<2  and &HFC) or 1 ,(y1<<3 and &HF8) or 2)
   PIXEL x1,y1,c
 NEXT
NEXT
? timer," mSec"
if blitsupport=1 then
? "reading ",tp," pixels..."
timer=0
for x1=0 to hmax
 for y1=0 to vmax
   i=i+1
   c=RGB(x1<<3 AND &HF8 ,(x1+y1)<<2 and &HFC,y1<<3 and &HF8)
   r=PIXEL (x1,y1)
  ' r=r and &HF8FFF8
   if r=c then
     s=s+1
   else
     if t=0 then ? "Pixels not read as written"
     if t<20 then
       ?
       ? BIN$(c,24)," @ ",x1,y1
       ? BIN$(r,24)        
       
     end if
     t=t+1
     
   endif
   if i>10000 then
     ? ".";
     i=0
   endif  
 NEXT
NEXT
?
? timer," mSec"
? "correct pixels ",s
? "incorrect pixels",t
? "total pixels",s+t
 if t=0 then pwr=1
 pwre=t

?
? "************************************"
? "Doing BLIT - blit 0,0,0,0,100,100"
? " and re read of pixels."
? "************************************"


blit 0,0,0,0,100,100
s=0:t=0:i=0
? "reading ",tp," pixels after blit ..."
timer=0
for x1=0 to hmax
 for y1=0 to vmax
   i=i+1
   c=RGB(x1<<3 AND &HF8,(x1+y1)<<2 and &HFC,y1<<3 and &HF8)
   r=PIXEL (x1,y1)
   if r=c then
     s=s+1
   else
     if t=0 then ? "Pixels not read as written"
     if t<20 then
       ?
       ? BIN$(c,24)," @ ",x1,y1
       ? BIN$(r,24)        
       
     end if
     t=t+1
     
   endif
   if i>10000 then
     ? ".";
     i=0
   endif  
 NEXT
NEXT
?
? timer," mSec"
? "correct pixels ",s
? "incorrect pixels ",t
? "total pixels",s+t
if t=0 then pb=1
pbe=t
endif
if mm.info$(SDCARD)="Ready" then

 ?
 ? "************************************"
 ? "Doing  SAVE IMAGE TEST.BMP ,0,0,100,100"
 ? "then  RESTORE IMAGE TEST.BMP 0,0"
 ? " and re read of pixels."
 ? "************************************"

 if blitsupport=1 then
    SAVE IMAGE "TEST.BMP", 0,0,100,100
    ? "Image saved as TEST.BMP"
 endif
 CLS
 pause 2000
 ? "Loading Image TEST.BMP"
 LOAD IMAGE "TEST.BMP" , 0,0
 TEXT 20,150, "Image Loaded above"
 PAUSE 5000
 s=0:t=0:i=0
 IF blitsupport=1  then
   ? "reading ",tp," pixels after LOAD IMAGE ..."
   timer=0
   for x1=0 to hmax
   for y1=0 to vmax
     i=i+1
     c=RGB(x1<<3 AND &HF8,(x1+y1)<<2 and &HFC,y1<<3 and &HF8)
     r=PIXEL (x1,y1)
     if r=c then
       s=s+1
     else
       if t=0 then ? "Pixels not read as written"
       if t<20 then
         ?
         ? BIN$(c,24)," @ ",x1,y1
         ? BIN$(r,24)        
       
       end if
       t=t+1
     
     endif
     if i>10000 then
       ? ".";
       i=0
     endif  
   NEXT
   NEXT
   ?
   ? timer," mSec"
   ? "correct pixels ",s
   ? "incorrect pixels ",t
   ? "total pixels",s+t
   if t=0 then
     pirw=1
     ON ERROR SKIP
     NAME "TEST.BMP" AS "REFERENCE.BMP"
   end if
    pirwe=t
endif
endif
if mm.info$(SDCARD)="Ready" then

 ?
 ? "************************************"
 ? "Doing  RESTORE IMAGE REFRENCE.BMP 0,0"
 ? "and read of pixels.                  "
 ? "************************************"

 CLS
 pause 2000
 ? "Loading Image REFERENCE.BMP"
 LOAD IMAGE "REFERENCE.BMP" , 0,0
 TEXT 20,150, "Image Loaded above"
 PAUSE 5000
 s=0:t=0:i=0
 IF blitsupport=1  then
   ? "reading ",tp," pixels after LOAD IMAGE ..."
   timer=0
   for x1=0 to hmax
   for y1=0 to vmax
     i=i+1
     c=RGB(x1<<3 AND &HF8,(x1+y1)<<2 and &HFC,y1<<3 and &HF8)
     r=PIXEL (x1,y1)
     if r=c then
       s=s+1
     else
       if t=0 then ? "Pixels not read as written"
       if t<20 then
         ?
         ? BIN$(c,24)," @ ",x1,y1
         ? BIN$(r,24)        
       
       end if
       t=t+1
     
     endif
     if i>10000 then
       ? ".";
       i=0
     endif  
   NEXT
   NEXT
   ?
   ? timer," mSec"
   ? "correct pixels ",s
   ? "incorrect pixels ",t
   ? "total pixels",s+t
   if t=0 then pir=1
   pire=t
endif
endif
? "----------------------"
? " All Bit transistion test"
? "change by X coordinate "
? "---------------------"

? "writing ",tp," pixels..."
s=0:t=0:i=0
cls
timer=0
for x1=0 to hmax
 for y1=0 to vmax
   'c=RGB((x1<<3 AND &HF8 )OR 5 ,((x1+y1)<<2  and &HFC) or 1 ,(y1<<3 and &HF8) or 2)
   if x mod 2 then c=RGB(BLACK) else c=myWHITE
   PIXEL x1,y1,c
 NEXT
NEXT
? timer," mSec"
if blitsupport=1 then
? "reading ",tp," pixels..."
timer=0
for x1=0 to hmax
 for y1=0 to vmax
   i=i+1
   'c=RGB(x1<<3 AND &HF8 ,(x1+y1)<<2 and &HFC,y1<<3 and &HF8)
   if x mod 2 then c=RGB(BLACK) else c=rgbWHITE
   r=PIXEL (x1,y1)
  ' r=r and &HF8FFF8
   if r=c then
     s=s+1
   else
     if t=0 then ? "Pixels not read as written"
     if t<20 then
       ?
       ? BIN$(c,24)," @ ",x1,y1
       ? BIN$(r,24)        
       
     end if
     t=t+1
     
   endif
   if i>10000 then
     ? ".";
     i=0
   endif  
 NEXT
NEXT
?
? timer," mSec"
? "correct pixels ",s
? "incorrect pixels",t
? "total pixels",s+t
?
if t=0 then tx=1
txe=t

? "************************************"
? "Doing BLIT - blit 0,0,0,0,100,100"
? " and re read of Transition X pixels."
? "************************************"

blit 0,0,0,0,100,100
s=0:t=0:i=0
? "reading ",tp," pixels after blit ..."
timer=0
for x1=0 to hmax
 for y1=0 to vmax
   i=i+1
   'c=RGB(x1<<3 AND &HF8,(x1+y1)<<2 and &HFC,y1<<3 and &HF8)
   if x mod 2 then c=RGB(BLACK) else c=rgbWHITE
   r=PIXEL (x1,y1)
   if r=c then
     s=s+1
   else
     if t=0 then ? "Pixels not read as written"
     if t<20 then
       ?
       ? BIN$(c,24)," @ ",x1,y1
       ? BIN$(r,24)        
       
     end if
     t=t+1
     
   endif
   if i>10000 then
     ? ".";
     i=0
   endif  
 NEXT
NEXT
?
? timer," mSec"
? "correct pixels ",s
? "incorrect pixels ",t
? "total pixels",s+t
if t=0 then tbx=1
tbxe=t
endif

? "************************************"
? "Bit transistion test"
? "by Y and re read of pixels."
? "************************************"
? "writing ",tp," pixels..."
cls
timer=0
for x1=0 to hmax
 for y1=0 to vmax
   'c=RGB((x1<<3 AND &HF8 )OR 5 ,((x1+y1)<<2  and &HFC) or 1 ,(y1<<3 and &HF8) or 2)
   if y mod 2 then c=RGB(BLACK) else c=myWHITE
   PIXEL x1,y1,c
 NEXT
NEXT
? timer," mSec"
if blitsupport=1 then
? "reading ",tp," pixels..."
timer=0
for x1=0 to hmax
 for y1=0 to vmax
   i=i+1
   'c=RGB(x1<<3 AND &HF8 ,(x1+y1)<<2 and &HFC,y1<<3 and &HF8)
   if y mod 2 then c=RGB(BLACK) else c=rgbWHITE
   r=PIXEL (x1,y1)
  ' r=r and &HF8FFF8
   if r=c then
     s=s+1
   else
     if t=0 then ? "Pixels not read as written"
     if t<20 then
       ?
       ? BIN$(c,24)," @ ",x1,y1
       ? BIN$(r,24)        
       
     end if
     t=t+1
     
   endif
   if i>10000 then
     ? ".";
     i=0
   endif  
 NEXT
NEXT
?
? timer," mSec"
? "correct pixels ",s
? "incorrect pixels",t
? "total pixels",s+t
if t=0 then ty=1
tye=t
?
? "************************************"
? "Doing BLIT - blit 0,0,0,0,100,100"
? " and re read of transition Y pixels."
? "************************************"

blit 0,0,0,0,100,100
s=0:t=0:i=0
? "reading ",tp," pixels after blit ..."
timer=0
for x1=0 to hmax
 for y1=0 to vmax
   i=i+1
   'c=RGB(x1<<3 AND &HF8,(x1+y1)<<2 and &HFC,y1<<3 and &HF8)
   if y mod 2 then c=RGB(BLACK) else c=rgbWHITE
   r=PIXEL (x1,y1)
   if r=c then
     s=s+1
   else
     if t=0 then ? "Pixels not read as written"
     if t<20 then
       ?
       ? BIN$(c,24)," @ ",x1,y1
       ? BIN$(r,24)        
       
     end if
     t=t+1
     
   endif
   if i>10000 then
     ? ".";
     i=0
   endif  
 NEXT
NEXT
 ?
 ? timer," mSec"
 ? "correct pixels ",s
 ? "incorrect pixels ",t
 ? "total pixels",s+t
 if t=0 then tby=1
 tbye=t
endif
if getscanlineSupported=1 then
 ? "************************************"
 ? "   Testing GETSCANLINE() Range      "
 ? "************************************"


 'getscanline() testing
 CLS
 TEXT MM.HRES/2,(MM.VRES/2)-50,"testing ...","CM",1,3,RGB(WHITE)
 TEXT MM.HRES/2,MM.VRES/2,"testing ...","CM",1,3,RGB(RED)
 TEXT MM.HRES/2,(MM.VRES/2)+50,"testing ...","CM",1,3,RGB(WHITE)
 top=0
 t=1000
 bottom=1000
for s=1 to mm.hres*100
  t=getscanline()
  top=MAX(t,top)
  bottom=MIN(t,bottom)
 
next s
ENDIF

? "******************************************"
? "              TEST RESULTS                  "
? "********************************************"
? "LCDPANEL   ",MM.INFO$(LCDPANEL)
? "LCDPANELID ",MM.INFO$(LCDPANELID)
? "Size ",MM.HRES,"x",MM.VRES
if getscanlineSupported=1 then
 ? "LCD ID1    ",hex$(getscanline(1),2)
 ? "LCD ID2    ",hex$(getscanline(2),2)
 ? "LCD ID3    ",Hex$(getscanline(3),2)
end if
if blitsupport=1 then
 if pwr then ? "Pixel write/read by gradiant OK" else  ? "Pixel write/read by gradiant FAILED!!!!!!!!!! " +str$(pwre) +" pixels"
 if pb then ? "Pixel blit by gradiant OK" else  ? "Pixel blit  by gradiant FAILED!!!!!!!!!!!! " +str$(pbe) +" pixels"
 if tx then ? "Pixel write/read for all bit X transition OK" else  ? "Pixel write/read for all bit X transition FAILED!!!!!!!!!! " +str$(txe) +" pixels"
 if tbx then ? "Pixel blit for all bit X transition OK" else  ? "Pixel blit for all bit X transition FAILED!!!!!!! " +str$(tbxe) +" pixels"
 if ty then ? "Pixel write/read for all bit Y transition OK" else  ? "Pixel write/read for all bit Y transition FAILED!!!!!!!!! " +str$(tye) +" pixels"
 if tby then ? "Pixel blit for all bit Y transition OK" else  ? "Pixel blit for all bit Y transition FAILED!!!!!!!!!! " +str$(tbye) +" pixels"
endif
If pir then
 IF blitsupport=1 then
   ? "LOAD IMAGE and test of pixels as loaded OK"
  endif  
else
 if MM.INFO$(SDCARD)="Ready" THEN
   IF blitsupport=1 then
    ? "LOAD IMAGE  and test pixels FAILED!!!!!!!!!!! " +str$(pire) +" pixels"
   else
    ? "LOAD IMAGE  OK - check it appear on screen"
   endif
 else
   ? "LOAD IMAGE not TESTED - NO SDCARD"
 endif
endif
If pirw then
 IF blitsupport=1 then
   ? "SAVE IMAGE then LOAD IMAGE and test of pixels as loaded OK"
  endif  
else
 if MM.INFO$(SDCARD)="Ready" THEN
   IF blitsupport=1 then
    ? "SAVE IMAGE then LOAD IMAGE  and test pixels FAILED!!!!!!!!!!! " +str$(pirwe) +" pixels"
   else
    ? "LOAD IMAGE  OK - check it appear on screen"
   endif
 else
   ? "SAVE IMAGE/LOAD IMAGE not TESTED - NO SDCARD"
 endif
endif
IF blitsupport=1 then
? "TRANSPARENT TEXT tested - Check on display if OK"
else
? "BLIT, TRANSPARENT TEXT and Read PIXEL() not supported on this LCDPANEL"
endif
if getscanlineSupported=1 then
? "GETSCANLINE() Range ",bottom,"-",top
ELSE
? "GETSCANLINE() Not Supported on SPI screens"
endif
'? "COM1 Baudrate ",BAUDRATE(1,1)
'? "COM2 Baudrate ",BAUDRATE(2,1)
'? "COM3 Baudrate ",BAUDRATE(3,1)
'? "COM4 Baudrate ",BAUDRATE(4,1)
'? "Battery Voltage ",PIN(BAT)
'? "Battery Voltage ",PIN(BAT)
'? "Battery Voltage ",PIN(BAT)
'OPTION VCC 3.3
'OPTION VCC 3.3 * PIN(SREF) / PIN(IREF)
'? "**** AFTER VCC is adjusted ********"
'? "Battery Volatge ",PIN(BAT)
'? "Battery Volatge ",PIN(BAT)
'? "Battery Volatge ",PIN(BAT)

CLS
TEXT MM.HRES/2,(MM.VRES/2)-50,"Complete","CM",1,4,RGB(WHITE)
TEXT MM.HRES/2,MM.VRES/2,"Complete","CM",1,4,RGB(RED)
TEXT MM.HRES/2,(MM.VRES/2)+50,"Complete","CM",1,4,RGB(WHITE)
pause 1000
end

Edited 2021-04-14 18:12 by disco4now
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 1338
Posted: 01:05pm 14 Apr 2021
Copy link to clipboard 
Print this post

Gerry--I need the "REFERENCE.BMP" file to complete the test.

Interestingly, the right-hand flicker I am seeing at times appears in the test only at backlight levels 70 and above.

Attached is zipped  test.bmp from the run.

test.zip

(The 480x320 guidemo program above shows no right-hand shadow flickering when BACKLIGHT 50 is added at the beginning.)

I'm running off of USB on a laptop. I have it plugged into an in-line current monitoring module. That shows 240mA when the backlight wasn't set, 140mA when it is (with my F4 hat PCB also plugged into the F4, but with nothing connected to it..

~
Edited 2021-04-14 23:18 by lizby
 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 498
Posted: 01:18pm 14 Apr 2021
Copy link to clipboard 
Print this post

The REFERENCE.BMP is created by the first successful test, its just a copy of test.bmp
Try running with the ILI9341_16 first, it should pass the test and created the file.

Here is one that should be ok

REFERENCE.zip
Edited 2021-04-14 23:22 by disco4now
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 1338
Posted: 01:43pm 14 Apr 2021
Copy link to clipboard 
Print this post

Thanks for that file. Here's the output--lots of "FAILED" tests but in practice, thus far, I'm not seeing any problems other than with SAVE IMAGE (after adjusting the backlight fixed the shadow flickering).

> load "verify_ips.bas"
> RUN
LCDPANEL Integrity Test Armmite F4
----------------------------------
Short Test - 100*100 pixels tested
IPS_4_16
0
TEST RGB colour order
**************************************************
 BACKLIGHT TEST 10-100%
**************************************************
**************************************************
 TRANSPARENT TEXT TEST
**************************************************
************************************
Doing write to Pixels colour gradiant
and then read of pixels.
************************************
writing          10000   pixels...
1713    mSec
reading          10000   pixels...
Pixels not read as written

000000000000010000001000         @       0       1
000000000000000000001000

000000000000110000011000         @       0       3
000000000000100000011000

000000000001010000101000         @       0       5
100000000001010000101000

000000000001110000111000         @       0       7
100000000001110000111000

000000000010010001001000         @       0       9
000000000010000001001000

000000000010110001011000         @       0       11
000000000010100001011000

000000000011010001101000         @       0       13
100000000011010001101000

000000000011110001111000         @       0       15
100000000011110001111000

000000000100000010000000         @       0       16
000000000100000000000000

000000000100010010001000         @       0       17
000000000100000000001000

000000000100100010010000         @       0       18
000000000100100000010000

000000000100110010011000         @       0       19
000000000100100000011000

000000000101000010100000         @       0       20
000000000101000000100000

000000000101010010101000         @       0       21
100000000101010000101000

000000000101100010110000         @       0       22
000000000101100000110000

000000000101110010111000         @       0       23
100000000101110000111000

000000000110000011000000         @       0       24
000000000110000001000000

000000000110010011001000         @       0       25
000000000110000001001000

000000000110100011010000         @       0       26
000000000110100001010000

000000000110110011011000         @       0       27
000000000110100001011000

2767    mSec
correct pixels   1928
incorrect pixels         8072
total pixels     10000

************************************
Doing BLIT - blit 0,0,0,0,100,100
and re read of pixels.
************************************
reading          10000   pixels after blit ...
Pixels not read as written

000000000000010000001000         @       0       1
001000000000000000100000

000000000000100000010000         @       0       2
011010000011100000001000

000000000000110000011000         @       0       3
000100000000000000111000

000000000001000000100000         @       0       4
000000000000100000011000

000000000001010000101000         @       0       5
001110000000000000100000

000000000001100000110000         @       0       6
111010000100010000100000

000000000001110000111000         @       0       7
001010000000000000111000

000000000010000001000000         @       0       8
000000000001100000110000

000000000010010001001000         @       0       9
001100000000000000100000

000000000010100001010000         @       0       10
011010000101000000111000

000000000010110001011000         @       0       11
010000000000000000111000

000000000011000001100000         @       0       12
000000000010000001001000

000000000011010001101000         @       0       13
011010000000000000100000

000000000011100001110000         @       0       14
011010000101100001010000

000000000011110001111000         @       0       15
010110000000000000111000

000000000100000010000000         @       0       16
000000000011000001100000

000000000100010010001000         @       0       17
011000000000000000100000

000000000100100010010000         @       0       18
011010000110100001101000

000000000100110010011000         @       0       19
011100000000000000111000

000000000101000010100000         @       0       20
100000000011110001111000

2821    mSec
correct pixels   2
incorrect pixels         9998
total pixels     10000

************************************
Doing  SAVE IMAGE TEST.BMP ,0,0,100,100
then  RESTORE IMAGE TEST.BMP 0,0
and re read of pixels.
************************************
Image saved as TEST.BMP
Loading Image TEST.BMP
reading          10000   pixels after LOAD IMAGE ...
Pixels not read as written

000000000000010000001000         @       0       1
001000000000000000100000

000000000000100000010000         @       0       2
011010000011100000001000

000000000000110000011000         @       0       3
000100000000000000111000

000000000001000000100000         @       0       4
000000000000100000011000

000000000001010000101000         @       0       5
001110000000000000100000

000000000001100000110000         @       0       6
111010000100010000100000

000000000001110000111000         @       0       7
001010000000000000111000

000000000010000001000000         @       0       8
000000000001100000110000

000000000010010001001000         @       0       9
001100000000000000100000

000000000010100001010000         @       0       10
011010000101000000111000

000000000010110001011000         @       0       11
010000000000000000111000

000000000011000001100000         @       0       12
000000000010000001001000

000000000011010001101000         @       0       13
011010000000000000100000

000000000011100001110000         @       0       14
011010000101100001010000

000000000011110001111000         @       0       15
010110000000000000111000

000000000100000010000000         @       0       16
000000000011000001100000

000000000100010010001000         @       0       17
011000000000000000100000

000000000100100010010000         @       0       18
011010000110100001101000

000000000100110010011000         @       0       19
011100000000000000111000

000000000101000010100000         @       0       20
100000000011110001111000

2839    mSec
correct pixels   1
incorrect pixels         9999
total pixels     10000

************************************
Doing  RESTORE IMAGE REFRENCE.BMP 0,0
and read of pixels.
************************************
Loading Image REFERENCE.BMP
reading          10000   pixels after LOAD IMAGE ...
Pixels not read as written

000000000000010000001000         @       0       1
000000000000000000001000

000000000000110000011000         @       0       3
000000000000100000011000

000000000001010000101000         @       0       5
100000000001010000101000

000000000001110000111000         @       0       7
100000000001110000111000

000000000010010001001000         @       0       9
000000000010000001001000

000000000010110001011000         @       0       11
000000000010100001011000

000000000011010001101000         @       0       13
100000000011010001101000

000000000011110001111000         @       0       15
100000000011110001111000

000000000100000010000000         @       0       16
000000000100000000000000

000000000100010010001000         @       0       17
000000000100000000001000

000000000100100010010000         @       0       18
000000000100100000010000

000000000100110010011000         @       0       19
000000000100100000011000

000000000101000010100000         @       0       20
000000000101000000100000

000000000101010010101000         @       0       21
100000000101010000101000

000000000101100010110000         @       0       22
000000000101100000110000

000000000101110010111000         @       0       23
100000000101110000111000

000000000110000011000000         @       0       24
000000000110000001000000

000000000110010011001000         @       0       25
000000000110000001001000

000000000110100011010000         @       0       26
000000000110100001010000

000000000110110011011000         @       0       27
000000000110100001011000

2759    mSec
correct pixels   1928
incorrect pixels         8072
total pixels     10000
----------------------
All Bit transistion test
change by X coordinate
---------------------
writing          10000   pixels...
1101    mSec
reading          10000   pixels...
Pixels not read as written

111110001111110011111000         @       0       0
111110001111110001111000

111110001111110011111000         @       0       1
111110001111110001111000

111110001111110011111000         @       0       2
111110001111110001111000

111110001111110011111000         @       0       3
111110001111110001111000

111110001111110011111000         @       0       4
111110001111110001111000

111110001111110011111000         @       0       5
111110001111110001111000

111110001111110011111000         @       0       6
111110001111110001111000

111110001111110011111000         @       0       7
111110001111110001111000

111110001111110011111000         @       0       8
111110001111110001111000

111110001111110011111000         @       0       9
111110001111110001111000

111110001111110011111000         @       0       10
111110001111110001111000

111110001111110011111000         @       0       11
111110001111110001111000

111110001111110011111000         @       0       12
111110001111110001111000

111110001111110011111000         @       0       13
111110001111110001111000

111110001111110011111000         @       0       14
111110001111110001111000

111110001111110011111000         @       0       15
111110001111110001111000

111110001111110011111000         @       0       16
111110001111110001111000

111110001111110011111000         @       0       17
111110001111110001111000

111110001111110011111000         @       0       18
111110001111110001111000

111110001111110011111000         @       0       19
111110001111110001111000

2423    mSec
correct pixels   0
incorrect pixels         10000
total pixels     10000

************************************
Doing BLIT - blit 0,0,0,0,100,100
and re read of Transition X pixels.
************************************
reading          10000   pixels after blit ...
Pixels not read as written

111110001111110011111000         @       0       0
111110001111110001111000

111110001111110011111000         @       0       1
011110000000000001111000

111110001111110011111000         @       0       2
111110001111110001111000

111110001111110011111000         @       0       3
011110000000000001111000

111110001111110011111000         @       0       4
111110001111110001111000

111110001111110011111000         @       0       5
011110000000000001111000

111110001111110011111000         @       0       6
111110001111110001111000

111110001111110011111000         @       0       7
011110000000000001111000

111110001111110011111000         @       0       8
111110001111110001111000

111110001111110011111000         @       0       9
011110000000000001111000

111110001111110011111000         @       0       10
111110001111110001111000

111110001111110011111000         @       0       11
011110000000000001111000

111110001111110011111000         @       0       12
111110001111110001111000

111110001111110011111000         @       0       13
011110000000000001111000

111110001111110011111000         @       0       14
111110001111110001111000

111110001111110011111000         @       0       15
011110000000000001111000

111110001111110011111000         @       0       16
111110001111110001111000

111110001111110011111000         @       0       17
011110000000000001111000

111110001111110011111000         @       0       18
111110001111110001111000

111110001111110011111000         @       0       19
011110000000000001111000

2407    mSec
correct pixels   0
incorrect pixels         10000
total pixels     10000
************************************
Bit transistion test
by Y and re read of pixels.
************************************
writing          10000   pixels...
1101    mSec
reading          10000   pixels...
.
2419    mSec
correct pixels   0
incorrect pixels         20000
total pixels     20000

************************************
Doing BLIT - blit 0,0,0,0,100,100
and re read of transition Y pixels.
************************************
reading          10000   pixels after blit ...
Pixels not read as written

111110001111110011111000         @       0       0
111110001111110001111000

111110001111110011111000         @       0       1
011110000000000001111000

111110001111110011111000         @       0       2
111110001111110001111000

111110001111110011111000         @       0       3
011110000000000001111000

111110001111110011111000         @       0       4
111110001111110001111000

111110001111110011111000         @       0       5
011110000000000001111000

111110001111110011111000         @       0       6
111110001111110001111000

111110001111110011111000         @       0       7
011110000000000001111000

111110001111110011111000         @       0       8
111110001111110001111000

111110001111110011111000         @       0       9
011110000000000001111000

111110001111110011111000         @       0       10
111110001111110001111000

111110001111110011111000         @       0       11
011110000000000001111000

111110001111110011111000         @       0       12
111110001111110001111000

111110001111110011111000         @       0       13
011110000000000001111000

111110001111110011111000         @       0       14
111110001111110001111000

111110001111110011111000         @       0       15
011110000000000001111000

111110001111110011111000         @       0       16
111110001111110001111000

111110001111110011111000         @       0       17
011110000000000001111000

111110001111110011111000         @       0       18
111110001111110001111000

111110001111110011111000         @       0       19
011110000000000001111000

2408    mSec
correct pixels   0
incorrect pixels         10000
total pixels     10000
************************************
  Testing GETSCANLINE() Range
************************************
******************************************
             TEST RESULTS
********************************************
LCDPANEL        IPS_4_16
LCDPANELID      0
Size     800    x        480
LCD ID1         51
LCD ID2         B8
LCD ID3         C0
Pixel write/read by gradiant FAILED!!!!!!!!!! 8072 pixels
Pixel blit  by gradiant FAILED!!!!!!!!!!!! 9998 pixels
Pixel write/read for all bit X transition FAILED!!!!!!!!!! 10000 pixels
Pixel blit for all bit X transition FAILED!!!!!!! 10000 pixels
Pixel write/read for all bit Y transition FAILED!!!!!!!!! 20000 pixels
Pixel blit for all bit Y transition FAILED!!!!!!!!!! 10000 pixels
LOAD IMAGE  and test pixels FAILED!!!!!!!!!!! 8072 pixels
SAVE IMAGE then LOAD IMAGE  and test pixels FAILED!!!!!!!!!!! 9999 pixels
TRANSPARENT TEXT tested - Check on display if OK
GETSCANLINE() Range      0      -        771
>
 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 498
Posted: 01:48am 15 Apr 2021
Copy link to clipboard 
Print this post

A little correction to test code above.
The counters are not reset before the bit test by Y axis
The red line needs to be added.


? "************************************"
? "Bit transistion test"
? "by Y and re read of pixels."
? "************************************"
? "writing ",tp," pixels..."
cls
s=0:t=0:i=0
timer=0

 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 498
Posted: 02:03am 15 Apr 2021
Copy link to clipboard 
Print this post

  lizby said  
************************************
******************************************
             TEST RESULTS
********************************************
LCDPANEL        IPS_4_16
LCDPANELID      0
Size     800    x        480
LCD ID1         51
LCD ID2         B8
LCD ID3         C0
Pixel write/read by gradiant FAILED!!!!!!!!!! 8072 pixels
Pixel blit  by gradiant FAILED!!!!!!!!!!!! 9998 pixels
Pixel write/read for all bit X transition FAILED!!!!!!!!!! 10000 pixels
Pixel blit for all bit X transition FAILED!!!!!!! 10000 pixels
Pixel write/read for all bit Y transition FAILED!!!!!!!!! 20000 pixels
Pixel blit for all bit Y transition FAILED!!!!!!!!!! 10000 pixels
LOAD IMAGE  and test pixels FAILED!!!!!!!!!!! 8072 pixels
SAVE IMAGE then LOAD IMAGE  and test pixels FAILED!!!!!!!!!!! 9999 pixels
TRANSPARENT TEXT tested - Check on display if OK
GETSCANLINE() Range      0      -        771
>

Hi Lance,
I think you have a display based on the NT35510 chip. I don't know of a way to see this physically as both displays look the same.
I have tried my NT35510 using the OTM8009A driver and it sort of works with similiar problems you are seeing.
i.e. colour bleeding down the right hand side, incorrect pixels read back. The pump controller displays but with a few glitches.
The scan lines coming back as 0-771 match my NT35510 as well.

           Your IDs.          My IDs
LCD ID1         51               55  
LCD ID2         B8               BC
LCD ID3         C0               C0

I test for the 55 to identify the NT35510. Looks like we might need to accept 51 as well. I will see if Peter will do an update that will accept either the 55 or 51 to indicated the NT35510. I can't think of a way to test it without getting a new bin file.

Regards
Gerry
 
goc30

Guru

Joined: 12/04/2017
Location: France
Posts: 356
Posted: 02:33am 15 Apr 2021
Copy link to clipboard 
Print this post

hi

I have make new version of my "test_graf" prog for new F4 armmite and 3.97" lcd 16b


test_graf_f4.zip
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 1338
Posted: 01:34pm 17 Apr 2021
Copy link to clipboard 
Print this post

Disco4now told me via PM that matherp noted that a problem with D2 could cause the anomalies I'm seeing.

Excellent spot. In fact, it was the D15 trace crossing the D2 pad, an error I created when I did a group move left but without realizing it also moved down. Tests all pass with error corrected with cut trace and new trace wired.

The attached zip files include gerbers which can be sent to JLCPCB and EagleCad sch and brd files.

If anyone already ordered the board, the problem can be fixed by cutting the D15 trace on both sides of the 32-pin D2 pad, and running a new D15 wire.

F4_800_LCD_V2_gerbers_2021-04-17.zip

F4_800_LCD_V2.zip
 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 498
Posted: 10:48pm 17 Apr 2021
Copy link to clipboard 
Print this post

Yes, I agree well spotted by matherp.
The clue is in the reading of the IDs,
 
             Your IDs.          My IDs
LCD ID1         51               55  
LCD ID2         B8               BC
LCD ID3         C0               C0

All the rest is a symptom of the wrong driver being loaded.
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 1338
Posted: 02:51am 23 Apr 2021
Copy link to clipboard 
Print this post

See sliding tile game for an F4 game/puzzle for this LCD.



~
Edited 2021-04-23 12:52 by lizby
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2021