在线时间0 小时
UID169611
注册时间2010-1-27
NXP金币0
该用户从未签到
新手上路

- 积分
- 15
- 最后登录
- 1970-1-1
|
官方提供的例程里没有喂狗部分程序,会导致SOPT=0XD5时系统引发喂狗复位。修改几句话。
const unsigned char ROM_PGM[] =
{
/* PC is pushed when calling, 2 bytes used (SP is decreased by 2)
** SP is now pointing to the next available unit
** thus '_addr' is at [SP+3]
*/
0x9E, 0xFE, 0x03, // LDHX 3,SP ; get the target address '_addr'
0xF7, // STA ,X ; store 'data' to 'addr'
0xA6, 0x20, // LDA #$20 ; load FCMD, CMD should be changed before calling
0xC7, 0x18, 0x26, // STA $1826 ; FCMD
0x45, 0x18, 0x25, // LDHX #$1825 ; address of FSTAT
0xF6, // LDA ,X ; load FSTAT to A
0xAA, 0x80, // ORA #$80 ; set FCBEF to lunch the command
0xF7, // STA ,X ; store back to FSTAT
0x9D, // NOP ; wait for 4 cycles
0x9D, // NOP
0x9D, // NOP
0x9D, // NOP
0x45, 0x18, 0x25, // LDHX #$1825 ; check FACCERR and FPVIOL
0xF6, // LDA ,X
0xA5, 0x30, // BIT #$30
0x27, 0x04, // BEQ *+6 ; branch to label_1
0xA6, 0xFF, // LDA #$FF ; return 0xFF if flag error
0x20, 0x0A, // BRA *+12 ; branch to label_2
//label_1:
0xC6, 0x18, 0x25, // LDA $1825 ; wait for command to be completed
0xA5, 0x40, // BIT #$40
0xC7, 0x18, 0x00, // STA $1800 ; reset the watchdog
0x27, 0xF6, // BEQ *-8 ; branch to label_1
//label_2:
0x81 // RTS ; return
};
|
|