Chapter 7. Flash COP8 Sample Application

This sample application shows the abilities of COP8C and C programming for an embedded system. The application is an example of a sophisticated consumer device: it manages a complex user interface through an LCD display and several switches, it plays sound samples through a PWM, and it addresses other peripherals and PC-based host software.

C source, precompiled binaries, and a listing file are available. Compiling it is easy:

  1. Install COP8C according to the instructions. In particular, make sure that the environment variables are set as follows:

    • The INCLUDE variable should be set to point to the include and include\dev subdirectories of the COP8C installation.

    • The LIBRARY variable should be set to point to the lib subdirectory.

    If you are using a Windows compiler, you can either set the INCLUDE and LIBRARY settings in the COP8C dialog, or create and configure a BCLIDE project, instead of setting environment variables.

  2. Compile the C source file as follows:

    For Windows

    cop8cwin.exe +di cop8capp.c

    For DOS

    cop8c.exe +di cop8capp.c

    The compiler will create a .COD file and a .HEX file. The .COD file is appropriate for the MetaLink in-system emulator, and the .HEX file will work with National's Betalite software.

More information is available in the application note. You will need Acrobat Reader to open and read the application note PDF file.

C Source: cop8capp.c

Generated Listing File: cop8capp.lst

Application Note: cop8capp.pdf