Teensy 3.1 and UTFT Library

Status
Not open for further replies.

craiglindley

Well-known member
I have a LCD which is based on the SD1289 controller chip. I see that the UTFT library supports my display in 16 bit parallel mode. In looking at the UTFT requirements doc I see the wiring from the Teensy 3.1 to the LCD connector uses signals on the bottom of the Teensy board which I would rather not do. In fact the wiring between the DBx signals on the display and the Teensy 3.1 seems to jump all over where as I would like to connect pin0 - pin 15 on the Teensy to DB0 - DB15 on the display.

Is there some reason for this? Does the documented arrangement of signals somehow group port pins within the ARM processor together so writes are optimized?

If I sequentially connect up the pins as I mentioned would performance be compromised?

I feel I must be missing something here but don't know what.

Thanks
 
I have a LCD which is based on the SD1289 controller chip. I see that the UTFT library supports my display in 16 bit parallel mode. In looking at the UTFT requirements doc I see the wiring from the Teensy 3.1 to the LCD connector uses signals on the bottom of the Teensy board which I would rather not do. In fact the wiring between the DBx signals on the display and the Teensy 3.1 seems to jump all over where as I would like to connect pin0 - pin 15 on the Teensy to DB0 - DB15 on the display.

Is there some reason for this? Does the documented arrangement of signals somehow group port pins within the ARM processor together so writes are optimized?

If I sequentially connect up the pins as I mentioned would performance be compromised?

I feel I must be missing something here but don't know what.

Thanks

Yeah, you're right on the first part. It's arranged that way for the sake of write speeds. On the teensy 3.1 it uses port D and port B like this:

Code:
*(volatile uint8_t *)(&GPIOD_PDOR) = VH;
GPIOB_PCOR = 0x000F000F;							// clear data lines B0-3,B16-19
GPIOB_PSOR = (0x0F & VL) | ((VL >> 4) << 16);  		// set data lines 0-3,16-19 if set in cl

You can hook everything up sequentially but you're going to take a huge drop in speed. I think you'll have to modify the UTFT library as well because it doesn't look like it makes provisions for this.

If you want to try that I think you'll want to look at lines 89 - 91 in the HW_MX20DX256.h file in the UTFT library.

You'll probably want to replace them with something like this:

Code:
digitalWriteFast(0, VH & 1);		 
digitalWriteFast(1, (VH >> 1) & 1)); 
digitalWriteFast(2, (VH >> 2) & 1)); 
digitalWriteFast(3, (VH >> 3) & 1)); 
digitalWriteFast(4, (VH >> 4) & 1)); 
digitalWriteFast(5, (VH >> 5) & 1)); 
digitalWriteFast(6, (VH >> 6) & 1)); 
digitalWriteFast(7, (VH >> 7) & 1)); 

digitalWriteFast(8, VL & 1);		  
digitalWriteFast(9, (VL >> 1) & 1));  
digitalWriteFast(10, (VL >> 2) & 1)); 
digitalWriteFast(11, (VL >> 3) & 1)); 
digitalWriteFast(12, (VL >> 4) & 1)); 
digitalWriteFast(13, (VL >> 5) & 1)); 
digitalWriteFast(14, (VL >> 6) & 1)); 
digitalWriteFast(15, (VL >> 7) & 1));
 
Yes in my further investigation I proved to myself what you just said. Yes there is a speed hit but for my application it doesn't seem to be a problem. The Teensy 3.1 at 96 MHz is amazingly fast.

I actually got UTFT and UTouch working together but I did have to modify UTouch to do so. Used every digital line on the top side of the board but that is OK as well.

Thanks for you response
 
Status
Not open for further replies.
Back
Top