i.MX RT1062 SEMC DBI mode

cancel
Showing results for 
Search instead for 
Did you mean: 

i.MX RT1062 SEMC DBI mode

Jump to solution
229 Views
Contributor III

Hi,

I try to use the SEMC in DBI mode in order to interface an TFT-LCD with 8bits 8080 type interface. Here is my SMEC initialization code:

/* Init SEMC perfieral */
 semc_config_t semc_config;
 SEMC_GetDefaultConfig(&semc_config);
 semc_config.dqsMode = kSEMC_Loopbackinternal; /* For more accurate timing. */
 SEMC_Init(SEMC, &semc_config);

/* Configure the SEMC module to inteface to the display, "DBI" mode */
 status_t config_res;
 semc_dbi_config_t dbi_config;
 dbi_config.csxPinMux = kSEMC_MUXA8;
 dbi_config.address = 0x80000000;
 dbi_config.memsize_kbytes = 128;
 dbi_config.columnAddrBitNum = kSEMC_Dbi_Colum_12bit;
 dbi_config.burstLen = kSEMC_Dbi_BurstLen1;
 dbi_config.portSize = kSEMC_PortSize8Bit;
 dbi_config.tCsxSetup_Ns = 100;//50;
 dbi_config.tCsxHold_Ns = 100;//50;
 dbi_config.tWexLow_Ns = 100;//40;
 dbi_config.tWexHigh_Ns = 100;//40;
 dbi_config.tRdxLow_Ns = 100;//90;
 dbi_config.tRdxHigh_Ns = 100;//70;
 dbi_config.tCsxInterval_Ns = 100;//50;
 config_res = SEMC_ConfigureDBI(SEMC, &dbi_config, CLOCK_GetFreq(kCLOCK_SemcClk));
 if(config_res != kStatus_Success)
 {
 printf("Error: Failed to initialize SEMC DBI!\n");
 }‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

Note that on this code, I've increased the timing temporary to improve debugging with logic analyser.

To write the data to the Display I then write to the address 0x80000000 for command and 0x80010000 for data by de-referencing a pointer on an unsigned char. This all seems to work, but when I try to send on byte, it appears that the SEMC sends out 8 bytes! See the logic analyser capture bellow where 0x30 is supposed to be sent:

pastedImage_2.png

Any Idea what could code those 8 bytes to be sent instead of 1 byte ?

Also, can you please help me to understand the "columnAddreBitNum"  and "busrtLen"  ?  Those totally make sens for other type of memory (SDRAM, Flash...) but not for a display.  I don't know why we have to give a memory size, as TFT with controller is only two address cells (one for commands, one for data, the address bit controlling the D/CX signal).

If some one has a code example using SEMC in DBI mode that would be greatly appreciated (there is none in the SDK).

Thanks!

Antoine

Labels (2)
0 Kudos
1 Solution
72 Views
Contributor III

Yes, data and command are inverted in my description, but this is not the cause of having 8 bytes send out. After reading lot of doc, I discovered the cause of this: The SEMC module is attached to the AXI bus wich is 64bit, hence the 8 bytes out even if the software use 1 byte.

The solution is to use the IP bus instead of dereferencing the 0x80000000 address space. There is a function in the SDK for that:

SEMC_SendIPCommand(SEMC, kSEMC_MemType_8080, (uint32_t)d0x80000000, kSEMC_NORDBICM_Write, cmd_byte, NULL);

View solution in original post

0 Kudos
3 Replies
72 Views
Contributor III

Note that I tried the init code from https://community.nxp.com/thread/497507  but with no different result.

0 Kudos
72 Views
NXP TechSupport
NXP TechSupport

Hi,

First of all, sorry for the later reply.

From below Note, I think your DBI operation is incorrect:

pastedImage_1.png

From  your descripton:

To write the data to the Display I then write to the address 0x80000000 for command and 0x80010000 for data by de-referencing a pointer on an unsigned char. 

You do the incorrect opreation, you shoulld write to the address 0x80010000 for command and 0x80000000 for data by de-referencing a pointer on an unsigned char.

Wish it helps.


Have a great day,
Mike

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
73 Views
Contributor III

Yes, data and command are inverted in my description, but this is not the cause of having 8 bytes send out. After reading lot of doc, I discovered the cause of this: The SEMC module is attached to the AXI bus wich is 64bit, hence the 8 bytes out even if the software use 1 byte.

The solution is to use the IP bus instead of dereferencing the 0x80000000 address space. There is a function in the SDK for that:

SEMC_SendIPCommand(SEMC, kSEMC_MemType_8080, (uint32_t)d0x80000000, kSEMC_NORDBICM_Write, cmd_byte, NULL);

View solution in original post

0 Kudos