Using the DDS C Compiler with the uPAC HC16 When using DDS C for the 68HC16 on the uPAC HC16 there are a few modifications required after DDS has been installed. A batch file (6816C.BAT) is provided on disk that automatically makes these modifications for you. The modifications are all contained in the files 6816RLPL.ASM and 6816RLPS.ASM. The file ending in L is for the Large model (256K or more RAM) and the file ending in S is for the Small model (64K of RAM). The batch file replaces these files with ones that contains Chip Select modifications and board setup. --------------------------------------------------------------------------- To start the Integrated Development Environment (IDE) change directories to C:\MC CD C:\MC then type C You should now be presented with the option to select a file. Using the cursor keys select... Hello.C and press Enter. You are now in the Editor screen where you can enter programs and make changes. The file 6816.ide which is copied from the disk by the 6816C.BAT file contains all of the configuration defaults for DDS. Two of these configurations for the PC are, COM2 serial port and 9600 baud. If these are incorrect you can change them by pressing... Alt O (that is the key and the O key at the same time). You are now presented with a menu of choices. Make any changes that are required by selecting with the up/down cursor keys and pressing Enter. When you are through, press Esc to return to the Edit screen. The 6816.ide file also defaults to Small model. If you have more than 64K of RAM on your board you may want to us the Large model to take advantage of the additional RAM. To do this press... Alt C Use the cursor key to select "Options" and press Enter. At this time you can select the Large Model. press Esc to return to the Compile Pull Down menu and press Esc again to return to the Edit screen. The next step is to compile the Hello.C program. This is done by pressing... Alt C (that is the key and the C key at the same time). Use the cursor key to select "Compile" and press Enter. A window appears at the bottom of the screen. If any syntax errors had occured this is where you would be notified of them. You would then fix the errors in your program and recompile until you have 0 errors. Once you have a clean compile a Hex file of the same names is created with a .Hex extension, this is the file which will be downloaded to the uPAC HC16. To download the Hello.Hex file just created, start your BDM Debugger. (It is assumed here that you are using P&E's ICD16 Debugger). You must have your BDM cable connected to HDR4 and connect to your PC using your Printer Port. Note: There is two programs running here, this is easy to do using Windows or a DOS Shell (Doshell) program. At the Command Prompt type... RESET followed by... LOADALL \MC\Hello.Hex Your S record Hex file should now be loaded in the Boards Memory. To run the Hello program we will need to be able to see our output. To accomplish this we run/switch to DDS and put it in the terminal mode which allows us to interact with the MicroPac's COM 1 Port. You must have a serial cable connected to HDR2 and to your PC using one of your free COM Ports. press Alt T (that is the key and the T key at the same time). Use the cursor key to select "Connect" and press Enter. -------------------------------------------------------------------- This places you in the terminal mode. Now you should be ready to run the Hello program. To run the program type at the IDE16 prompt... Go The program should now print on your DDS Terminal screen Hello World then terminate. To return to the Edit screen just press... Esc If you do not see "Hello World" then make sure the the baud rate and the COM port are correct and try again. You may also try establishing communications with Procomm which is provided on the disk. -------------------------------------------------------------------- There is another C program that works with the uPAC HC16, BJ6816.C this is a simple Black Jack program. This program has been enhanced by EMAC and is far superior to the one that is included with DDS. As mentioned previously the C compiler has a number of options of its own. By pressing... Alt C and selecting "options" you can turn on/off Full ASM Listing which will give you a .lst file (ASM source file with Addresses, Opcodes, and comments) and C-Source Comments that can be very useful for debugging. These options are on by default and should stay on if symbolic debugging with IDS16 is wanted.