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
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
Thanks to Jon for the reply. However, we are using uVision2 V2.05, and have included the MOD167 directive. We are using the c161csjx.h include file to build software for an Infineon C161JC controller, which uses this register for power moding. I believe there may be an unreported problem here, is there any other way to access this sfr for this chip?
Are you using a PK166 or a PK161? Jon
Pk161
Hmmmm, When Infineon launched the C161, they asked us to make a low-cost, restricted kit that was limited in the SFR space. As the 161 became more popular, they started adding more SFRs and this caused the compiler to break. I'm certain this is corrected in the latest release. Download the latest update from http://www.keil.com/update and that should fix the problem. Jon