ILI9341 & XPT2046 Touchscreen

Use this section to discuss your embedded Flowcode projects.
mnfisher
Valued Contributor
Posts: 955
http://meble-kuchenne.info.pl
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 104 times
Been thanked: 508 times

Re: ILI9341 & XPT2046 Touchscreen

Post by mnfisher »

Hi Ben,

Thanks - I'll continue with my 'combined' component for now....

Note that using MX_SPI_CHANNEL_IN_USE = 1 as above does seem to solve the transmit problem - though would need to alter the redirect for initialise - the 'second' component using the channel could just redirect to an empty routine - though this might cause issues if it is initialised first and used before the 'first' component?


Thinking aloud:

I wondered - though it would entail a fair amount of change - why the CAL_SPI routines don't just 'pass' a channel number. This would remove the duplication of code at the expense of an extra parameter and some extra storage in the backend code.

So in (very) pseudocode:

CAL_SPI_1::SPI_Master_Byte(123) in the component code would call SPI_SendByte(1, 123)

The SPI backend code would have (possibly) an array of SPI channel details (setup per channel on initialise) - and then, for example,
SPI_SendByte(channel, data) {
SPIDetails *dat = SPIDat[channel];
Use values from dat...

Though it might be just as easy to code it all in FC - and have the component do all the work?

Martin

Another aside - some topics (this, for example) - I don't get notifications for. Others I do (even if I've not posted) - and will a notification for any new post. Is there a setting for this?

jgu1
Posts: 615
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 507 times
Been thanked: 132 times

Re: ILI9341 & XPT2046 Touchscreen

Post by jgu1 »

Hej Ben & Martin!

Friendly inquiry I want to know if Ben has had time to look more into the subject, pls ;)

Br Jorgen

BenR
Matrix Staff
Posts: 1739
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 440 times
Been thanked: 603 times

Re: ILI9341 & XPT2046 Touchscreen

Post by BenR »

I'll have another go for you today and see if I can find a better solution.

Edit, I've pushed a new CAL file that hopefully will now work and do what we want. Let me know.

I like your proposal Martin, I might have an explore of this idea as currently it's not really as efficient as I would like.
Another aside - some topics (this, for example) - I don't get notifications for.
The Spanner dropdown at the bottom / top of the page has a subscribe feature that might do what you want?

mnfisher
Valued Contributor
Posts: 955
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 104 times
Been thanked: 508 times

Re: ILI9341 & XPT2046 Touchscreen

Post by mnfisher »

Thanks Ben,

I'll have a play over the weekend...

Martin

jgu1
Posts: 615
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 507 times
Been thanked: 132 times

Re: ILI9341 & XPT2046 Touchscreen

Post by jgu1 »

Hi both!

After update I try config the pinconnection in program and in hardware. Not working, get error. Disaster, I am also not able to program other of my project´s with Ili9341 and ESP32 any more :o .
Please Benn, rool back again :roll:

Br Jorgen
Attachments
StandardIli9341FirsSameSpi.msg.txt
(3.01 KiB) Downloaded 83 times
StandardIli9341FirsSameSpi.fcfx
(28.26 KiB) Downloaded 87 times

mnfisher
Valued Contributor
Posts: 955
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 104 times
Been thanked: 508 times

Re: ILI9341 & XPT2046 Touchscreen

Post by mnfisher »

Hi Jorgen,

- That compiles fine for me... Something awry - you are getting
idf.py build

Usage: idf.py [OPTIONS] COMMAND1 [ARGS]... [COMMAND2 [ARGS]...]...
Try 'idf.py --help' for help.

Error: No such option: --no-hints Did you mean --no-warnings?
So giving up straight away with a compiler option error....

Strange?

Martin

jgu1
Posts: 615
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 507 times
Been thanked: 132 times

Re: ILI9341 & XPT2046 Touchscreen

Post by jgu1 »

Hi MArtin!

I am totally confused now, I can´t compile anything with esp32 on any of my laptop. I have just try to made a new simple testprogram program, will also not compile??

None of my old project either, I am confused???

Please have a look in the txt file, and help :cry:
Attachments
NotWork.msg.txt
(1.93 KiB) Downloaded 82 times
NotWork.fcfx
(7.1 KiB) Downloaded 84 times

mnfisher
Valued Contributor
Posts: 955
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 104 times
Been thanked: 508 times

Re: ILI9341 & XPT2046 Touchscreen

Post by mnfisher »

The modified esp_cal_spi.c seems to work AOK. All looks good :D using hspi and vspi!

Thanks Ben.

mnfisher
Valued Contributor
Posts: 955
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 104 times
Been thanked: 508 times

Re: ILI9341 & XPT2046 Touchscreen

Post by mnfisher »

Hi Jorgen,

Looks like your esp installation has gone AWOL? Anything else changed - check the esp directory and run install.bat and check that FC still points to the right directory...

Martin

jgu1
Posts: 615
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 507 times
Been thanked: 132 times

Re: ILI9341 & XPT2046 Touchscreen

Post by jgu1 »

Hello, Martin
I'm glad it works for you.
I really can't understand that I suddenly can't compile Esp deviceses. A short time ago I had problems with Starm and was recommended by Leigh to install this Starm compiler : File name: en.stsw-link004.zip from here :https://stm32-st-link-utility.software. ... ownloading do
and install the compiler, after that my Starm could compile, do you think that has an influence on the ESP compiler. I have not moved around any lib.

The error:
Building NotWork ...
'"C:\Users\45505\.espressif\export.bat"' is not recognized as an internal or external command,
operable program or batch file.
'idf.py' is not recognized as an internal or external command,
operable program or batch file.

I have seach for the export.bat" In the expressif lib, but it is not there. Can you see it in your Lib? Please

Please help.
I'm so sorry I suddenly can't compile ESP anymore, I have projects that I've spent many hours on and one of them isn't finished yet

Thank´s in advance

Jorgen

Post Reply