Re: PIC新手發問....Bootload & Reset
|
||||
---|---|---|---|---|
新會員
|
感謝版主的指導...
我知道了
發表於: 2006/6/16 9:56
|
|||
|
Re: PIC新手發問....Bootload & Reset
|
||||
---|---|---|---|---|
新會員
|
我了解了..
那麼再請教一下.. 如果是使用watch dog的方式 是否能做到像MCLR pin 的功能??
發表於: 2006/6/7 17:38
|
|||
|
Re: PIC新手發問....Bootload & Reset
|
||||
---|---|---|---|---|
版主
|
PIC18F 的 RESET 指令與硬體的 MCLR pin 的功能一樣都可以做硬體的 RESET 動作,I/O 也會重新設定到開機的初始設定值。
PIC16F 就無法透過軟體方式去 Reset MCU,即使修改 PC counter 從 0x0000 的位址開始執行也會因為堆疊、I/O 沒有被reset到,所以很難去正確的去執行一個真正的 RESET 動作。 PCON的 POR是用來偵測現在的開機是冷開機或是熱開機的判斷用。
發表於: 2006/6/6 13:38
|
|||
|
Re: PIC新手發問....Bootload & Reset
|
||||
---|---|---|---|---|
新會員
|
感謝版主的回覆...
那麼請問如果要用軟體做reset 是否可以直接將PCON的 POR設為0 或是有其他的方式??
發表於: 2006/6/6 10:07
|
|||
|
Re: PIC新手發問....Bootload & Reset
|
||||
---|---|---|---|---|
版主
|
1. PIC18F 才有 RESET 指令,PIC16F 則沒有。
底下所列就是PIC18目前所支援的巨集指令: *------------------------------------------------------------------------- * Some useful macros for inline assembly stuff *-------------------------------------------------------------------------*/ #define Nop() {_asm nop _endasm} #define ClrWdt() {_asm clrwdt _endasm} #define Sleep() {_asm sleep _endasm} #define Reset() {_asm reset _endasm} #define Rlcf(f,dest,access) {_asm movlb f rlcf f,dest,access _endasm} #define Rlncf(f,dest,access) {_asm movlb f rlncf f,dest,access _endasm} #define Rrcf(f,dest,access) {_asm movlb f rrcf f,dest,access _endasm} #define Rrncf(f,dest,access) {_asm movlb f rrncf f,dest,access _endasm} #define Swapf(f,dest,access) {_asm movlb f swapf f,dest,access _endasm } 2. Bootloader 已經有很多資源,可以參考底下的網頁: http://www.etc.ugal.ro/cchiculita/software/picbootloader.htm http://www.microchip.com/stellent/idc ... &nodeId=1490&filterID=382
發表於: 2006/6/5 16:26
|
|||
|
PIC新手發問....Bootload & Reset
|
||||
---|---|---|---|---|
新會員
|
各位前輩大家好..
小弟最近接觸到PIC, 有些地方還不熟悉,因此想向前輩請教 小弟使用的是16F873A,軟體是使用MPLAB 1.Watch Dog有CLRWDT();這個巨集指令,不知是否有reset的巨集指令?? 2.小弟想寫一個Bootload,請問Bootload該怎麼寫(C語言)?? 請各位前輩不吝賜教....tks
發表於: 2006/6/2 15:04
|
|||
|