PDA

View Full Version : IsoPod Programming with CodeWarrior


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

nmitech
01-14-03, 09:27 AM
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.

Sam, I have a customer had the same problem with Win2000. Here is what he did to get it to work,

"Just want to let you know that we got CodeWarrior talking to the IsoPod on Friday. The problem turned out to be the parallel port setting in the BIOS. For whatever reason, Windows 2000 declared the port to be ECP when it was actually still in the original factory setting of PS/2."

Other comments from Pete Gray,
" if customers had installed non-codewarrior software, prior to installing codewarrior, it's possible that the non-codewarrior software still has an active driver locking up the par port. A microsoft article for NT specifically mentions a product from "Xilinx" which causes JTAG/printer-related issues, and I see a few Google group (Usenet) postings mentioning JTAG problems with "Xilinx" and 2000 too.

I know that Motorola's free JTAG flash loader *needs* the UserPort utility to be activated under XP, 2000 and NT, and it needs to be running "privileged" to work under Linux. I'd have thought that MetroWerks would
have given specific instructions (if required) for 2000, but you never know."

samOC
01-16-03, 03:20 PM
The problem appears to be the same but the solution didn't work. I tried all available parallel port settings in the BIOS (ECP and Bi-directional) with the same results. I'm not sure how to check to make sure Win2000 isn't contradicting the BIOS settings and I do not know what the UserPort utility is. Any other suggestions?

Sam

petegray
01-16-03, 05:12 PM
Sam,

here's some other things that might need checking...

- JTAG cable the right way 'round?
- Has the LPT port previously been used ? i.e., for printing (I'm thinking possible PC hardware fault)

If the above can be verified, I'd suggest an approach of isolation/elimination. There aren't many components here, so we should consider possibilities...

- attach a printer and try printing something. Make a note of the settings that 'work' and make sure they match what Codewarrior is attempting to use.
- You might also want to post the question in the Yahoo group "motoroladsp" to see if anyone else is experiencing / has experienced problems with Codewarrior and W2K. I know that there have been some very unpleasant problems with recent Codewarrior versions.
- consider downloading Small C and the UserPort utility (details on my homepage) and flash the example program. If the idea of the UserPort utility isn't appealing, you could always download to a PC running 95 or 98, or even Linux.
- If you're using a "trial" version of Codewarrior, has the trial period expired? Otherwise, have you registered the product with Metrowerks?

The results from attempting the above will help narrow down the root cause of the problem. I Hope this helps. Let me know how you get on.
Regards,
-Pete.
http://home.attbi.com/~petegray

samOC
01-16-03, 08:09 PM
My Problem has been solved. I was running CodeWarrior on an IBM thinkpad. The default LPT1 port address is 0x03BC. This is not standard. Codewarrior assumes a different address. The easy work around for this is to select LPT3 for the Target>Debugger>M56800 Target Settings. If this doesn't work, the long workaround involves re-configuring the default port setting in the CCS panel in C:\Program Files\Metrowerks\CodeWarrior\M56800 Support\ccs\bin\ccs.exe
I did not do this because changing to LPT3 worked for me.
Thank you to everyone for helping me debug.

Sam