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

ztaletpzca
Wed Apr 24 2024, 11:19 pm
IrardlPex
Wed Apr 24 2024, 08:42 pm
Charlestehed
Wed Apr 24 2024, 05:20 pm
Robertgurse
Wed Apr 24 2024, 02:43 pm
Richardedils
Wed Apr 24 2024, 04:07 am
Malcolmaccek
Wed Apr 24 2024, 01:21 am
ChrisLub
Tue Apr 23 2024, 05:21 pm
Davidbab
Tue Apr 23 2024, 10:41 am