hello,
is an example of how to manage the data bus on Codewarrior?
The same databus of external RAM.
I have seen all the examples folder MQX, but I have not found anything.
Maurizio
Hi Maurizio,
The MCF52259 (evb or tower) has examples of using the external MRAM that is on-board for the former and on the TWRMEM card for the later platform.
If you open the mqx/examples/hello project for the m52259evb the default target is Ext MRAM Debug.
You must build the bsp and psp prior to compiling the application in MQX3.7.
The bsp contains the code that setups and intializes the flexbus (external bus) to access the MRAM.
Open the bsp_init.c file and find the mcf5225_init() function.
Towards bottom of function the pins for the flexbus are setup and then a call to _bsp_flexbus_mram_setup() is called that will configure the flexbus module for accessing the mram on the m52259evb.
Lastly the application linker file (extmram.lcf) is used to define the memory map.
Note the m52259evb.cfg and m52259evb.mem files are used by the debugger to setup the system so the debugger can download the code to MRAM to allow you to run the example hello application.
Hope this helps.
Regards,
David
hello
I saw the code and I was able to experiment.
but I'm trying to use the LCD with a flexbus.
with the example hello in MQX, I was able to manage the EBI_CS1, but I can not run the RW and OE. I tried the configurations that I have indicated, but does not work.
#define LCD_DISK_BASE BSP_EXTERNAL_LCD_BASE
//Set Base address
FB_CSAR1 = (uint_32) LCD_DISK_BASE;
FB_CSCR1 = FB_CSCR_PS(1) // 8-bit port
| FB_CSCR_AA_MASK // auto-acknowledge
| FB_CSCR_ASET(0x1) // assert chip select on second clock edge after address is asserted ;
FB_CSMR1 = FB_CSMR_BAM(0x7) //Set base address mask for 512K address space
| FB_CSMR_V_MASK //Enable cs signal ;
FB_CSPMCR = FB_CSPMCR_GROUP1(1);
/* Configure the pins needed to FlexBus Function (Alt 5) */
/* this example uses low drive strength settings */
//address
PORTB_PCR11 = PORT_PCR_MUX(5); // fb_ad[18]
PORTB_PCR16 = PORT_PCR_MUX(5); // fb_ad[17]
PORTB_PCR17 = PORT_PCR_MUX(5); // fb_ad[16]
PORTB_PCR18 = PORT_PCR_MUX(5); // fb_ad[15]
PORTC_PCR0 = PORT_PCR_MUX(5); // fb_ad[14]
PORTC_PCR1 = PORT_PCR_MUX(5); // fb_ad[13]
PORTC_PCR2 = PORT_PCR_MUX(5); // fb_ad[12]
PORTC_PCR4 = PORT_PCR_MUX(5); // fb_ad[11]
PORTC_PCR5 = PORT_PCR_MUX(5); // fb_ad[10]
PORTC_PCR6 = PORT_PCR_MUX(5); // fb_ad[9]
PORTC_PCR7 = PORT_PCR_MUX(5); // fb_ad[8]
PORTC_PCR8 = PORT_PCR_MUX(5); // fb_ad[7]
PORTC_PCR9 = PORT_PCR_MUX(5); // fb_ad[6]
PORTC_PCR10 = PORT_PCR_MUX(5); // fb_ad[5]
PORTD_PCR2 = PORT_PCR_MUX(5); // fb_ad[4]
PORTD_PCR3 = PORT_PCR_MUX(5); // fb_ad[3]
PORTD_PCR4 = PORT_PCR_MUX(5); // fb_ad[2]
PORTD_PCR5 = PORT_PCR_MUX(5); // fb_ad[1]
PORTD_PCR6 = PORT_PCR_MUX(5); // fb_ad[0] //data
PORTB_PCR20 = PORT_PCR_MUX(5); // fb_ad[31] used as d[7]
PORTB_PCR21 = PORT_PCR_MUX(5); // fb_ad[30] used as d[6]
PORTB_PCR22 = PORT_PCR_MUX(5); // fb_ad[29] used as d[5]
PORTB_PCR23 = PORT_PCR_MUX(5); // fb_ad[28] used as d[4]
PORTC_PCR12 = PORT_PCR_MUX(5); // fb_ad[27] used as d[3]
PORTC_PCR13 = PORT_PCR_MUX(5); // fb_ad[26] used as d[2]
PORTC_PCR14 = PORT_PCR_MUX(5); // fb_ad[25] used as d[1]
PORTC_PCR15 = PORT_PCR_MUX(5); // fb_ad[24] used as d[0]
//control signals
PORTB_PCR19 = PORT_PCR_MUX(5); // fb_oe_b
PORTC_PCR11 = PORT_PCR_MUX(5); // fb_rw_b
PORTD_PCR1 = PORT_PCR_MUX(5); // fb_cs0_b
PORTD_PCR0 = PORT_PCR_MUX(5); // fb_ale
Maurizio
Hola Maurizio
TWR-LCD (modified, conected flexbus CS1 instead CS0)
TWR-MCF52259
MQX3.6
I use MQX3.6 and i have to modify the following code in bsp_init.c from bsp library in order to use CS1 to access LCD through flexbus
/*FUNCTION*-------------------------------------------------------------------** Function Name : _bsp_flexbus_lcd_setup* Returned Value : * Comments :* Setup flexbus for lcd operation**END*----------------------------------------------------------------------*/void _bsp_flexbus_lcd_setup (const uint_32 base_address){ VMCF5XXX_MINIFB_STRUCT_PTR fb_ptr = &((VMCF5225_STRUCT_PTR)BSP_IPSBAR)->FB; /* Enable external LCD mapped on CS1 */ fb_ptr->CSAR1 = MCF5XXX_FBCS_CSAR_BA(base_address); /* CS0 base address */ fb_ptr->CSCR1 = MCF5XXX_FBCS_CSCR_MUX | MCF5XXX_FBCS_CSCR_AA | MCF5XXX_FBCS_CSCR_PS_16; fb_ptr->CSMR1 = MCF5XXX_FBCS_CSMR_BAM_128K | MCF5XXX_FBCS_CSMR_V; /* The address range is set to 128K because the DC signal is connected on address wire */ }Maybe this help
Regards
thanks for the example. I understand how it works and get it to work, but I still have a problem:
The signal R / W work, but the signal OE is not working. I can not read theflexbus. I need it for other devices that I would like to implement.
Maurizio