• slider image 514
  • slider image 516
  • slider image 517
  • slider image 518
  • slider image 519
:::


Browsing this Thread:   4 Anonymous Users




« 1 (2)


Re: 請問跑馬燈設計的問題
#4
高級會員
高級會員


查看用戶資訊
把中斷點設在你的中斷程式 起始位置
如果有進入中斷,程式就會停下來
再來檢查中斷服務程式

如果沒有,就是中斷設定有問題
進入 NULL_LOOP 之後,把你設定的暫存器都叫出來看
一個一個檢查

用右鍵點程式的位置會出現對話框,中斷在這裡設定,解除
紅色的 B 沒錯

bsfI NTCON,GIEH ; 高優先中斷權,Enable
這一行你空格有問題 COMPILER有過嗎?

發表於: 2006/7/1 11:34
微電腦自動控制設計,產品製造
才疏學淺,若有錯誤敬請指正
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 請問跑馬燈設計的問題
#3
資深會員
資深會員


查看用戶資訊
ICD2設中斷..是點2下跑出一個紅色圈圈B ?

有個問題就是一直在Null_Loop 那...

沒辦法跳到中斷向量....

發表於: 2006/7/1 8:44
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 請問跑馬燈設計的問題
#2
高級會員
高級會員


查看用戶資訊
用ICD2設一下中斷跑幾下應該就知道問題了
如果沒有,用軟體模擬應該也跑的出來
自己抓會比較快,也比較有收穫

發表於: 2006/6/30 17:45
微電腦自動控制設計,產品製造
才疏學淺,若有錯誤敬請指正
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


請問跑馬燈設計的問題
#1
資深會員
資深會員


查看用戶資訊
一直都弄不出來,不知道程式那裡寫錯,麻煩幫忙看下,謝謝
;********************************************
;設計一個0.5秒讓 PORTD 的 LED 自動加一的程式
;********************************************
list p=18f4431
include <p18f4431.inc>
;
TMR1_VAL EQU .39062 ; Timer0 設定為 500ms 中斷一次

;********************************************
; RESET Vector @ 0x0000
;********************************************

org 0x0000 ;
bra Main
;
org 0x0008 ;
bra Hi_ISRs
;
;********************************************
;The Main Program start from Here !!
;********************************************

org 0x0020
Main:
call Init_IO
call Init_Timer0
;
bsf RCON,IPEN ; 中斷向量,Enable
bsf INTCON,GIEH ; 高優先中斷權,Enable
;
Null_Loop goto Null_Loop
; 迴圈,等待TMRO溢位,跳到中斷向量
;
;********************************************
;Initial the PORTD for the output port
;********************************************
Init_IO:
clrf TRISD
clrf PORTD
return
;********************************************
;Initial Timer0 as a 500ms Timer
;********************************************
Init_Timer0:
movlw B'10000101'
movwf T0CON
; 使用16-bit mode , Prescaler = 1:64
; 使用20MHZ,Timer0 On


movlw (.65536-TMR1_VAL)/.256
movwf TMR0H
movlw (.65536-TMR1_VAL)%.256
movwf TMR0L
;
bsf INTCON2,TMR0IP
; 設定 Timer0 高優先中斷向量
bcf INTCON,TMR0IF
; 清除 Timer0 溢位中斷標誌
bsf INTCON,TMR0IE
; Timer0 中斷,Enable
;
return

;********************************************
;****ISRs() : 中斷服務程式
;********************************************
Hi_ISRs

bcf INTCON,TMR0IF
; 清除 Timer0 溢位中斷標誌
;
movlw (.65536-TMR1_VAL)/.256
movwf TMR0H
movlw (.65536-TMR1_VAL)%.256
movwf TMR0L

incf PORTD,F
; PORTD = PORTD + 1;
retfie FAST
END

發表於: 2006/6/30 16:48
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部







You can view topic.
不可以 發起新主題
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.

[進階搜尋]


:::

Microchip連結

https://www.facebook.com/microchiptechnologytaiwan/
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=13
https://mu.microchip.com/page/tmu
http://elearning.microchip.com.tw/modules/tad_link/index.php?cate_sn=1
https://page.microchip.com/APAC-PrefCenters-TW.html
http://www.microchip.com/
http://www.microchip.com/treelink
http://www.microchipdirect.com/
http://www.microchip.com.cn/newcommunity/index.php?m=Video&a=index&id=103
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=2
http://www.microchip.com.tw/Data_CD/eLearning/index.html
http://www.microchip.com.tw/RTC/RTC_DVD/
https://www.microchip.com/development-tools/
https://www.youtube.com/user/MicrochipTechnology
[ more... ]

教育訓練中心

!開發工具購買
辦法說明 [業界客戶] [教育單位]
----------------------------------
!校園樣品申請
辦法說明 [教師資格] [學生資格]
----------------------------------