#include <MC9S08FL16.h>
The code was written in c on codewarrior 6.3.2 ide, the compilation and program flash via USBDM wasall succeessfull
// Declare function protoypes here.
void delay(unsigned long wait);
void main(void)
{
PTCPE=255;
PTCSE=0;
PTCDS=255;
//SOPT1 = 0x52; // disable COP watchdog
PTCDD = 0b11111111; // // set PTB0-5 as output
// select external xtal
ICSC1 = 0b10011000;
ICSC2 = 0b00110110;
for(;;)
{
PTCD = 0b11111111; // pulse PTB0-5 high
delay(100);
PTCD = 0;
delay(100);
}
}
void delay(unsigned long wait)
{
while(wait!=0)
{
wait--;
}
}
Hexfile
S0350000433A5C55736572735C6F6D6172615C446F63756D656E74735C494F5445535452554E5C62696E5C50726F6A6563742E61627310
S123C0008B899EFE05F6AF019EFF05888A81A7FCC6C0854C95E701C6C0844CF732C0862030
S123C0201F898BF687E6024C9EE706E603EE018A4C20037FAF014BFB9E6B05F78A88AF047D
S123C0409E6B02DD9E6B01D932C088898BADB1974C9EE703ADAA4C9EE7044A2603510018B2
S123C060AD9E878AAD9A972005AD95F7AF019E6B04F79E6B03F320D5A7068145018094AD47
S123C0808DCCC0920000C08AC13F0000000000000000A6FFC718485FCF1849C7184A6EFFB6
S123C0A03DA698C71858A634C718596EFF3CAE648C898B8B8BCDC0CAA7043F3CA664874FEA
S123C0C0878787CDC0CAA70420E12008AF02CDC109CDC12595E605EA04EA03EA0226ED81C6
S123C0E0A7FE87898B9EE607879EE607879EE60A9EE7069EE60B9EE707E6039EE70BE60243
S123C1009EE70A9EAE9EFF0881CDC0E0956D08260E6D0726086D0626026A056A066A076A78
S123C120088A888681879EE604F79EE605E7019EE606E7029EE607E703868A88A704FC003C
S104C14000FA
S105FFFEC07BC2
S9030000FC
已解决! 转到解答。
I have downloaded the codewarrior v11.1, but the result is sane as version 6.3, can I have aworkimn sample code in C or asm with hex file for mc9s08fl16 for me to usw as reference for debugging hy own written code
Please be aware that codewarrior 6.3 is no longer supported,
I recommend you use CodeWarrior 11
when you install it you will have some samples code on the next folder
.....Freescale\CW MCU v11.1\MCU\CodeWarrior_Examples\HC_Examples\mc9s08fl16_demo
I hope this will help you
Have a good day.
I have downloaded the codewarrior v11.1, but the result is sane as version 6.3, can I have aworkimn sample code in C or asm with hex file for mc9s08fl16 for me to usw as reference for debugging hy own written code