samOC
01-12-03, 02:13 PM
I am trying to program an IsoPod V2 with CodeWarrior from Metrowerks. I am running CodeWarrior version 5.0 with Motorola Embedded SDK 2.5 for DSP56800 on a 900MHz IBM laptop running Windows 2000. The IsoPod V2 is straight out of the box running IsoMax. I am having trouble getting the hardware to be recognized. Here are the steps I am taking.
1. Create a new project based on Dsp56800 EABI Stationery
2. Select project stationery: M56805
3. I am using the following code (taken from the post http://www.newmicros.com/discussion/showthread.php?threadid=271)
#include <stdio.h>
#include <stdlib.h>
/*------------------------------------------------------*
Program Name: leds.c
Application: Chasing leds.
Target Board: IsoPod.
*------------------------------------------------------*/
/* 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.
/* ---- IsoPod V1 ---- */
/*
#define RED_LED_ON *pddr=*pddr|0x0010
#define RED_LED_OFF *pddr=*pddr&0x00EF
#define YEL_LED_ON *pedr=*pedr|0x0004
#define YEL_LED_OFF *pedr=*pedr&0x00FB
#define GRN_LED_ON *pedr=*pedr|0x0008
#define GRN_LED_OFF *pedr=*pedr&0x00F7
*/
/* ---- IsoPod V2 ---- */
#define RED_LED_ON *pddr=*pddr|0x0001
#define RED_LED_OFF *pddr=*pddr&0x00FE
#define YEL_LED_ON *pddr=*pddr|0x0002
#define YEL_LED_OFF *pddr=*pddr&0x00FD
#define GRN_LED_ON *pddr=*pddr|0x0004
#define GRN_LED_OFF *pddr=*pddr&0x00FB
void init_pd(void);
void init_pe(void);
void delay(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;
}
// ----- Short delay routine ------
void delay( void )
{
int i;
for( i = 0; i < 0xffff; i++ )
{
asm(nop);
asm(nop);
asm(nop);
}
}
// ----- main routine -----
void main(void)
{
init_pd();
init_pe();
while(1)
{
RED_LED_ON;
delay();
RED_LED_OFF;
YEL_LED_ON;
delay();
YEL_LED_OFF;
GRN_LED_ON;
delay();
GRN_LED_OFF;
YEL_LED_ON;
delay();
YEL_LED_OFF;
}
return;
}
/* ----- end of leds program ------ */
4. Project: Make (the code compiles correctly)
5. Connecting the JTAG cable from NM to my printer port and to the IsoPod V2
6. Debug
CodeWarrior tries to reset the hardware and I get the message “Cannot connect to Board”
What am I doing wrong? Is there some setting I need to check in CodeWarrior? Do laptop printer ports not work for JTAG? Do I have to use a separate flash loader to load the program and use JTAG just for debugging? Are there some preparatory steps for the IsoPod to enable it’s JTAG interface? Any walkthrough of how to get the IsoPod V2 working with CodeWarrior will help.
Thank you
Sam
1. Create a new project based on Dsp56800 EABI Stationery
2. Select project stationery: M56805
3. I am using the following code (taken from the post http://www.newmicros.com/discussion/showthread.php?threadid=271)
#include <stdio.h>
#include <stdlib.h>
/*------------------------------------------------------*
Program Name: leds.c
Application: Chasing leds.
Target Board: IsoPod.
*------------------------------------------------------*/
/* 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.
/* ---- IsoPod V1 ---- */
/*
#define RED_LED_ON *pddr=*pddr|0x0010
#define RED_LED_OFF *pddr=*pddr&0x00EF
#define YEL_LED_ON *pedr=*pedr|0x0004
#define YEL_LED_OFF *pedr=*pedr&0x00FB
#define GRN_LED_ON *pedr=*pedr|0x0008
#define GRN_LED_OFF *pedr=*pedr&0x00F7
*/
/* ---- IsoPod V2 ---- */
#define RED_LED_ON *pddr=*pddr|0x0001
#define RED_LED_OFF *pddr=*pddr&0x00FE
#define YEL_LED_ON *pddr=*pddr|0x0002
#define YEL_LED_OFF *pddr=*pddr&0x00FD
#define GRN_LED_ON *pddr=*pddr|0x0004
#define GRN_LED_OFF *pddr=*pddr&0x00FB
void init_pd(void);
void init_pe(void);
void delay(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;
}
// ----- Short delay routine ------
void delay( void )
{
int i;
for( i = 0; i < 0xffff; i++ )
{
asm(nop);
asm(nop);
asm(nop);
}
}
// ----- main routine -----
void main(void)
{
init_pd();
init_pe();
while(1)
{
RED_LED_ON;
delay();
RED_LED_OFF;
YEL_LED_ON;
delay();
YEL_LED_OFF;
GRN_LED_ON;
delay();
GRN_LED_OFF;
YEL_LED_ON;
delay();
YEL_LED_OFF;
}
return;
}
/* ----- end of leds program ------ */
4. Project: Make (the code compiles correctly)
5. Connecting the JTAG cable from NM to my printer port and to the IsoPod V2
6. Debug
CodeWarrior tries to reset the hardware and I get the message “Cannot connect to Board”
What am I doing wrong? Is there some setting I need to check in CodeWarrior? Do laptop printer ports not work for JTAG? Do I have to use a separate flash loader to load the program and use JTAG just for debugging? Are there some preparatory steps for the IsoPod to enable it’s JTAG interface? Any walkthrough of how to get the IsoPod V2 working with CodeWarrior will help.
Thank you
Sam