News:

Let's find out together what makes a PIC Tick!

Main Menu

ILI9341

Started by Ivano, Nov 08, 2022, 07:20 PM

Previous topic - Next topic

John Drew

Hi Ivano,
Stephen is right. Further to his points.
Think about the SPI hardware buffer byte as being something you load to transmit then as each bit of the byte is sent by MOSI it is replaced by the bit coming in from MISO. So bit by bit the buffer changes from the sent byte to the received byte. That's why MOSI and MISO must be separate.

So you can do this:
Spibuffer = sent byte
Received byte = Spibuffer

I hope that makes sense. It's simple when you get your head around it.
John

Ivano

John
you are probably right, you are more experienced than me.
The connection of miso and mosi with a resistance was a test, and it seems to be working at the moment.
In the second case I modified the Atomix LCD_IFC.inc file to use separate mosi and miso pins so there shouldn't be any problems. Again it works.
As soon as I can I attach the files with the modification and examples.
Thanks for the info

Dompie

Perhaps a little graphical help. In this wikipedia graph you can see that MOSI en MISO must be separate pins


Johan

Ivano

#23
Good evening,
I enclose the modified LCD_IFC.inc file to be used with displays equipped with MISO and MOSI pins if you need to read them.
If Atomix thinks it's okay and wants to replace it otherwise I keep it for my own use, he is the owner of UGL.
I am also attaching 2 examples used with the 2 TFTs present in the images.
Connecting MISO combined with MOSI with a resistor was an experiment, as a beginner, but the 2 pins do their job reading and writing the display.
Probably with spi hardware it doesn't work.

atomix

Great code. I will add this to the library.

Ivano

Atomix
i only made a small modification to fit the bookcase to my miso and mosi display.
I have studied UGL library files and learned many other new things to use with Positron. Thank you.
I noticed when writing some text on the graphic displays that the command
Print At y, x, "text"
it has x and y inverted with respect to the same command on alphanumeric displays and the max value of y is 255 which cannot be used on a 240x320 display.
Perhaps this command is not intended to be used with UGL?
No problem writing
Pos (x, y) and then
Print "text"

atomix

I will do Print At x,y and fix the range 0...480 at the same time

Ivano

Thank you very much

Pepe

If I use port E of the 18f46k22 for communication with the screen it only works in the proteus simulation but not on the real hardware.