Ameet Kaustav

Mini-FlexBus usage

Discussion created by Ameet Kaustav on May 30, 2009
Latest reply on Jul 7, 2009 by mrunmoy samal

I am trying to use the Mini-FlexBus on the MCF52259. I have written the following code:

 


#include "support_common.h"
#include <stdio.h>

#define INDEX               (*(vuint16 *)(0x60005555)) // Transaction with Index Reg.
#define DATA                (*(vuint16 *)(0x60010000)) // Transaction with Memory loc.

#define MCF_GPIO_CLKOUTPAR  (*(vuint8  *)(0x40100077))



void FB_Init(void)
{
    // Initialize Pins for Mini-FlexBus
    MCF_CCM_CCE = MCF_CCM_CCE_MBMOD; // Configure Clock to Mini-FlexBus same as fsys (1:1)

    MCF_GPIO_PTEPAR = 0xFF;     // PTE[7..0] -> FB_AD[7..0]
    MCF_GPIO_PTFPAR = 0xFF;     // PTF[7..0] -> FB_AD[15..8]
    MCF_GPIO_PTGPAR = 0xEF;     // PTG[6..7] -> FB_D[1..0]
                                // PTG[5] -> FB_CS0
                                // PTG[3..0] -> FB_AD[19..16]
    MCF_GPIO_PTHPAR = 0x5555;   // PTH[7] -> FB_RW
                                // PTH[6] -> FB_OE
                                // PTH[5..0] -> FB_D[7..2]
    MCF_GPIO_PASPAR = 0x10;     // PAS[2] -> FB_ALE
    MCF_GPIO_CLKOUTPAR = 0x2;   // CLKOUT -> FB_CLK

    // External Device Address Settings
    MCF_FBCS0_CSAR = MCF_FBCS_CSAR_BA(0x60000000); // Base Address -> 0x6000_0000
    MCF_FBCS0_CSCR = MCF_FBCS_CSCR_WS(1)           // One wait state
                   | MCF_FBCS_CSCR_AA              // Auto acknowledge enable
                   | MCF_FBCS_CSCR_MUX             // Used in Multiplexed mode
                   | MCF_FBCS_CSCR_PS_16;          // Data Bus is 16 Bit
    MCF_FBCS0_CSMR = MCF_FBCS_CSMR_BAM_128K        // Address range [0x6000_0000-0x6001_FFFF]
                   | MCF_FBCS_CSMR_V;              // Start CS0
}



int main(void)
{
    FB_Init();

    for(;;)
    {
        INDEX = 0x1234; // Address = 0x60005555, Data = 0x1234
    }

    return (0);
}

 

What I intend to do is send Data 0x1234 to address 0x60005555 continuously. But it doesn't appear that my code does so. Could anyone tell me what I am possibly doing wrong?

 

Ameet Kaustav.

Outcomes