Author Topic: Flexbus pin  (Read 9243 times)

Offline neil

  • Sr. Member
  • ****
  • Posts: 438
    • View Profile
Flexbus pin
« on: December 22, 2009, 03:14:32 PM »
Hi Mark,
  I am using the Flexbus on the 52259 for external Ram chip, and not using the FB_ALE pin. Can I use this pin for I/O?

Regards
Neil
« Last Edit: December 22, 2009, 03:29:58 PM by neil »

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3234
    • View Profile
    • uTasker
Re: Flexbus pin
« Reply #1 on: December 22, 2009, 09:35:05 PM »
Hi Neil

The Flexbus pins are all multiplexed with ports.

The full bus configuration looks like this (from fnConfigureBus() in M5223x.c)

Code: [Select]
                                                                         // configure the port lines for non-multiplexed FlexBus (A0..A7)
    PTEPAR = (TE_FB_ADD_0_FUNCTION | TE_FB_ADD_1_FUNCTION | TE_FB_ADD_2_FUNCTION | TE_FB_ADD_3_FUNCTION | TE_FB_ADD_4_FUNCTION | TE_FB_ADD_5_FUNCTION | TE_FB_ADD_6_FUNCTION | TE_FB_ADD_7_FUNCTION);
                                                                         // address A8..A15
    PTFPAR = (TF_FB_ADD_8_FUNCTION | TF_FB_ADD_9_FUNCTION | TF_FB_ADD_10_FUNCTION | TF_FB_ADD_11_FUNCTION | TF_FB_ADD_12_FUNCTION | TF_FB_ADD_13_FUNCTION | TF_FB_ADD_14_FUNCTION | TF_FB_ADD_15_FUNCTION);
                                                                         // A16..A19, OE, RW, CS_0
    PTGPAR = (TG_FB_ADD_16_FUNCTION | TG_FB_ADD_17_FUNCTION | TG_FB_ADD_18_FUNCTION | TG_FB_ADD_19_FUNCTION | TG_FB_CS0_FUNCTION | TG_FB_OE_FUNCTION | TG_FB_RW_FUNCTION);
                                                                         // D0..D7
    PTHPAR = (TH_FB_D0_FUNCTION | TH_FB_D1_FUNCTION | TH_FB_D2_FUNCTION | TH_FB_D3_FUNCTION | TH_FB_D4_FUNCTION | TH_FB_D5_FUNCTION | TH_FB_D6_FUNCTION | TH_FB_D7_FUNCTION);

As you see, the ALE line is not used. This line could also be used as a second Flexbus CS line. If not configured for such uses it is available as GPIO bit 2 on port AS (pin 37 or K3, depending on package).

Regards

Mark



Offline tr111

  • Jr. Member
  • **
  • Posts: 72
    • View Profile
Re: Flexbus pin
« Reply #2 on: January 05, 2010, 10:34:16 AM »
external Ram chip??
WHAT is the chip type?

Offline neil

  • Sr. Member
  • ****
  • Posts: 438
    • View Profile
Re: Flexbus pin
« Reply #3 on: January 05, 2010, 11:26:10 AM »
Hi,
  I am using the IS61C25616AL RAM chip. For interfacing to the processor seethe  freescale development kit schematic.

Neil

Offline tr111

  • Jr. Member
  • **
  • Posts: 72
    • View Profile
Re: Flexbus pin
« Reply #4 on: January 07, 2010, 03:48:35 AM »
HOW to use the IS61C25616AL  in utasker??  
Can you show you code???
CAN it use as the mcf52259's 64Kbyte SRAM????
I have see the example,it use the pointer!
Can it use as the SRAM if the address is continuous with the 64Kbyte SRAM !
So the RAM is 64K+outside RAM,don't like the pointer usage!

/********************************************************************/
//DES added mb_init code
void
mcf52259_mb_init(void)
{
      static int i;
      static int8 j;
      static int tempi;
      
   /*
    * Enable MiniBus CS0 for MRAM access
    */

   MCF_MB_CSAR(0) = (0
      | MCF_MB_CSAR_BA(MRAM_ADDRESS));

   MCF_MB_CSCR(0) = (0
      | MCF_MB_CSCR_SWS(0)
      | MCF_MB_CSCR_SWSEN(0)
      | MCF_MB_CSCR_ASET(0)      //DES was 3
      | MCF_MB_CSCR_RDAH(0)      //DES was 3
      | MCF_MB_CSCR_WRAH(0)      //DES was 3
      | MCF_MB_CSCR_WS(1)         //DES was 20
      | MCF_MB_CSCR_MUX(0)
      | MCF_MB_CSCR_AA(1)
      | MCF_MB_CSCR_PS(1)
      | MCF_MB_CSCR_BSTR(0)
      | MCF_MB_CSCR_BSTW(0));

   MCF_MB_CSMR(0) = (0
      | MCF_MB_CSMR_BAM(0x007f)
      | MCF_MB_CSMR_V(1));
/*      
  while(1)
  {
      for(i=0,j=0; i<0x80000; i++)
      {
         (*(vuint8 *)(0x80000000 + i)) = j++;      //write
      }

      for(i=0; i<0x80000; i++)
      {
         tempi = (*(vuint8 *)(0x80000000 + i));   //read
      }

   
  }
 */
 
}
« Last Edit: January 07, 2010, 04:36:49 AM by tr111 »