ILI948x_t41_p - a parallel display driver for Teensy 4.1

Been playing around with it - got a partial read to work and it’s writing some odd stuff to the display.
The issue is the bit shifting from the data point to the buffers - my skills with bitwise operators are somewhat limited and while I know exactly how each operator works, I just can’t get it to play right. Even chatGPT is way off at this stuff many times.

Anyways, will try debug more with the logic analyzer when I get a chance!
 
Let me know if I can help with the bitwise puzzle.
It’s also not my strongest suit but I may get lucky :-D

Sorry for the late reply, was on vacation the whole week!

I pushed an update that semi works - you can try it out, although something broke my 9486 and I can no longer test on the bench.

Here is the bit shifting logic:
The FlexIO buffer is 32 bits long
We are using bits 0,1,2,3 and 6,7,8 and 9 for the data (same pins as well)

So when writing a command (8 bits in length) we need to shift the upper 4 bits to FlexIO bits 0-3 and the lower 8 bits to FlexIO bits 6-9
When writing pixel data (16 bits in length) we need to use the same approach as the command, but we need to split the 16 bit integer into two 8 bit integers - the lower byte and the upper byte

When reading, we do the opposite, we read bits 0-3 from FlexIO and push them into an 8 bit integer, and then we read bits 6-9 from FlexIO and write them into the 8 bit integer from bit #4.

So in theory this is all fairly simple, but I just can't get it to work properly for some reason.
 
Sorry for the late reply, was on vacation the whole week!

I pushed an update that semi works - you can try it out, although something broke my 9486 and I can no longer test on the bench.

Here is the bit shifting logic:
The FlexIO buffer is 32 bits long
We are using bits 0,1,2,3 and 6,7,8 and 9 for the data (same pins as well)

So when writing a command (8 bits in length) we need to shift the upper 4 bits to FlexIO bits 0-3 and the lower 8 bits to FlexIO bits 6-9
When writing pixel data (16 bits in length) we need to use the same approach as the command, but we need to split the 16 bit integer into two 8 bit integers - the lower byte and the upper byte

When reading, we do the opposite, we read bits 0-3 from FlexIO and push them into an 8 bit integer, and then we read bits 6-9 from FlexIO and write them into the 8 bit integer from bit #4.

So in theory this is all fairly simple, but I just can't get it to work properly for some reason.

I'm gonna take a look at this but wanted to check if I understand the goal correctly.
Let's assume command = 1101 1001

Then the high nibble is 1101
The low nibble is 1001

Must the FlexIO integer then be:

0000 0010 0100 1101

Just want to know sure I have the bit positions correct before I work on solving the bit shifting.
If my example is off, then please supply values for the correct example and I'll try to fix it.
 
If the command value is 1101 1001 then FlexIO shifter buffer needs to receive 0000 0011 0100 1001
Basically between the 4 high bits and 4 low bits we insert two empty bits as can be seen between the highlighted bits above
 
Maybe the shift into the FlexIO buffer needs to be the opposite way around
Eg shift 4 bits in from bit 22 to bit 26 and then another 4 bits from bit 28-31
 
Back
Top