We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello all, I am learn myself programming in C for MCUs. Especially for x51. At start i choose 2051. And i have problem. When i wrote a simple program and check USE ONCHIP MEMORY in project settings i get this errors while compiling *** ERROR L107: ADDRESS SPACE OVERFLOW SPACE: CODE SEGMENT: ?PR?MAIN?ZK1 LENGTH: 002FH *** ERROR L107: ADDRESS SPACE OVERFLOW SPACE: CODE SEGMENT: ?PR?MAIN?ZK1 LENGTH: 002FH *** ERROR L107: ADDRESS SPACE OVERFLOW SPACE: CODE SEGMENT: ?C_C51STARTUP LENGTH: 000CH *** ERROR L107: ADDRESS SPACE OVERFLOW SPACE: CODE SEGMENT: ?C_C51STARTUP LENGTH: 000CH *** ERROR L105: PUBLIC REFERS TO IGNORED SEGMENT SYMBOL: MAIN SEGMENT: ?PR?MAIN?ZK1 *** ERROR L120: CONTENT BELONGS TO ERRONEOUS SEGMENT SEGMENT: ?PR?MAIN?ZK1 MODULE: zk1.obj (ZK1) *** ERROR L120: CONTENT BELONGS TO ERRONEOUS SEGMENT SEGMENT: ?C_C51STARTUP MODULE: D:\8051\KEIL-C\C51\LIB\C51S.LIB (?C_STARTUP) *** ERROR L118: REFERENCE MADE TO ERRONEOUS EXTERNAL SYMBOL: ?C_START MODULE: D:\8051\KEIL-C\C51\LIB\C51S.LIB (?C_STARTUP) ADDRESS: 000AH
Here is the code of the program
#include <AT892051.h> void main(){ short i=0; while(1) { P1=255; while(i<255) { i++; } P1=0; i=0; while(i<255) { i++; } } }
What I do wrong?
"What I do wrong?"
You used the free evaluation version, and didn't read the list of limitations - especially with regard to processors like the 2051 with small on-chip code memory...
http://www.keil.com/demo/limits.asp
Oh yes, I must skip this section, when i read the limitations of demo. I solve this problem with sdcc and eclipse. I use keil for write program and test and then I compile it with sdcc in eclipse bc eclipse has no debuging.
Thanx for your help