Keil Logo

BUS Configuration

Typically, you must configure the microcontroller BUS before any attached devices are accessible. This is usually true for external Flash ROM devices. BUS configuration may be perfromed by Predefined Functions (like _WBYTE or _WDWORD) that write to target memory.

You may use these functions in the initialization file that you specify in the Configuration Dialog. For example:

_WDWORD(0xFFE00000, 0x20003CE3);   // BCFG0: Flash Bus Configuration
_WDWORD(0xE002C014, 0x0E6001E4);   // PINSEL2: CS0, OE, WE, BLS0..3

You may alternatively write a Debug Function and use the Configuration Wizard for menu driven configuration of the BUS System as shown below:

/***********************************************************************/
/*  FLASH.INI: Flash Initialization File                               */
/***********************************************************************/

//*** Use Configuration Wizard in Context Menu ***

FUNC void Setup (void) {

// External Memory Controller (EMC)
//   Bank Configuration 0 (BCFG0)
//     IDCY: Idle Cycles (0-15)
//     WST1: Wait States 1 (0-31)
//     WST2: Wait States 2 (0-31)
//     RBLE: Read Byte Lane Enable
//     WP: Write Protect
//     BM: Burst ROM
//     MW: Memory Width  0=8-bit  1=16-bit
//                       2=32-bit 3=Reserved
//
  _WDWORD(0xFFE00000, 0x20003CE3);   // BCFG0: Flash Bus Configuration

  _WDWORD(0xE002C014, 0x0E6001E4);   // PINSEL2: CS0, OE, WE, BLS0..3
                                     //          D0..31, A2..23, JTAG
}

Setup();                             // Setup for Flash
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.