Frequently Asked Questions

for

SC51: 8051 Compiler


1.      Does SC51 C Compiler support XYZ micro-controller?

2.      I compiled my program, there are no errors, but .HEX file is not produced. Why?

3.      What is a ‘project’? How can I create a new ‘project’?

Q1. Does SC51 C Compiler support XYZ micro-controller?

Answer: Our SC51 C compiler supports all 8051 family micro-controllers, which are truely machine code compatible with original 8051. The Project/Settings in the IDE ask you to select a manufacturer (like Philips, Intel, Atmel...) and then further to select the device (like P89C51Rx2, P89C668...). We try to keep this list updated, however some of the 8051 derivatives may not be mentioned in the list. It does not mean that it is not supported. If the device you wish to use (e.g. 89LPC931) is not displayed in the list, you may select "Intel" as manufacturer and either 8051 or 8052 as the device – depending upon, whether your chip has 128 bytes or 256 bytes internal data memory. If your chip has any "extra" SFRs than Intel 8051, then you may need to manually declare those SFRs in your C program. This is very easy and it takes the form:

SFR     P1        0x90

This way you may declare all the extra SFRs. Standard SFRs are already declared in header files like <Intel\8051.h> and so on.

In addition to all "true" 8051 compatibles, the SC51 C Compiler also supports 8051MX family devices - which support upto 8MB memory. One example of 8051MX device is the Philips 89C669.

Please note: the SC51 package includes simulator for 8051. This simulator, however can only simulate the standard 8051 or 8052. Many 8051 derivatives include more features and integrated peripherals than original 8051. Extra features (such as watch-dog) and extra integrated peripherals (such as A/D converter) can not be simulated. Only standard features and peripherals (like timer, I/O ports, serial port...) are simulated.

Q2. I compiled my program, there are no errors, but .HEX file is not produced. Why?

Answer: Selecting Compile from Compile menu will simply compile the currently active source file. To get the HEX code, you need to select Build or Re-build all from Compile menu. Number of things happen when you do so:

·        First C file of this project is compiled. The result of compiling is that the Object module or .OBJ file is produced (if there are no errors).

·        The same process is repeated for all other C files of this project.

·        First ASM file of this project is assembled. The result of compiling is that the Object module or .OBJ file is produced (if there are no errors).

·        The same process is repeated for all other ASM files of this project.

·        The Linker is invoked with all the OBJ files produced in the above steps as well all OBJ files that are part of this project. If there are no errors, the .HEX file is produced. It has the same name as the project filename, but the extention is .HEX.

·        If there is even a single error in any of the above steps, then the .HEX will not be produced.

Upon selecting Re-build all all C files and Assembly language files are compiled or assembled; if there are no errors, then Linking is performed.

Upon selecting Build only those steps are performed that are necessary. In this case, the IDE will check dependencies based on file date and time stamp. For example: if MODULE1.OBJ file is newer thant MODULE1.C, then it means that the file MODULE1.C has been compiled already and the .OBJ file is ready. Hence, MODULE1.C file will not be compiled. Similar check will be performed for all other parts of the project.

Sometimes the IDE may not be able to detect dependencies due to number of reasons. If you suspect so, then please select Re-build all to create the .HEX file.

Q3. What is a ‘project’? How can I create a new ‘project’?

Answer: A ‘project’ maybe considered as a collection of modules. All these modules together make up the application. In some cases, a project may have only a single module. Theoretically, a project can have any number of modules; for practical reasons, the IDE allows upto 48 modules in a project.

A ‘module’ can be one of the 4:

·        C source program file (generally filename extention .C)

·        Assembly language source program file (generally filename extention .ASM)

·        Object module (generally filename extention .OBJ)

·        Library (generally filename extention .LIB)

Any C project (that is- a project which has at least one C source program module) must also have the module “startup.asm”. This module is automatically created by the compiler and it is not expected to be modified by the user.

Follow these steps to create a new C project:

·        Start SIDE51.

·        Select “Close project” from “Project” menu.

·        Select “Close file” from “File” menu; repeat it until all files are closed.

·        Select “New project” from “Project” menu.

·        Select the desired path where you would like to create the project.

·        Type appropriate filename for the project. Please do not type any filename extention. For example, you may type MyFirst.

·        Press “Open” button.

·        The Project Settings window will pop-up.

·        If you know the target micro-controller of your application: select manufacturer from he list and then select the desired target from the list of micro-controllers. Some similar micro-controllers have been clubbed together under a common name – for example C8051F12x under Cygnal.

·        If you don’t know the target and/or if the target micro-controller is not listed, then select “Intel” as manufacturer. Then select either 8051 or 8052 – depending on whether the target has 128 or 256 bytes internal data memory.

·        Click on the “Source files” tab within the Project settings window.

·        You will notice that the IDE has automatically added two files in your project: startup.asm and MyFirst.C. In fact, if MyFirst.C does not exist, then the IDE will actually create it.

·        If you wish to add any other modules to the project, you may do so by pressing Add file button.

·        Finally, press OK button to create the project.


HOME | PRODUCTS | SUPPORT | TRAINING | SERVICES | PRICES | DOWNLOAD | FEEDBACK | JOBS