I start uVision3 and clicked 'New uVision Project' from the Project Menu. A 'Create New Project' window appears. I enter the name of the project (LEDTest) and clicked save. Then a "Select device for Target 1' window appeared. I then double-clicked on Atmel and chose the AT89C55WD as the device and I clicked OK. Then a window saying 'Copy Standard 8051 Startup Code to Project Folder and Add File To Project' appeared and I clicked yes. As soon as I did that, the Project Window displayed. On the 'Target 1' folder are 3 red dots which I know means there's something wrong. I haven't even written code yet and I'm having problems. Does anyone knows how to correct this problem?
I changed the label 'b' to an 'f' and the error mesages are gone. But 3 warnings poped up. here is the contents of the output window:
assebling LEDTest.a... linking... *** WARNING L5: CODE MEMORY SPACE OVERLAP FROM: 0000H TO: 0002H *** WARNING L1: UNRESOLVED EXTERNAL SYMBOL SYMBOL: ?C_START MODULE: STARTUP.obj (?C_STARTUP) *** WARNING L2: REFERRENCE MADE TO UNRESOLVED EXTERNAL SYMBOL: ?C_START MODULE: STARTUP.obj (?C_STARTUP) ADDRESS: 001DH Program Size: data=9.0 xdata=0 code=34 :LEDTest" - 0 Error(s), 3 Warning(s)
You need to understand why - follow the links for the descriptions of the original error messages...
I read the contents of the link file (LEDTest.lnk) and it shows zero errors and zero warnings. This is confusing. I compiled this program using an 8051 homemade compiler that I made using Visual Basic. I compared the Link file with HEX code and 2 addresses in the Link file had wrong data. I guess those are the addresses that are causing the problems.
I finally found the problem. I tried removing the file STARTUP.A51 and the program compiled perfectly. I don't know why but there is something about that file that was causing the problem.
" I don't know why "
Because this is the startup code for a 'C' program; so it expects to have a 'C' program to jump into - but you haven't provided one!
That explains it. I'm such an idiot. I thought that since it had an A51 extension that it was assembly. Are there any other files that I could add to group 1 that would give me other features that I don't know about? Do I have to put an INCLUDE file at the beginning of my code or does uVision3 do it automatically since I selected a device when setting up the project? I have a lot to learn.
"I thought that since it had an A51 extension that it was assembly."
Yes, it is assembly - you can open it and look it at - and that is why it has the A51 extension.
But its specific function is to prepare the system to run a 'C' program, and then to call that 'C' program.
"Are there any other files that I could add to group 1 that would give me other features that I don't know about?"
If you add any random file to any group you will most probably get features that you don't know about!
"Do I have to put an INCLUDE file at the beginning of my code"
No, you don't have to - but it is usually a good way to proceed.
"does uVision3 do it automatically"
Not automatically - but it does give a menu item to make manually adding the "standard" processor include file a one-click operation!
"I selected a device when setting up the project"
That's how it knows which include file to offer in the menu option. (also how it knew which startup file to offer).
"I have a lot to learn."
Indeed. And it would probably be a lot more effective if you were to take some time to sit down and do some study rather than just stumbling from error to error.