This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

SYSCON1 sfr not defined

We are using c166 compiler version 4.05. When we add the line

sfr SYSCON1 = 0xF1DC;

to the include file which "should" already have it defined, we get

error C155: 'SYSCON1': invalid base address.

How do we access this sfr without an error?

Thanks

Parents
  • We are using c166 compiler version 4.05. When we add the line

    sfr SYSCON1 = 0xF1DC;

    to the include file which "should" already have it defined, we get

    error C155: 'SYSCON1': invalid base address.

    How do we access this sfr without an error?


    The SYSCON1 register is not included in EVERY C16x/ST10 chip. It is only included in header files for chips with this register. In the \keil\c166\inc directory, there should be a file named, C167CS.H. This file includes the definition for SYSCON1. There have been header file changes since V4.05, so you may want to check http://www.keil.com/update for the latest C16x tool updates.

    As for the error message, the C16x is a chip with two different architectures (the C166 and the C167/1/3/4/5). The C166 is the oroginal part, The C167 is an upgraded architecture with new instructions and expanded SFR address spaces. There is a compiler switch (MOD167) that enables the enhanced features of the C167/1/3/4/5 which includes the extended SFR address space. So, including the MOD167 directive will fix the error message you are receiving. Take a look at the following knowledgebase article for more details:

    http://www.keil.com/support/docs/285.htm

    If you are using uVision2, you should NOT be having this problem unless you selected the wrong chip when you created your project.

    Jon





Reply
  • We are using c166 compiler version 4.05. When we add the line

    sfr SYSCON1 = 0xF1DC;

    to the include file which "should" already have it defined, we get

    error C155: 'SYSCON1': invalid base address.

    How do we access this sfr without an error?


    The SYSCON1 register is not included in EVERY C16x/ST10 chip. It is only included in header files for chips with this register. In the \keil\c166\inc directory, there should be a file named, C167CS.H. This file includes the definition for SYSCON1. There have been header file changes since V4.05, so you may want to check http://www.keil.com/update for the latest C16x tool updates.

    As for the error message, the C16x is a chip with two different architectures (the C166 and the C167/1/3/4/5). The C166 is the oroginal part, The C167 is an upgraded architecture with new instructions and expanded SFR address spaces. There is a compiler switch (MOD167) that enables the enhanced features of the C167/1/3/4/5 which includes the extended SFR address space. So, including the MOD167 directive will fix the error message you are receiving. Take a look at the following knowledgebase article for more details:

    http://www.keil.com/support/docs/285.htm

    If you are using uVision2, you should NOT be having this problem unless you selected the wrong chip when you created your project.

    Jon





Children