PDA

View Full Version : Programming HC912b32 FLASH using Metrowerks Codewarrior


heybert676
04-16-04, 09:32 AM
I'm working on a bot that will be traversing a maze and picking up balls. Currently, I'm using a P&E BDM interface cable connected to my laptop to program the controller using Metrowerks' Codewarrior (the eval edition they give out). The bot reacts like I want it to when it is hooked up, however, when I remove it, the bot doesn't work.

I can run a program out of RAM using the BDM, but I can't program the FLASH so that the program can run on the controller without the BDM. The listing file of my program run thorugh Codewarrior, shows the starting address as $8000, even though its running RAM. The minute i remove the BDM, the program no longer runs (which is how i know it's running out of RAM).

I've tried including org statements at the end, setting the address $FFFE to point back to the start of the main code.

What I'm trying to is to load it into FLASH and have the reset vector point back to the start of code, so that the controller will run without the BDM hooked up.


Does anyone have experience programming this controller using codewarrior (or any other easily accessible IDE...free).

nmitech
04-16-04, 03:55 PM
Not sure if i have the lastest ASM file you emailed me, but one thing i saw on your program that did not look right. The global interrupt is enable but i could not find any interrupt service routine anywhere in your program.

Kristine Nguyen
04-24-04, 10:51 PM
I have the same problem with downloading the C program I wrote from Metrowerks Codewarrior software. I don't know how to download it, and what is the steps that I should follows inorder to to this. Is anyone here know how to download program into the microcontroller. Can anyone help me on this because I finished with my project but I don't know how to download this. My project is due next week. Thank you very much.:confused:

nmitech
04-26-04, 02:46 PM
Your project.prm file should look like this,

/**************************
/ - Standalone -
/ This requires BDM cable to load
/**************************

NAMES
END

SEGMENTS
RAM = READ_WRITE 0x0800 TO 0x0BFF;
FLASH = READ_ONLY 0x8000 TO 0xFFBF;
EEPROM = READ_WRITE 0x0D00 TO 0x0FFF;
END

PLACEMENT
DEFAULT_ROM, ROM_VAR, STRINGS INTO FLASH;
DEFAULT_RAM INTO RAM;
END

STACKSIZE 0x100

VECTOR 0xFFFE _Startup

/**************************************************


/**************************************************
/ or - Boot from Serial Bootloader -
/ This can be downloaded through serial w/Bootloader installed
/**************************************************

NAMES
END

SEGMENTS
RAM = READ_WRITE 0x0800 TO 0x0BFF;
FLASH = READ_ONLY 0x8000 TO 0xF7BF;
EEPROM = READ_WRITE 0x0D00 TO 0x0FFF;
END

PLACEMENT
DEFAULT_ROM, ROM_VAR, STRINGS INTO FLASH;
DEFAULT_RAM INTO RAM;
END

STACKSIZE 0x100

VECTOR 0xF7FE _Startup

/**************************************************