Newhaven Display Forum

Newhaven Products => TFTs => Topic started by: bageorge@topnotchcanada.c on May 11, 2015, 08:36:34 PM

Title: NHD-2.4-240320SF-CTXI#-FT1
Post by: bageorge@topnotchcanada.c on May 11, 2015, 08:36:34 PM
Question about: NHD-2.4-240320SF-CTXI#-FT1

In what way a 16 bit command/data is mapped onto DB15 - DB0 from the datasheet?




void TFT_24S_Write_DB(uint16_t commanddata){


LATDbits.LATD2 = (0x0001&(commanddata>>15));  //TFT DB15
LATDbits.LATD3 = (0x0001&(commanddata>>14));  //TFT DB14
LATDbits.LATD12 = (0x0001&(commanddata>>13)); //TFT DB13
LATDbits.LATD13 = (0x0001&(commanddata>>12)); //TFT DB12
LATDbits.LATD4 = (0x0001&(commanddata>>11));  //TFT DB11
LATDbits.LATD5 = (0x0001&(commanddata>>10));  //TFT DB10
LATDbits.LATD6 = (0x0001&(commanddata>>9));  //TFT DB9
LATDbits.LATD7 = (0x0001&(commanddata>>8));  //TFT DB8
LATFbits.LATF0 = (0x0001&(commanddata>>7)); //TFT DB7
LATFbits.LATF1 = (0x0001&(commanddata>>6)); //TFT DB6
LATGbits.LATG1 = (0x0001&(commanddata>>5)); //TFT DB5
LATGbits.LATG0 = (0x0001&(commanddata>>4)); //TFT DB4
LATAbits.LATA6 = (0x0001&(commanddata>>3)); //TFT DB3
LATAbits.LATA7 = (0x0001&(commanddata>>2)); //TFT DB2
LATEbits.LATE0 = (0x0001&(commanddata>>1)); //TFT DB1
LATEbits.LATE1 = (0x0001&commanddata); //TFT DB0


/*
 LATDbits.LATD2 = (0x0001&(commanddata>>0));  //TFT DB15
LATDbits.LATD3 =  (0x0001&(commanddata>>1));  //TFT DB14
LATDbits.LATD12 = (0x0001&(commanddata>>2)); //TFT DB13
LATDbits.LATD13 = (0x0001&(commanddata>>3)); //TFT DB12

LATDbits.LATD4 = (0x0001&(commanddata>>4));  //TFT DB11
LATDbits.LATD5 = (0x0001&(commanddata>>5));  //TFT DB10
LATDbits.LATD6 = (0x0001&(commanddata>>6));  //TFT DB9
LATDbits.LATD7 = (0x0001&(commanddata>>7));  //TFT DB8

LATFbits.LATF0 =(0x0001&(commanddata>>8)); //TFT DB7
LATFbits.LATF1 =(0x0001&(commanddata>>9)); //TFT DB6
LATGbits.LATG1 =(0x0001&(commanddata>>10)); //TFT DB5
LATGbits.LATG0 =(0x0001&(commanddata>>11)); //TFT DB4

LATAbits.LATA6 =(0x0001&(commanddata>>12)); //TFT DB3
LATAbits.LATA7 =(0x0001&(commanddata>>13)); //TFT DB2
LATEbits.LATE0 =(0x0001&(commanddata>>14)); //TFT DB1
LATEbits.LATE1 =(0x0001&(commanddata>>15)); //TFT DB0
*/

}
Title: Re: NHD-2.4-240320SF-CTXI#-FT1
Post by: Paul_B on May 12, 2015, 02:15:46 PM
Hello,

Pin 14 (DB0) is the LSB (least significant bit) of the data byte.

Pin 29 (DB15) is the MSB (most significant bit) of the data byte.

Hope this helps!