Quickstart with CodeWarrior Here is an example and step by step instruction how to create a project, compile, download, and execute a standalone program. This method requires a JTAG cable. Try this simple program on IsoPod V1, or V2, or NMIN-0803-H3 and follow the Codewarrior software setup procedures below. This program toggles the LEDs on onboard. 1. Use CodeWarrior to Create a New Project - Name the Project and its location or path directory. I named my project is leds and keep it under the default folder , C:\metrowerks\CodeWarrior Examples\Isopod or C:\metrowerks\CodeWarrior Examples\N803H3 This make it easy for me to look up later when i have several different eval boards to play with. 2. Under Project Tab selects Dsp56800 EABI Stationary and click on OK button. 3. Under Stationary Project click on the down arrow and scroll down on the bottom and selects M56805 (for CW V5.0 or ealier). If you have CW V5.2 then select Stationery ("M56801_80Mhz") 4. Now the new led.mcp file is created. 5. Double click or open the C Sources folder you will see a file, M56800_main.c 6. Highlight and copy the program below. /*-----------------------------------------------* Program Name: leds.c Application: Chasing leds Target Board: IsoPod V1, or V2, or NMIN-0803-H3 *------------------------------------------------*/ /* Please comment/uncomment to deselect/select for the Hardware as described below */ // #define VERSION 1 /* IsoPod V1 */ #define VERSION 2 /* IsoPod V2 */ // #define VERSION 3 /* NMIN-0803-H3 */ /* PORTA General Purpose Input/Output (GPIOA) */ #define papur (short *)0x0fb0 //; Port A pull-up reg. #define padr (short *)0x0fb1 //; Port A data reg. #define paddr (short *)0x0fb2 //; Port A data direction reg. #define paper (short *)0x0fb3 //; Port A peripheral reg. #define paiar (short *)0x0fb4 //; Port A interrupt assert reg. #define paienr (short *)0x0fb5 //; Port A interrupt enable reg. #define paipolr (short *)0x0fb6 //; Port A interrupt polarity reg. #define paipr (short *)0x0fb7 //; Port A interrupt pending reg. #define paiesr (short *)0x0fb8 //; Port A interrupt edge sensitive reg. /* PORTD General Purpose Input/Output (GPIOD) */ #define pdpur (short *)0x0fe0 //; Port D pull-up reg. #define pddr (short *)0x0fe1 //; Port D data reg. #define pdddr (short *)0x0fe2 //; Port D data direction reg. #define pdper (short *)0x0fe3 //; Port D peripheral reg. #define pdiar (short *)0x0fe4 //; Port D interrupt assert reg. #define pdienr (short *)0x0fe5 //; Port D interrupt enable reg. #define pdipolr (short *)0x0fe6 //; Port D interrupt polarity reg. #define pdipr (short *)0x0fe7 //; Port D interrupt pending reg. #define pdiesr (short *)0x0fe8 //; Port D interrupt edge sensitive reg. /* PORTE General Purpose Input/Output (GPIOE) */ #define pepur (short *)0x0ff0 //; Port E pull-up reg. #define pedr (short *)0x0ff1 //; Port E data reg. #define peddr (short *)0x0ff2 //; Port E data direction reg. #define peper (short *)0x0ff3 //; Port E peripheral reg. #define peiar (short *)0x0ff4 //; Port E interrupt assert reg. #define peienr (short *)0x0ff5 //; Port E interrupt enable reg. #define peipolr (short *)0x0ff6 //; Port E interrupt polarity reg. #define peipr (short *)0x0ff7 //; Port E interrupt pending reg. #define peiesr (short *)0x0ff8 //; Port E interrupt edge sensitive reg. #if VERSION==1 #define REDLED_ON *pddr = *pddr|0x0010 #define REDLED_OFF *pddr = *pddr&0x00EF #define YELLED_ON *pedr = *pedr|0x0004 #define YELLED_OFF *pedr = *pedr&0x00FB #define GRNLED_ON *pedr = *pedr|0x0008 #define GRNLED_OFF *pedr = *pedr&0x00F7 #endif #if VERSION==2 #define REDLED_ON *pddr = *pddr|0x0001 #define REDLED_OFF *pddr = *pddr&0x00FE #define YELLED_ON *pddr = *pddr|0x0002 #define YELLED_OFF *pddr = *pddr&0x00FD #define GRNLED_ON *pddr = *pddr|0x0004 #define GRNLED_OFF *pddr = *pddr&0x00FB #endif #if VERSION==3 #define REDLED_ON *padr = *padr|0x0008 #define REDLED_OFF *padr = *padr&0x00F7 #define YELLED_ON *padr = *padr|0x0010 #define YELLED_OFF *padr = *padr&0x00EF #define GRNLED_ON *padr = *padr|0x0020 #define GRNLED_OFF *padr = *padr&0x00DF #endif void init_pa(void); void init_pd(void); void init_pe(void); void delay(void); void chaseleds(void); // ------ PortA init routine -------- void init_pa( void ) { *paiar = 0x0000; *paienr = 0x0000; *paipolr = 0x0000; *paiesr = 0x0000; *padr = 0x0000; *paddr = 0x00ff; *paper = 0x0000; } // ------ PortD init routine -------- void init_pd( void ) { *pdiar = 0x0000; *pdienr = 0x0000; *pdipolr = 0x0000; *pdiesr = 0x0000; *pddr = 0x0000; *pdddr = 0x00ff; *pdper = 0x0000; } // ------ PortE init routine -------- void init_pe( void ) { *peiar = 0x0000; *peienr = 0x0000; *peipolr = 0x0000; *peiesr = 0x0000; *pedr = 0x0000; *peddr = 0x00ff; *peper = 0x0000; } // ----- delay routine ------ void delay( void ) { unsigned int i, j; for( i = 0; i < 5; i++ ) { for( j = 0; j < 0xffff; j++ ) { asm(nop); asm(nop); asm(nop); asm(nop); asm(nop); } } } void chaseleds(void) { REDLED_ON; YELLED_OFF; GRNLED_OFF; delay(); REDLED_OFF; YELLED_ON; GRNLED_OFF; delay(); REDLED_OFF; YELLED_OFF; GRNLED_ON; delay(); REDLED_OFF; YELLED_ON; GRNLED_OFF; delay(); } // ----- main routine ----- void main(void) { init_pa(); init_pd(); init_pe(); while(1) { chaseleds(); } return; } /* ----- end of leds program ------ */ 7. Back to the Codewarrior, Double click on M56800_main.c file to open and paste this leds program over the existing code then click on file then Edit the program by comment or uncomment to select the hardware you are going to run the test program on. Then Save file As... I saved mine as LEDS.C The compiler will take a minute to rename the file M56800_main.c to leds.c. 8. On the FOLDER Click on TARGETS tab and select the flash pxROM w/int xRAM 9. Click on Project and scrolling down to selects Make to compile the leds.c program. From the same menu, scrolling down to selectDebug. Make sure the DB25 male of the JTAG cable is plug in the PC parallel port and the other end, IDC connector plugs on J2 of the IsoPod (or J7 of the NMIN-0803-H3) also make sure the red labeled wire is connected to Pin 1 on board then apply the power to the board. 10. Now click on the Green arrow or RUN button to execute the program. You will see the LEDS are chasing back and forth. 11. Turn off the power, unplug the JTAG cable and power up again, the leds program loaded in the flash will run as standalone system.