I am writing a test program for ILI9341 readpixel.
I draw a sprite and check 2 pixel below the sprite, one on the bottom left and one on the bottom right.
I print their values in the main loop. They are 0 until the point is not black ie landscape.
When ithe sprite hits the left landscape it says landed not dead.
It shows both pixels are not black ie 0 so I pset a yellow pixel at both test points and the right one was black or 0.
Please watch the video that shows the problem. https://www.youtube.com/edit?video_id=-zLdhIlnxec&ar=1582986019037&nv=1
Anobium. I see no faults as the points tested are then pset to yellow when the event occurs so I know I am not testing the sprite pixels.
As the video shows it displays 0 0 until it hits something. Hitting left should say dead not landed.
Hitting right works and both pixel lit on a flat line works.
Very odd head scratcher.
GLCDRotate(Portrait_Rev)' optionally you can rotate the screen.GLCDCLSbk;dimtempasBytedimpixel_colour_left,pixel_colour_rightaslong;test pixel colourdimsprite_x,sprite_height,sprite_widthasbyte;height and width of sprite in pixelsdimsprite_yasWord;y position of spritedimptr,spritedata_ptr,pixelasworddimgravity,gravity_count,x_drift,x_dirasByte;;testpset100,100,wh;This is lit;pset 120,100,wh ;This is not lit, it's backgroundpixel_colour_left=ReadPixel_I9341(100,100)pixel_colour_right=ReadPixel_ILI9341(120,100)GLCDPrint70,10,Str32(pixel_colour_left)GLCDPrint70,20,Str32(pixel_colour_right)doloop
pixel_colour_right is non zero although pixel_colour_right = ReadPixel_ILI9341(120,100) is reading a black background
If nothing is pset then it reads 0 0
but if either pixel is pset it's >0 for both
EDIT!
I found if I test a pixel and it's 0 then test another and it's >0 then it works
but if I test a pixel and it's >0 and test another which is 0 then BOTH test show results >0.
I will try to check your ili9341 read_pixel code.
edit... your ili9341 inc uses word values for x and y.
I was using byte for x...as screen is 240 wide x 320 high but changed it to a word var but made no difference.
I will post all the code as is if ok.
#chip18f25k22,64
#configMCLRE=on
#optionExplicit
#include<glcd.h>
#defineGLCD_TYPEGLCD_TYPE_ILI9341'Pin mappings for ILI9341
#defineGLCD_DCportc.2
#defineGLCD_CSportc.0
#defineGLCD_RESETportc.1'As we are using Harware SPI this cannot be change on this chip. This is a non-PPS chip.
#defineGLCD_DIportc.4
#defineGLCD_DOportc.5
#defineGLCD_SCKportc.3
#defineILI9341_hardwarespi;rename colours to make less typeing
#definebkILI9341_BLACK
#definereILI9341_RED
#definegrILI9341_GREEN
#defineblILI9341_BLUE
#definewhILI9341_WHITE
#definepuILI9341_PURPLE
#defineyeILI9341_YELLOW
#definecyILI9341_CYAN
#definedgILI9341_D_GRAY
#definelgILI9341_L_GRAY
#definesiILI9341_SILVER
#definemaILI9341_MAROON
#defineolILI9341_OLIVE
#defineliILI9341_LIME
#defineaqILI9341_AQUA
#defineteILI9341_TEAL
#definenaILI9341_NAVY
#definefuILI9341_FUCHSIA;
#defineleft_thrust_buttonportb.5;all buttons held hi by 10k resistors....well 12k cos all I had
#definevertical_thrust_buttonportb.4
#defineright_thrust_buttonportb.3dirleft_thrust_buttonindirvertical_thrust_buttonindirright_thrust_buttonin;GLCDRotate(Portrait_Rev);xy=0 top left, optionally you can rotate the screen.GLCDCLSbk;dimtempasBytedimpixel_colour_left,pixel_colour_rightaslong;test pixel colourdim ,sprite_height,sprite_widthasbyte;height and width of sprite in pixelsdimsprite_x,sprite_yasWord;xy position of spritedimptr,spritedata_ptr,pixel,x_dirasworddimgravity,gravity_count,x_driftasByte;;test;pset 100,100,wh;pset 120,100,wh'pixel_colour_left = ReadPixel_ILI9341 (100,100)''pixel_colour_right = ReadPixel_ILI9341 (120,100)'' GLCDPrint 70,10,Str32 (pixel_colour_left)' GLCDPrint 70,20,Str32 (pixel_colour_right)''do'loopsprite_x=30:sprite_y=40; sprite x,y startsprite_height=24:sprite_width=24gravity_count=20x_drift=20x_dir=0;;draw lanscapeline0,8,16,120,whline16,120,48,280,whline48,280,100,319,whline100,319,140,319,whline140,319,196,280,whline196,280,224,120,whline224,120,239,8,whsprite(sprite_x,sprite_y);draw spritedo;main looppixel_colour_right=ReadPixel_ILI9341((sprite_x-1),(sprite_y+sprite_height+1));left pixel colourpixel_colour_left=ReadPixel_ILI9341((sprite_x+sprite_width+1),(sprite_y+sprite_height+1));right pixel colourGLCDPrint70,10,Str32(pixel_colour_left)GLCDPrint70,20,Str32(pixel_colour_right)if(pixel_colour_left>0)and(pixel_colour_right>0)then;both pixels lit so flatGLCDPrint100,100,"LANDED",whdoGLCDPrint100,10,Str32(pixel_colour_left)GLCDPrint100,20,Str32(pixel_colour_right)psetsprite_x+sprite_width+1,sprite_y+sprite_height+1,wh;show test pointspsetsprite_x-1,sprite_y+sprite_height+1 ,whloopendifif(pixel_colour_left>0)and(pixel_colour_right=0)thenGLCDPrint100,100,"Dead",wh;hit leftdoloopendififpixel_colour_left=0andpixel_colour_right>0thenGLCDPrint100,100,"DEAD",wh;hit rightdoloopendifgravity_count=gravity_count+1ifleft_thrust_button=0thenx_drift=x_drift+1elseifright_thrust_button=0thenx_drift=x_drift-1endififx_drift=15thenx_drift=20x_dir=65535sprite_x=sprite_x+x_direlseifx_drift=25thenx_drift=20x_dir=1sprite_x=sprite_x+x_direndifsprite(sprite_x,sprite_y);draw spriteifvertical_thrust_button=0thengravity_count=gravity_count-2linesprite_x+6,sprite_y+12,sprite_x+11,sprite_y+21,whlinesprite_x+16,sprite_y+12,sprite_x+13,sprite_y+21,whendififgravity_count=15thengravity_count=20sprite_y=sprite_y-1elseifgravity_count=25thengravity_count=20sprite_y=sprite_y+1endifloop;subsprite(sprite_x,sprite_y);fills box with sprite data; SetAddressWindow_ILI9341 ( sprite_x,sprite_y,sprite_x + sprite_width-1,sprite_y + sprite_height - 1 )SetAddressWindow_ILI9341(sprite_x,sprite_y,sprite_x+23,sprite_y+23)forptr=1to576;(sprite_width * sprite_height)ReadTablelander,ptr,pixelSendWord_ILI9341pixelnextptrendsub;;sprite data;1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 21 23 24tablelanderbk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk;1bk,bk,bk,bk,bk,bk,bk,bk,bk,wh,wh,wh,wh,wh,wh,bk,bk,bk,bk,bk,bk,bk,bk,bk;2bk,bk,bk,bk,bk,bk,bk,wh,wh,bk,bk,bk,bk,bk,bk,wh,wh,bk,bk,bk,bk,bk,bk,bk;3bk,bk,bk,bk,bk,bk,wh,bk,bk,bk,wh,wh,wh,wh,bk,bk,bk,wh,bk,bk,bk,bk,bk,bk;4bk,bk,bk,bk,wh,wh,bk,bk,wh,wh,bk,bk,bk,bk,wh,wh,bk,bk,wh,wh,bk,bk,bk,bk;5bk,bk,bk,wh,bk,bk,bk,wh,bk,bk,bk,bk,bk,bk,bk,bk,wh,bk,bk,bk,wh,bk,bk,bk;6bk,bk,wh,bk,bk,wh,wh,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,wh,wh,bk,bk,wh,bk,bk;7bk,bk,wh,bk,bk,wh,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,wh,bk,bk,wh,bk,bk;8bk,bk,bk,wh,bk,wh,wh,wh,wh,wh,wh,wh,wh,wh,wh,wh,wh,wh,wh,bk,wh,bk,bk,bk;9bk,bk,bk,wh,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,wh,bk,bk,bk;10bk,bk,bk,wh,wh,wh,wh,wh,wh,wh,wh,wh,wh,wh,wh,wh,wh,wh,wh,wh,wh,bk,bk,bk;11bk,bk,bk,bk,wh,wh,wh,wh,wh,wh,wh,wh,wh,wh,wh,wh,wh,wh,wh,wh,bk,bk,bk,bk;12bk,bk,bk,bk,wh,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,wh,bk,bk,bk,bk;13bk,bk,bk,wh,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,wh,bk,bk,bk;14bk,bk,wh,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,wh,bk,bk;15bk,wh,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,wh,bk;16bk,wh,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,wh,bk;17bk,bk,wh,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,wh,bk,bk;18bk,bk,bk,wh,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,wh,bk,bk,bk;19bk,bk,bk,wh,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,wh,bk,bk,bk;20bk,bk,bk,wh,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,wh,bk,bk,bk;21bk,bk,wh,wh,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,wh,wh,bk,bk;22bk,wh,wh,wh,wh,wh,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,wh,wh,wh,wh,wh,bk;23bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk;24endtable;
Last edit: stan cartwright 2020-02-29
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
if (pixel_colour_left > 0) and (pixel_colour_right > 0) then ;both pixels lit so flat
GLCDPrint 100,100,"LANDED",wh
do
GLCDPrint 100,10,Str32 (pixel_colour_left)
GLCDPrint 100,20,Str32 (pixel_colour_right)
but they show different values for the same white colour?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
'returns a 24bit pixel color value... as GCB uses a 16bit color value the user will need to complete conversion
The function returns a 24 bit value. And, the colors are 16 bits. Is this the issue?
I would draw a horizontal line, test and review the values.
Then, I would then series of line to get a handle on the returned values.
This process would isolate the issue.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
16,579,836
this not the problem though.
it is that the read_pixel is reading the pixels wrong after a non zero result.
if it reads a non zero pixel then reads a zero/black pixel it reads it as a non zero value.
Black is 0000000000000000000----
There is a problem
Last edit: stan cartwright 2020-03-01
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If I read 2 black pixels from glcdcls black or pset 2 black pixels it is 0 0
It's if the first read is not 0 then the second one will be none 0 even though it is 0.
Like some thing needs clearing in the include
I used ILI9341_BLACK and ILI9341_WHITE incase the #defines were not working but same.
I may be wrong but when a routine doesn't seem to work and one can't find a reason then there is an error somewhere. I would think it was me but...This routine is giving wrong results...prove me wrong cos this program and any others using the routine are on stop til sorted.
Please show me the errors of my ways Anobium.
It's frustrating when I can't sort things myself.
Last edit: stan cartwright 2020-03-01
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
commented out, this is the simple test...the rest is the complete program all setup to go.
No reason to repost as is the same.
I thought you might have an ili9341 setup around...as you do and could check my findings.
Cheers.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
#chip18f25k22,64
#configMCLRE=on
#optionExplicit
#include<glcd.h>
#defineGLCD_TYPEGLCD_TYPE_ILI9341'Pin mappings for ILI9341
#defineGLCD_DCportc.2
#defineGLCD_CSportc.0
#defineGLCD_RESETportc.1'As we are using Harware SPI this cannot be change on this chip. This is a non-PPS chip.
#defineGLCD_DIportc.4
#defineGLCD_DOportc.5
#defineGLCD_SCKportc.3
#defineILI9341_hardwarespi;rename colours to make less typeing
#definebkILI9341_BLACK
#definereILI9341_RED
#definegrILI9341_GREEN
#defineblILI9341_BLUE
#definewhILI9341_WHITE
#definepuILI9341_PURPLE
#defineyeILI9341_YELLOW
#definecyILI9341_CYAN
#definedgILI9341_D_GRAY
#definelgILI9341_L_GRAY
#definesiILI9341_SILVER
#definemaILI9341_MAROON
#defineolILI9341_OLIVE
#defineliILI9341_LIME
#defineaqILI9341_AQUA
#defineteILI9341_TEAL
#definenaILI9341_NAVY
#definefuILI9341_FUCHSIA;GLCDRotate(Portrait_Rev);xy=0 top left, optionally you can rotate the screen.GLCDCLSbk;dimpixel_colour_left,pixel_colour_rightaslong;test pixel colour;;testpset100,100,whpset120,100,bk;--should be 0pixel_colour_left=ReadPixel_ILI9341(100,100)pixel_colour_right=ReadPixel_ILI9341(120,100)GLCDPrint70,10,Str32(pixel_colour_left)GLCDPrint70,20,Str32(pixel_colour_right);--should be 0doloop
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have found the issue. The DI port was not being set correctly. I found this by accident. I set up an UNO using your code and it worked... So, I looked through the ASM.... and spotted it.
I tried your link,I downloaded the glcd_ili9341 which is an uncompressed file, renamed the original glcd_ili9341 and the new one to gcbasic includes.
It behaves the same, the same fault.
I am using a pic at 3V.
When you said "I found this by accident. I set up an UNO using your code and it worked... "
did you mean it worked ok on an uno or displayed the same fault?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Re the new file. Compile your program and then attach your ASM. Let me review it.
I do no think voltage would impact. But, mine is at 3v3 via a set of levelers.
The UNO device worked. This puzzled me as I expected your code to fail. Then, I by I accident I stumbed across the error in the .h that may impact PICs (but, not AVRs).
So, post ASM using the new .h
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I could tranfer the program to a uno but then if there is a pic problem it would need sorting.
am I using the correct pin for miso on 18f25k22? Think I am cos it nearly works.
Don't a bit of basic make loads of asm!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am writing a test program for ILI9341 readpixel.
I draw a sprite and check 2 pixel below the sprite, one on the bottom left and one on the bottom right.
I print their values in the main loop. They are 0 until the point is not black ie landscape.
When ithe sprite hits the left landscape it says landed not dead.
It shows both pixels are not black ie 0 so I pset a yellow pixel at both test points and the right one was black or 0.
Please watch the video that shows the problem.
https://www.youtube.com/edit?video_id=-zLdhIlnxec&ar=1582986019037&nv=1
Check that you do not have overflow or some maths error in the following:
Anobium. I see no faults as the points tested are then pset to yellow when the event occurs so I know I am not testing the sprite pixels.
As the video shows it displays 0 0 until it hits something. Hitting left should say dead not landed.
Hitting right works and both pixel lit on a flat line works.
Very odd head scratcher.
is the only way to landed yet only one pixel is lit
Last edit: stan cartwright 2020-02-29
Here is the problem
pixel_colour_right is non zero although pixel_colour_right = ReadPixel_ILI9341(120,100) is reading a black background
If nothing is pset then it reads 0 0
but if either pixel is pset it's >0 for both
EDIT!
I found if I test a pixel and it's 0 then test another and it's >0 then it works
but if I test a pixel and it's >0 and test another which is 0 then BOTH test show results >0.
I will try to check your ili9341 read_pixel code.
edit... your ili9341 inc uses word values for x and y.
I was using byte for x...as screen is 240 wide x 320 high but changed it to a word var but made no difference.
I will post all the code as is if ok.
Last edit: stan cartwright 2020-02-29
if (pixel_colour_left > 0) and (pixel_colour_right > 0) then ;both pixels lit so flat
GLCDPrint 100,100,"LANDED",wh
do
GLCDPrint 100,10,Str32 (pixel_colour_left)
GLCDPrint 100,20,Str32 (pixel_colour_right)
but they show different values for the same white colour?
'returns a 24bit pixel color value... as GCB uses a 16bit color value the user will need to complete conversion
The function returns a 24 bit value. And, the colors are 16 bits. Is this the issue?
I would draw a horizontal line, test and review the values.
Then, I would then series of line to get a handle on the returned values.
This process would isolate the issue.
dim pixel_colour_left,pixel_colour_right as long
pset 100,100,wh
pset 120,100,wh
pixel_colour_left = ReadPixel_ILI9341 (100,100)
;
pixel_colour_right = ReadPixel_ILI9341 (120,100)
;
GLCDPrint 70,10,Str32 (pixel_colour_left) ;gives 16579836
GLCDPrint 70,20,Str32 (pixel_colour_right) ;gives 2164063484
;
do
loop
Why different results for same white pixels?
this gives same as last post just reading the same pixel.
Does something need resetting in the read_pixel?
pset 100,100,wh
pixel_colour_left = ReadPixel_ILI9341 (100,100)
;
pixel_colour_right = ReadPixel_ILI9341 (100,100)
;
GLCDPrint 70,10,Str32 (pixel_colour_left)
GLCDPrint 70,20,Str32 (pixel_colour_right)
;
do
loop
The two number are the same, in the context of the constraint of the function.
The function returna long but only the bottom 24bits are valid, so,
16579836 = 0x00FCFCFC
2164063484 = 0x80FCFCFC
So, and, with 24bits. Both numbers return the same.
16579836 = 0x00FCFCFC AND 0XFFFFFF = 0x00FCFCFC
2164063484 = 0x80FCFCFC AND 0XFFFFFF = 0x00FCFCFC
So, what does 0x00FCFCFC equate to?
16,579,836
this not the problem though.
it is that the read_pixel is reading the pixels wrong after a non zero result.
if it reads a non zero pixel then reads a zero/black pixel it reads it as a non zero value.
Black is 0000000000000000000----
There is a problem
Last edit: stan cartwright 2020-03-01
https://www.hexcolortool.com/#fcfcfc may help.
It that true? Read two black pixels. What is the result?
If I read 2 black pixels from glcdcls black or pset 2 black pixels it is 0 0
It's if the first read is not 0 then the second one will be none 0 even though it is 0.
Like some thing needs clearing in the include
I used ILI9341_BLACK and ILI9341_WHITE incase the #defines were not working but same.
I may be wrong but when a routine doesn't seem to work and one can't find a reason then there is an error somewhere. I would think it was me but...This routine is giving wrong results...prove me wrong cos this program and any others using the routine are on stop til sorted.
Please show me the errors of my ways Anobium.
It's frustrating when I can't sort things myself.
Last edit: stan cartwright 2020-03-01
Slowly. Read what you wrote.
So, do you mean , if you read one pixel when the background is black or where you have set the pixel to black - the result is 0.
So, what happens when you this with white?
I have no idea of the context. What is the context?
We need to understand the two sentences. Cus, I have an answer - yet.
GLCDCLS bk
dim pixel_colour_left,pixel_colour_right as long
pset 100,100,ILI9341_black
pset 120,100,ILI9341_black
pixel_colour_left = ReadPixel_ILI9341 (100,100)
pixel_colour_right = ReadPixel_ILI9341 (120,100)
GLCDPrint 70,10,Str32 (pixel_colour_left) ;gives 0
GLCDPrint 70,20,Str32 (pixel_colour_right) ;gives 0
do
loop
;------------------------------------------------------------------------------
pset 100,100,ILI9341_black
pset 120,100,ILI9341_white
pixel_colour_left = ReadPixel_ILI9341 (100,100)
pixel_colour_right = ReadPixel_ILI9341 (120,100)
GLCDPrint 70,10,Str32 (pixel_colour_left) ;gives 0
GLCDPrint 70,20,Str32 (pixel_colour_right) ;gives 16579836
;---------------------------------------------------------------------------------
pset 100,100,ILI9341_white
pset 120,100,ILI9341_black
pixel_colour_left = ReadPixel_ILI9341 (100,100)
pixel_colour_right = ReadPixel_ILI9341 (120,100)
GLCDPrint 70,10,Str32 (pixel_colour_left) ;gives 16579836
GLCDPrint 70,20,Str32 (pixel_colour_right) ;gives 2147483648
the last statement should print 0 as the pixel is black
are any vars kept in the ililib after use like top byte of long...your code is not always easy to follow....sometimes is.
Last edit: stan cartwright 2020-03-01
Can you attach the full code that the above test is based upon? Let us add some debug to analyse.
I have previous above and the test is commented out. The whole test game program and
;test
;pset 100,100,wh
;pset 120,100,wh
'pixel_colour_left = ReadPixel_ILI9341 (100,100)
'
'pixel_colour_right = ReadPixel_ILI9341 (120,100)
'
' GLCDPrint 70,10,Str32 (pixel_colour_left)
' GLCDPrint 70,20,Str32 (pixel_colour_right)
'
'do
'loop
commented out, this is the simple test...the rest is the complete program all setup to go.
No reason to repost as is the same.
I thought you might have an ili9341 setup around...as you do and could check my findings.
Cheers.
this is a working test Anobium
Stan,
I have found the issue. The DI port was not being set correctly. I found this by accident. I set up an UNO using your code and it worked... So, I looked through the ASM.... and spotted it.
Try this please. https://sourceforge.net/p/gcbasic/code/HEAD/tree/GCBASIC/trunk/include/glcd_ILI9341.h?format=raw
I tried your link,I downloaded the glcd_ili9341 which is an uncompressed file, renamed the original glcd_ili9341 and the new one to gcbasic includes.
It behaves the same, the same fault.
I am using a pic at 3V.
When you said "I found this by accident. I set up an UNO using your code and it worked... "
did you mean it worked ok on an uno or displayed the same fault?
Re the new file. Compile your program and then attach your ASM. Let me review it.
I do no think voltage would impact. But, mine is at 3v3 via a set of levelers.
The UNO device worked. This puzzled me as I expected your code to fail. Then, I by I accident I stumbed across the error in the .h that may impact PICs (but, not AVRs).
So, post ASM using the new .h
This is the complete test program using new ili9341.h
This is when
pset 100,100,wh
pset 120,100,bk
pixel_colour_left = ReadPixel_ILI9341 (100,100)
pixel_colour_right = ReadPixel_ILI9341 (120,100)
GLCDPrint 70,10,Str32 (pixel_colour_left)
GLCDPrint 70,20,Str32 (pixel_colour_right)
do
loop
Last edit: stan cartwright 2020-03-02
You sure this still exhibits the same error? The init looks correct now for the SPI DI port - it was not correct before.
You do have the DI connected to Portc.4?
And, disable Hardware SPI, by, commenting out
#define ILI9341_hardwarespi
Then, test.I could tranfer the program to a uno but then if there is a pic problem it would need sorting.
am I using the correct pin for miso on 18f25k22? Think I am cos it nearly works.
Don't a bit of basic make loads of asm!
sdi mosi goes to port c.4
sdo miso goes to port c.5
commenting ;#define ILI9341_hardwarespi and the display clears to black but displays nothing.