Using CRTouch with D4D 3.0 in MQX 4.1

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using CRTouch with D4D 3.0 in MQX 4.1

Jump to solution
1,407 Views
markwatson
Contributor III

It seems that all of the hooks are there for the I2C (in the twrvf65gs10_m4 BSP) and the D4D supports CRTouch, but I can't seem to figure out how to enable all of it.  I have the I2C0 defined in the user_config.h and #define D4D_LLD_TCH  d4dtch_cr_touch in the D4D_user_cfg file, but I don't know how to get it to all work together. I am using the IAR development tools.

Thanks.

Labels (3)
0 Kudos
1 Solution
1,101 Views
CommunityBot
Community Manager
This an automatic process.

We are marking this post as solved, due to the either low activity or any reply marked as correct.

If you have additional questions, please create a new post and reference to this closed post.

NXP Community!

View solution in original post

0 Kudos
6 Replies
1,102 Views
CommunityBot
Community Manager
This an automatic process.

We are marking this post as solved, due to the either low activity or any reply marked as correct.

If you have additional questions, please create a new post and reference to this closed post.

NXP Community!
0 Kudos
1,104 Views
cyborgnegotiato
Senior Contributor II

Hi Mark,

Do you still have problem?

What is your d4dtch_cr_touch_cfg.h configuration, I think, you do not set D4D_LLD_TCH_HW_CRTOUCH and other important conf. values.

For inspiration look to TWR_K70 example (eGUI/d4dtch_cr_touch_cfg.h at e62c462054fda9fda7bc825c1ba7e61bb69350f1 · Gargy007/eGUI · GitHub)

eGUI used own CRTOUCH driver via MQX I2C driver, you must enable correct I2C in MQX (user_config.conf - as you wrote), setup correct settings in d4d_user_cfg.h, d4dtch_cr_touch_cfg.h, mqx_iic_cfg.h.

If you can, share your files(configs, code...)

BTW. eGUI was never tested on Vybrid, at this time it is no more Freescale official project.

Regards,

Jozef

1,104 Views
markwatson
Contributor III

Hi Jozef,

I have the touchscreen working, but it's performance is poor.  Sometimes it does not catch button presses and sometimes it seems to respond to a button press when the button is released.  At first I thought this was due to my implementation on the Vybrid, but then we started using EGUI 3.0 on our Kinetis project and it has the same behavior. Our Kinetis project is > 2 years old and well tested, so there is something causing a problem in EGUI 3.0 or MQX 4.1 or the combination.

To get the Vybrid HW interface working I used sample code for the I2C from the bottom of this post: I2C Vybrid Code?  I then built wrappers around the functions to make them compatible with what the D4D low level drivers were looking for with something like this:

// Address related functions

void HwIIC_SetAddress(Byte address)

{

  HwIIC_Address = address;

}

// Multi Byte read Write functions - 8 bit device address mode

Byte HwIIC_MultiReadBytes(Byte regAdr, Byte *pData, Byte cnt)

{

  Byte returnValue;

 

  returnValue = (Byte) i2c_read (I2C0, HwIIC_Address, regAdr, pData, cnt);

  return (returnValue);

}

Byte HwIIC_MultiWriteBytes(Byte regAdr, Byte *pData, Byte cnt)

{

  Byte returnValue;

 

  returnValue = (Byte) i2c_write (I2C0, HwIIC_Address, regAdr, pData, cnt);

  return (returnValue);

}

All of that seems to be working perfectly, but there seems to be almost a race condition between the CRtouch chip changing its state and the D4D code that is using that state to control the screen.

Thanks.

0 Kudos
1,104 Views
kubiznak_petr
Contributor V

Hi Mark,

Please also make sure there are no more I2C devices on the same bus, or ensure exclusive access to the bus. D4D does not do that.

You also seem to use the bare metal I2C driver (hw_iic). I guess the I2C channel should then better be disabled in MQX. MQX 4.1 (or 4.1.1?) brings new I2C drivers, so this is what might have possibly changed. Or you might also want to try the MQX I2C driver (mqx_iic).

We have good experience with K70 + MQX 4.1.1 + latest eGUI + mqx_iic driver (with custom exclusive access extension, implemented in the ESL library).

Regards,

Petr

0 Kudos
1,104 Views
cyborgnegotiato
Senior Contributor II

Hi,

This issue looks like as "known" problem in old CRTOUCH driver. Do you have latest version from Gargy007/eGUI · GitHub ?

Regards,

Jozef

0 Kudos
1,104 Views
alejandrolozan1
NXP Employee
NXP Employee

Hi,

I have checked the BSP of MQX and it seems that the CRTOUCH driver is missing or not supported.

I suggest to either migrate the one found in D4D. You just need the i2c interface you are to use.

Best Regards,

Alejandro