Discussion in "Project Help" started by    Amit Kumar Das    Jun 29, 2015.
Mon Jun 29 2015, 11:33 pm
#1
Suppose the ILI9320 TFT LSB & MSB pins are connected to Port B & Port C respectively. In that case the code will be :-

GPIOB->ODR=((GPIOB->ODR&0x00ff)|(data<<8));
GPIOC->ODR=((GPIOC->ODR&0xff00)|(data>>8));

Suppose in case of different connection like :-

PD14 - DB0, PD15 - DB1, PD0 - DB2, PD1 - DB3, PE7 - DB4, PE8 - DB5,
PE9 - DB6, PE10 - DB7, PE11 - DB8, PE12 - DB9, PE13 - DB10, PE14 - DB11,
PE15 - DB12, PD8 - DB13, PD9 - DB14, PD10 - DB15

In such case how the above coded statements has to be modified ?


[ Edited Mon Jun 29 2015, 11:35 pm ]
Mon Jul 13 2015, 03:23 pm
#2
There is no right to way to handle such hardware interfacing. You need to write your own glue logic to handle data bits and fit them in right place on the port pins. Best way could be to map data bit vs pin position array and run a loop on the data bit. so even if there is change in the design you just need to update the pin<->data mapping.

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

MnoioCoove
Tue May 21 2024, 02:06 am
PedroDug
Sun May 19 2024, 05:39 pm
JewelAmuck
Sun May 19 2024, 03:06 pm
Minniemus
Sun May 19 2024, 07:39 am
Andyhet
Sat May 18 2024, 07:28 am
BrettTibre
Fri May 17 2024, 06:14 pm
Gordonfax
Fri May 17 2024, 10:28 am
Davidspils
Fri May 17 2024, 10:19 am