|
|||||||||||
| 技術(shù)交流 | 電路欣賞 | 工控天地 | 數(shù)字廣電 | 通信技術(shù) | 電源技術(shù) | 測(cè)控之家 | EMC技術(shù) | ARM技術(shù) | EDA技術(shù) | PCB技術(shù) | 嵌入式系統(tǒng) 驅(qū)動(dòng)編程 | 集成電路 | 器件替換 | 模擬技術(shù) | 新手園地 | 單 片 機(jī) | DSP技術(shù) | MCU技術(shù) | IC 設(shè)計(jì) | IC 產(chǎn)業(yè) | CAN-bus/DeviceNe |
老大看過來,MPLAB700 SIM投訴 |
| 作者:伊萊克斯 欄目:單片機(jī) |
list p=16F74 ; list directive to define processor #include <p16F74.inc> ; processor specific variable definitions __CONFIG _CP_OFF & _WDT_ON & _BODEN_ON & _PWRTE_ON & _RC_OSC ;***** VARIABLE DEFINITIONS w_temp EQU 0x20 ; variable used for context saving status_temp EQU 0x21 ; variable used for context saving ;********************************************************************** ORG 0x000 ; processor reset vector clrf PCLATH ; ensure page bits are claared goto main ; go to beginning of program ORG 0x004 ; interrupt vector location movwf w_temp ; save off current W register contents movf STATUS,w ; move status register into W register bcf STATUS,RP0 ; ensure file register bank set to 0 movwf status_temp ; save off contents of STATUS register ; isr code can go here or be located as a call subroutine elsewhere bcf STATUS,RP0 ; ensure file register bank set to 0 movf status_temp,w ; retrieve copy of STATUS register movwf STATUS ; restore pre-isr STATUS register contents swapf w_temp,f swapf w_temp,w ; restore pre-isr W register contents retfie ; return from interrupt main movlw 0x0A movwf PCLATH call Test_Call ;------------------------------ org 0x800 ;這里改改900,A00,B00看看,各有不同; Test_Call: nop return ;------------------------------ org 0xA00 Error_Call nop return ;------------------------------ END ; directive 'end of program' 先見ASM程序,模板文件修改而成,很簡(jiǎn)單的小程序。 看看PCLATH為0X0A時(shí) PC 的跳轉(zhuǎn), MPLAB 7.00 軟仿真 |
| 2樓: | >>參與討論 |
| 作者: 伊萊克斯 于 2005/1/5 17:29:00 發(fā)布:
果然,回到MPLAB 660就好的。 先說點(diǎn),免得大家看得迷迷糊糊。 PIC16F74, CALL/GOTO指令中,跳轉(zhuǎn)地址由PCLATH 4/3兩個(gè)BIT給出,2、1、0 BIT無用。 以上程序中,0X0A = 0B00001010, 就是說CALL指令中只有BIT3的1有用。 但是MPLAB 700軟仿真中,把PCLATH2-0位也放在CALL指令中跳轉(zhuǎn)了(DISASMEBLE LIST中倒是正確的,就是軟仿真不對(duì),而且TEST_CALL的位置不同,有的時(shí)候竟然也能對(duì),有的時(shí)候竟然跳不了)。 MPLAB700兩臺(tái)機(jī)器上都是這樣。 偶的機(jī)器從700回到600,程序沒有任何更改,就OK了。 有興趣大家可以試一試,當(dāng)然MARTIN是一定得看看的,嘻嘻。 |
|
| 3樓: | >>參與討論 |
| 作者: martin 于 2005/1/5 20:47:00 發(fā)布:
我之前也遇到了同樣的問題,是BUG,會(huì)在后面版本修復(fù) |
|
| 4樓: | >>參與討論 |
| 作者: 伊萊克斯 于 2005/1/6 8:46:00 發(fā)布:
前兩天還和人爭(zhēng)論MPLAB是不是初哥寫的 5555,剛說完就自己拍了自己一把掌。估計(jì)寫MPLAB的SIM那部分是PIC初哥寫的,55,好沒面子阿。 |
|
|
|
| 免費(fèi)注冊(cè)為維庫(kù)電子開發(fā)網(wǎng)會(huì)員,參與電子工程師社區(qū)討論,點(diǎn)此進(jìn)入 |
Copyright © 1998-2006 m.58mhw.cn 浙ICP證030469號(hào) |