Page 1 of 2
					
				ILI9341 SPI
				Posted: Sun Jul 21, 2024 12:24 pm
				by flaviae
				Good morning.
I have a problem using the TFT ILI9341 via SPI. I created a small program in FWC10 to test the TFT, but the result is a blank screen. I did another test with the same program but in FWC8 and here I can already see the text on the screen. I think the problem is with the TFT module in the FWC10, but if anyone can help, I'd be grateful.
Attached I send examples of the programs.
Thanks in advance.
			 
			
					
				Re: ILI9341 SPI
				Posted: Mon Jul 22, 2024 9:38 am
				by stefan.erni
				Hi flaviae
Can you try in software mode and in slower mode?
regards
Stefan
			 
			
					
				Re: ILI9341 SPI
				Posted: Mon Jul 22, 2024 3:34 pm
				by BenR
				Hello,
In the Print component macro you have set the font parameter to 1 but this should be 0 as you only have font 0 defined.
			
		
				
			
 
						- Prog.jpg (52.58 KiB) Viewed 17302 times
 
		
		
		
			 
Also you print the string right before clearing the display, do you need a delay or something in here to give you time to see the text?
On your blank screen are you getting the background colour? if not what colour are you getting?
Interesting the simulation is working with the program as is. I'll see if we can get this resolved so if the font parameter is >= the number of fonts then we default to font 0. - Edit - Scratch this, the component already does this.
 
			 
			
					
				Re: ILI9341 SPI
				Posted: Tue Jul 23, 2024 12:14 am
				by flaviae
				First of all, I would like to thank stefan.erni and BenR for their availability to help me.
According to the changes proposed by BenR, in debug mode I was able to see the simulation correctly.  I recorded the Micro again with the changes but the display still appears blank. 
I recorded a video too.
Best Regards.
Flaviae
			 
			
					
				Re: ILI9341 SPI
				Posted: Tue Jul 23, 2024 6:49 am
				by WingNut
				I think you should double check your connections (wiring)
			 
			
					
				Re: ILI9341 SPI
				Posted: Tue Jul 23, 2024 10:10 am
				by BenR
				Might also be worth doing a one second flasher test to make sure your chip configuration is ok. From the video it looks like it may be running slow and so the 5s delay at the start of your program could be taking a long time to complete?
https://www.flowcode.co.uk/wiki/index.p ... ED_flasher 
			 
			
					
				Re: ILI9341 SPI
				Posted: Tue Jul 23, 2024 10:17 pm
				by flaviae
				Good afternoon.
Before making the changes you propose, I would like to mention that the 5 seconds at the beginning of the program are only used to wait for the microcontroller to stabilize. To confirm that the program was working, I placed an LED (RE0). After 9 seconds, the LED lights up indicating that the program is in  a loop.
Following Ben's suggestion, I created another loop to turn on the LED every 1 second. 
I verified that the microcontroller works well, with the clock functioning at 20 Mhz.
Following Wingnut's advice, I checked all connections.
I also installed another new TFT to rule out a possible damage to the old one, but the result was the same.
Sorry for the insistence, but, to understand the situation, I created an identical program on the FWC8 and it worked perfectly, with the same TFT, the same connections and the same microcontroller.
I know the TFT configuration is more elaborate in the FWC10 version, but
I can't understand why it doesn't work.
Attached I send the video and a simple program made at FWC8 for you to analyze.
Kind regards,
			 
			
					
				Re: ILI9341 SPI
				Posted: Wed Jul 24, 2024 6:43 am
				by WingNut
				Did you try Stefan's suggestion of software instead of channel 1?
			 
			
					
				Re: ILI9341 SPI
				Posted: Wed Jul 24, 2024 8:39 pm
				by jgu1
				Hi Flaviae!
I have tryed to compile your program, with the config you have it look like for me the one sec flash is to fast I am not familiare with this device so I can´t help you with this. 
In the loop you set B3 and B7 "high" and you use the same pin for the display DC and RESET, I don´t think it is good 
 
One more thing, remember the data pin on the display is 3.3V so you need a devider, othervice it will not work, your device output is 5V..
I allow me to edit your program with a one sec flash (as Ben mentiod). 
I always use ESP32- dev for these display, Ben have speed it up and they are 3.3V so no divider, I can give you an examble with this device if you want 
 
Hope this can help you a little. 

 
			 
			
					
				Re: ILI9341 SPI
				Posted: Thu Jul 25, 2024 7:33 pm
				by flaviae
				Good afternoon everybody.
Yesterday I couldn't come to the forum, but I'm here today with news. I tested all the changes that were proposed, with no results. Replying to jgu1, talking about the FWC10 firmware, I confirmed the D/C pins are on RB3 and Reset on RB7, despite not using Reset. Regarding the TFT pinout, I do have the board configured for 3.3V, as you correctly pointed out.
 I also checked the connections in case there was a bad contact.
However, today  before making another change, the FWC10 made two updates and only then I did a test  using  the same program and, to my surprise, it worked. I'm not really convinced it was from that update, but it actually works.  As a rule, I would prefer to know the cause of the problem, but apparently it's been resolved. I thank all of you for the great support given.
Thanks.