Chapter 2. MS Windows

Step 1. Type in the following program in a text editor like notepad and save it as hello.c.

#include <board.h>
#include <lcd.h>

int main()
{
        board_init();
        lcd_init();

        lcd_puts("Hello World!\n");
        return 0;
}

Step 2. Open a DOS box, switch to the folder containing the C file and compile it using the following command.

> zcc zkit-51-rd2 hello.c

Step 3. Fix the errors, if any and check the folder for executable file with the extension ihx.

Step 4. Connect the ZKit-51-RD2 to the PC using the USB cable. Open Flash Magic, select the following parameters in the Flash Magic window, under Communications section.

Device
P89V51RD2
COM Port
To determine the COM port see Chapter 4, Determining COM Port.
Baud Rate
9600
Interface
ISP
Oscillator
18.432

Step 5. Select the Erase block used by Hex File check box, under the Erase section.

Step 6. Select the hex file generated in Step 3, under the Hex File section.

Step 7. Click on the start button to download the hex file, on to the micro-controller.

Figure 2.1. Download using Flash Magic

Flash Magic Screenshot