MQX eGUI running on the Tower MCF52259 - QSG

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

MQX eGUI running on the Tower MCF52259 - QSG

2,483 Views
CarlFST60L
Senior Contributor II

Hi,

 

I spent the today playing with the tower + egui(D4D) + TWR-LCD +TWR-SER + TWR-52259. There was no quick start guide so I wrote some notes that might be helpful to people getting it up and running on the MCF52259 for the first time. I had to play around a bit to get all the settings right, so this might save someone the same trouble I had to go to.

 

Here is my notes on a simple guide to getting the TWR-LCD + TWR-MCF52259 + TWR-SER + Touch screen up and running:

 

Download the latest eGUI package, the files are in _official_demos\mqx (files on the CD dont have the MQX demo!)

Recompile the BSP with line 103 in MQX\src\mqx\source\io\tchres\mcf52xx\tchres_adc_mcf52xx.c

Change from adc_ptr->CTRL2 = (BSP_SYSTEM_CLOCK - 1) / 20000000;
to adc_ptr->CTRL2 = ((BSP_SYSTEM_CLOCK / 1000000) - 5) / 10;

You also need to enable BSPCFG_ENABLE_TCHSRES (for touch screen)

And I image you need to make sure you TTYA is enabled along with ADC (for the touch screen), and SPI if your going to use that.

 

Open the example MQX project for CW7.2 (_Official_Demos\EGUI_D4D_Demo\Mqx\cwcf72\twr_mcf52259.mcp)

I use SPI so change source>D4D_Configuration>d4d_user_cfg.h from

#define D4D_LLD_LCD_HW  d4dlcdhw_mqx_fb
to this

#define D4D_LLD_LCD_HW  d4dlcdhw_mqx_spi

I powered the Tower using the main power in only, USB socket on elevator board, power switch is opposite it.

On the TWR-SER I removed all the CAN SEL jumpers (not sure if its required, but I removed anyway)

On the 52259 board, I removed J7; X_ISO + Y_ISO + Z_ISO and POT_ISO

On the TWR-LCD I enabled the SPI mode for my application, set TWR-LCD DIP SW1 to

1 = OFF, 2 = ON, 3 = ON, 4 = OFF, 5 = ON, 6 = ON, 7 = ON, 8 = ON

I also have SW5 all set to on

 

I then compile, flash and run the demo and it all works.

 

 

0 Kudos
8 Replies

669 Views
CarlFST60L
Senior Contributor II

for some reason the navigate switch on the TWR-LCD (SW2) dosent work.

 

I have added the resistors R32,44,28,23,24,29,41,26,19 (some are 10K pull ups, some are 0R as per the TWR-LCD schematic).

 

Anyone know what else needs to be done to get the nav switch working? (before I go measuring signals and stepping code)

0 Kudos

669 Views
CarlFST60L
Senior Contributor II

I have also noticed that the touch screen is always out by about half an object i.e.. I calibrated it 'perfectly' (with 0.2mm tweezers), then, when I press buttons in the demo app, its as though the touch area is 50% higher than its suppose to be... Is there a fix for this? It doesn't happen on the JM128 demo from memory.

 

Its a bit hard to demo this to people when the touch screen is so hard to use because everything is offset... Even playing with the calibration doesnt really work, it seem unstable or something else......

 

I also have a feeling there is something more to this as it randomly appears to grab a calibration point (around X:4000, y:4000) without having touched anything....

 

 

0 Kudos

669 Views
PavelM
NXP Employee
NXP Employee

We found bug in 52259 tchres driver, which will be fixed in new release. Shortly- change in _tchres_hw_adc_read function 

MCF522XX_ADC_STRUCT_PTR adc_ptr to VMCF522XX_ADC_STRUCT_PTR adc_ptr; and

adc_ptr = (MCF522XX_ADC_STRUCT_PTR)&(((VMCF5225_STRUCT_PTR)_PSP_GET_IPSBAR())->ADC); to

adc_ptr = (VMCF522XX_ADC_STRUCT_PTR)&(((VMCF5225_STRUCT_PTR)_PSP_GET_IPSBAR())->ADC);

0 Kudos

669 Views
admin
Specialist II

Hello, I am starting using the:

 

...\Freescale_embedded_GUI_SW\_Official_Demos\EGUI_D4D_Demo\Mqx\cwcf72\twr_mcf52259.mcp

demo.

 

As well I noticed the same problem that  all the objects are out by about a half an object, I mean that I have to touch outside the object (i.e. a button) in order to activate it.

 

You said :

 

We found bug in 52259 tchres driver, which will be fixed in new release. Shortly- change in _tchres_hw_adc_read function

MCF522XX_ADC_STRUCT_PTR adc_ptr to VMCF522XX_ADC_STRUCT_PTR adc_ptr; and

adc_ptr = (MCF522XX_ADC_STRUCT_PTR)&(((VMCF5225_STRUCT_PTR)_​PSP_GET_IPSBAR())->ADC); to

adc_ptr = (VMCF522XX_ADC_STRUCT_PTR)&(((VMCF5225_STRUCT_PTR)​_PSP_GET_IPSBAR())->ADC);

....

 

I tried to find the _tchres_hw_adc_read function in all the project but I couldn't.

 

When I choose Search->Find In Files in the project the only code line where this function is metioned is the extern definition of that function:

 

extern uint_16 _tchres_hw_adc_read( uchar );

 

That definition is in ...\Freescale\Freescale MQX 3.6\lib\twrmcf52259.cw\mqx\tchres_adc_mcf52xx.h file

 

but I can't find the function to change the source code that you have mentioned above.

 

Could you please tell me where I can find the source code of _tchres_hw_adc_read function so I can correct the bug you found and if I have to recompile any BSP or PSP or another library.

 

Thank you and my best regards.

 

0 Kudos

669 Views
admin
Specialist II

Hello.

 

I finally found the source code of _tchres_hw_adc_read function. Is in Program Files\Freescale\Freescale MQX 3.6\mqx\build\cwcf72\bsp_twrmcf52259 project (BSP), in tchres_adc_mcf52xx.c file.

 

I noticed the bug correction:

 

"MCF522XX_ADC_STRUCT_PTR adc_ptr to VMCF522XX_ADC_STRUCT_PTR adc_ptr; and

adc_ptr = (MCF522XX_ADC_STRUCT_PTR)&(((VMCF5225_STRUCT_PTR)_?PSP_GET_IPSBAR())->ADC); to

adc_ptr = (VMCF522XX_ADC_STRUCT_PTR)&(((VMCF5225_STRUCT_PTR)?_PSP_GET_IPSBAR())->ADC);"

 

This correction is already done in the version of BSP that I am using but I am still experimenting the "object touch shift" problem while I run the MQX LCD demo ...\Freescale_embedded_GUI_SW\_Official_Demos\EGUI_D4D_Demo\Mqx\cwcf72\twr_mcf52259.mcp

 

I do still have to touch outside the object (i.e. a button) in order to activate it.

 

Has anybody found anything to solve this issue?

 

Thanks, regards.

 

 

 

 

 

 

 

 

 

 

0 Kudos

669 Views
CarlFST60L
Senior Contributor II

I to find the touch screen is off even after the bug fix. I also find the calibration to be unstable i.e. it doesnt always work.

 

I have the demo board running my app on my desk and 'play' with my application for testing daily. I have not invested more time into making the touch screen driver work properly as I the project has been cancelled.

0 Kudos

669 Views
Gargy
NXP Employee
NXP Employee

Hello,

 I try to replicated your problem but I can't do that:smileyindifferent: . Sorry.

 

Please check the all jumper on Kirin3 board, by attached photo.

 

And one additional thing - try to change touch screen constants in bsp file:

"c:\Program Files\Freescale\Freescale MQX 3.6\mqx\source\bsp\twrmcf52259\init_tchres.c" .

 

By for example these values:

/* Adc limits struct */

   {

       FULL_SCALE,           /* FULL_SCALE */

       (FULL_SCALE / 10),     /* X_TOUCH_MIN */

       (FULL_SCALE / 10),     /* Y_TOUCH_MIN  */

       (FULL_SCALE / 2), /* X_TOUCH_MAX */

       (FULL_SCALE / 2), /* Y_TOUCH_MAX */

   },

 

Have a nice day

0 Kudos

669 Views
CarlFST60L
Senior Contributor II

Thanks so much, I will update and test today.

0 Kudos