Re: 請教
|
||||
---|---|---|---|---|
版主
|
在PIC18Fxxx中要設定FSR最好是用 LFSR 指令,別忘了 FSR是一對的暫存器應該算是16-bit
LSFR FSR0, 0x120 ; 將0x120的位址傳給FSR0, FSR0H=01, FSR0L=0x20
發表於: 2005/3/31 18:31
|
|||
|
Re: 請教
|
||||
---|---|---|---|---|
版主
|
發表於: 2005/3/31 18:25
|
|||
|
Re: 請教
|
||||
---|---|---|---|---|
新會員
|
我用的也是18F452, 我注意到了FSR0L/FSR0H,但是当FSR0L increase 到 OXFF 的时候,FSR0H还是0X00。 有什么办法可以让FSR0H在FSR0L到0XFF的时候自动 increase 吗?
發表於: 2005/3/30 5:47
|
|||
|
Re: 請教
|
||||
---|---|---|---|---|
初級會員
|
非常感謝個位提供的幫助,這個問題我已經解決了,原來我忽視了FSR0L/FSR0H ,我以為可以直接將其作為一個存儲器使用。
發表於: 2004/9/7 10:02
|
|||
|
Re: 請教
|
||||
---|---|---|---|---|
初級會員
|
我使用的是PIC18F452,在這裡我的POINTER是一個變量參數,其值的變化由外界條件來控制,我將其送入FSR0,能否這樣實現嗎?
發表於: 2004/9/6 20:04
|
|||
|
Re: 請教
|
||||
---|---|---|---|---|
版主
|
等一下!!!!!!
你的程式不太像PIC16Fxxx系列的語法,但也不像PIC18F,請問你是用哪一顆PIC? 請問你的POINTER是指到哪裡的位址? 沒有 FSR0 register, 18F 叫 FSR0L/FSR0H ; 16F 稱之為 FSR
發表於: 2004/9/6 18:21
|
|||
|
Re: 請教
|
||||
---|---|---|---|---|
版主
|
例: 清除 RAM 0x30 ~0x3F, 使用間接索引定址方式
movlw 0x30 ; Set the RAM starting point
索引定址的指標是設定在 FSR 暫存器,但操作時卻是要對 INDF 暫存器,記住INDF暫存器實際是不存在的,它像是一個窗口只是讓我們存取 RAM
發表於: 2004/9/6 8:58
|
|||
|
Re: 請教
|
||||
---|---|---|---|---|
新會員
|
利用FSR及INDF來間接存取
例如要讀取REG1(假設放在0X30位置) MOVLW REG1,W ;或者 MOVLW 0X30,W MOVWF FSR MOVF INDF,W ;W = REG1 需要注意的是FSR只有8BIT,如果你的存取範圍超過256個BYTE 時,則需要切換IRP位元來更換BANK.
發表於: 2004/9/5 22:53
|
|||
|
請教
|
||||
---|---|---|---|---|
初級會員
|
請問怎麼讀取 file register裡面之值,譬如我現在有一條數據放在0x30到0x3f之存取單元,現在有一變量pointer指向該存取單元之某一個位置,應該怎樣讀取該變量所指向位置之值。
請各位給於幫助。謝謝!!!!!!!!!!!!
發表於: 2004/9/3 19:15
|
|||
|