Keil Logo

C251: Setting the Device Configuration Bytes

Information in this article applies to:

  • C251 Version 3.0 or higher


I have 251 hardware with 128K RAM and 128K FLASH ROM. I'm using an 18-bit address bus in PAGED mode. I need to set the CONFIG (UCONFIG0 and UCONFIG1) bytes at location 0xFFFFF8 and 0xFFFFF9. And, I need to set the correct memory areas in the µVision IDE. What is the correct procedure for this?


The config bytes may be set directly in the startup file provided with the C251 compiler. This file has the name START251.A51 and should be copied to your project folder. Then you should add this source file to your project and configure the options in the header of this file.

For your hardware you must make the following configuration changes in START251.A51:

CONFIGB = 1   // initializes the config bytes UCONFIG0 and UCONFIG1.
RDRG EQU  0   // configures the device for 256K External Address space.
PAGM EQU  0   // configures Page Mode (A15:8/D7:0 on P2, A7:0 on P0)

You should check to be sure that the waitstates setting matches your hardware requirements.

The memory layout of your target system may be configured directly in the µVision IDE in the dialog Project - Options for Target - Target. Under External Memory enter the following:

RAM Start:  0         SIZE: 0x20000
ROM Start:  0xFE0000  SIZE: 0x20000



Last Reviewed: Thursday, February 25, 2021

Did this article provide the answer you needed?
Not Sure
  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.