PDA

View Full Version : Isopod V1 / Codewarrior


perisoft
04-01-03, 11:43 AM
I've got a V1 isopod and Codewarrior embedded. I'd like to get 'em talking, but Codewarrior's manuals obviously don't mention the specific connection and setup necessary to use JTAG w/ the isopod. Is there a FAQ out there, or can anyone point me in the right direction?

nmitech
04-01-03, 01:04 PM
Plug the DB25 male of the JTAG cable to your PC parallel port, and the other end 2x5 IDC connector plugs on J2 of the IsoPod where pin 1 on J2 is located near center of the board and the Red wire on the JTAG cable is designated for pin 1.

Here is an example and step by step instruction,

Try this simple program and follow the Codewarrior software setup procedures below to get some hands-on with the IsoPod_V1. 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
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

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.

*-------------------------*/


/* 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.



#define RED_LED 0x0010 //; Red LED
#define YEL_LED 0x0004 //; Yellow LED
#define GRN_LED 0x0008 //; Green LED

void init_pd(void);
void init_pe(void);
void delay(void);
void toggle_leds(void);


// ------ 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 )
{
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);
}
}
}

// -------- Toggling LEDs routine -----
void toggle_leds(void)
{
*pedr = 0x000; // YEL & GRN off
*pddr = RED_LED; // Red LED on
delay();

*pddr = 0x0000; // RED off
*pedr = YEL_LED; // GRN off, Yellow on
delay();

*pedr = GRN_LED; // RED & YEL off, GRN on
delay();

*pedr = YEL_LED; // RED & GRN off, YEL on
delay();
}

// ----- main routine -----

void main(void)
{

init_pd();

init_pe();

while(1)
{
toggle_leds();
}

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 --> Save 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 2x5 IDC connector plugs on J2 of the IsoPod and turn on the power of the IsoPod board.

10. Now click on the Green arrow or RUN button to execute the program. You will see the LEDS are chasing.

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.

perisoft
04-01-03, 01:39 PM
Excellent - worked a treat. Thanks!