teensy_noob
Member
From attempting an older port from Dawn Mist I found an newer update, as found here:
http://www.rinkydinkelectronics.com/library.php?id=52
It seems to compile fine, but, I've noticed that the pin config needs to be in a certain order.
In file 'HW_MX20DX256.h' (which I assume is the Teensy 3.2 definition) the ports read as follows:
void UTFT::_set_direction_registers(byte mode)
{
GPIOD_PDDR |= 0xFF;
PORTD_PCR0 = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
PORTD_PCR1 = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
PORTD_PCR2 = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
PORTD_PCR3 = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
PORTD_PCR4 = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
PORTD_PCR5 = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
PORTD_PCR6 = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
PORTD_PCR7 = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
if (mode == 16)
{
GPIOB_PDDR |= 0x000F000F;
PORTB_PCR0 = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
PORTB_PCR1 = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
PORTB_PCR2 = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
PORTB_PCR3 = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
PORTB_PCR16 = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
PORTB_PCR17 = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
PORTB_PCR18 = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
PORTB_PCR19 = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
}
}
I can't seem to find a port & pinout diagram anywhere despite extensive reading and searching.
The version that Dawn Mist had released seemed simpler as I could have changed the pin defs in the file 'HW_Teensy3.h'.
I wish to change to the following config:
PIN 0 - PIN 10 / DB0 - DB10
PIN 14 - PIN 18 / DB11 - DB15
I am asking as I would like to be able to change this again in the future in case I need to change the pinout again.
Where can I find the port numbers & pinout information?
Will this setup automatically run in 16bit parallel, or do I need to declare this in my sketch somewhere?
I have other questions on this, but I will save them for another time as these are the most pressing at the moment.
Thanks in advance!
http://www.rinkydinkelectronics.com/library.php?id=52
It seems to compile fine, but, I've noticed that the pin config needs to be in a certain order.
In file 'HW_MX20DX256.h' (which I assume is the Teensy 3.2 definition) the ports read as follows:
void UTFT::_set_direction_registers(byte mode)
{
GPIOD_PDDR |= 0xFF;
PORTD_PCR0 = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
PORTD_PCR1 = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
PORTD_PCR2 = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
PORTD_PCR3 = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
PORTD_PCR4 = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
PORTD_PCR5 = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
PORTD_PCR6 = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
PORTD_PCR7 = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
if (mode == 16)
{
GPIOB_PDDR |= 0x000F000F;
PORTB_PCR0 = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
PORTB_PCR1 = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
PORTB_PCR2 = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
PORTB_PCR3 = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
PORTB_PCR16 = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
PORTB_PCR17 = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
PORTB_PCR18 = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
PORTB_PCR19 = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
}
}
I can't seem to find a port & pinout diagram anywhere despite extensive reading and searching.
The version that Dawn Mist had released seemed simpler as I could have changed the pin defs in the file 'HW_Teensy3.h'.
I wish to change to the following config:
PIN 0 - PIN 10 / DB0 - DB10
PIN 14 - PIN 18 / DB11 - DB15
I am asking as I would like to be able to change this again in the future in case I need to change the pinout again.
Where can I find the port numbers & pinout information?
Will this setup automatically run in 16bit parallel, or do I need to declare this in my sketch somewhere?
I have other questions on this, but I will save them for another time as these are the most pressing at the moment.
Thanks in advance!