vindar / ILI9341_T4

Optimized ILI9341 screen driver library for Teensy 4/4.1, with vsync and diff. updates.
GNU Lesser General Public License v2.1
70 stars 12 forks source link

Can DC pin be moved? #6

Closed MaltWhiskey closed 2 years ago

MaltWhiskey commented 2 years ago

I have made a board using SPI pins 11,12 & 13. and PIN 20 for DC (pin 15 for CS). Normally the DC and CS are free to choose, but I only found your library recently and it needs pin 10 for DC. I'm using that pin for FLEXIO2 and it would be hard to modify my board.

Is there anyway to allow another pin for DC in software? I would really like to use your library.

This is my project https://github.com/MaltWhiskey/Mega-Cube if you are interested, a yt video is included. I need non-blocking updates to the lcd, since I can't spare processing power.

vindar commented 2 years ago

Hi,

The way the library is coded, the DC pin MUST be an hardware CS pin. This is because DC needs be toggled very frequently when doing differential updates: using another digital pin would make synchronization of MOSI and DC a nightmare at high speed, while using a hardware CS pin enables to use special instructions that keep DC and MOSI in sync... On the other hand, the CS pin itself is toggled only once (at the beginning and end of transfer) so any digital pin can be used.

Since you are using SPI0 on 4.1, then according to this diagram, you can use either pin 10, 36 or 37 for DC. I have not tried the library with 36 or 37 but I think it should work ok.

If you cannot change the DC pin at all, then I suggest you look at Kurte's ILI9341_t3n library. It is a great screen driver and I believe you can use any pin for CS and DC. It can also perform updates via DMA so it is non-blocking.

By the way, I saw you cube project when you posted on the PJRC forum, it is amazing and the result is mesmerizing ! ;-)

MaltWhiskey commented 2 years ago

Hi Vindar,

Thanks for reply and suggestion to look a Kurt Eckhardt library (I didn’t know it works on Teensy 4). I’m using a teensy 4.0 so there is only 1 hardware CS pin and that one is unavailable (unless i make a new board and disassemble my cube and replace the board). Currently i use Paul’s library, but that’s not cutting the cake.

Too bad i can’t (for now) use your library, it had a lot of appeal being header only, dma, differential updates, double buffering and none of the balast of drawing routines.

vindar commented 2 years ago

Hi,

I do not know if you are still interested but I made some changes to the library. Any pin can now be used for CS and DC (but using a hardware CS pin for DC will still give the best framerate and lowest busy time).

MaltWhiskey commented 2 years ago

Thanks for the update, i’ll go check it out :)

Op 19 mei 2022 om 03:07 heeft Arvind Singh @.***> het volgende geschreven:



Hi,

I do not know if you are still interested but I made some changes to the library. Any pin can now be used for CS and DC (but using a hardware CS pin for DC will still give the best framerate and lowest busy time).

— Reply to this email directly, view it on GitHubhttps://github.com/vindar/ILI9341_T4/issues/6#issuecomment-1130899283, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AKYMZ5WNITTPMOV5RRM7YWTVKWH6TANCNFSM5JCCLX7A. You are receiving this because you authored the thread.Message ID: @.***>