Carl Norman

MQX eGUI running on the Tower MCF52259 - QSG

Discussion created by Carl Norman on Aug 18, 2010
Latest reply on Nov 30, 2010 by Petr Gargulak



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.