• slider image 442
  • slider image 483
  • slider image 484
  • slider image 485
  • slider image 486
  • slider image 487
:::

論壇索引


Board index » All Posts (愛神一號)




Re: 想請問中斷
#1
中級會員
中級會員


參照:

Beee 寫到:

1.
基本上如要切換 BANK 就已浪費指令時間 這在要求快速反應的中斷 就不太好了


上面已經提到了。BANK的切換是無法避免的,根本談不上浪費指令時間。相信OP就是因爲沒有處理好BANK才會發生問題的。實際的課題是要如何有效的處理和操作BANK的切換,那當然是有牽涉到如何寫代碼(哪一個先哪一個后),RAM運用的策略(放在哪一個BANK才能比較有效的處理中斷)等等...

參照:

2.
切換 BANK 時 STATUS 就已改變 存它何用 ?


那麽遇到沒有通用區的PIC時,該當如何?

參照:

3.
如不放在 通用區 RESTORE 時 可能已變成不確定資料 死的更慘


和上面一樣。

發表於: 2007/2/27 18:09
頂部


Re: 有關ZigBee的問題
#2
中級會員
中級會員


還有一點,我有Explorer16演示板。上面提到的第4項也可以配合Explorer16板子試驗的。用的是PICTail Plus接口。但是v1.0-3.8裏還沒有提供16位的支持。所以現在只能等。

能不能說說你用的是什麽板子?上面好像有提到UZ2400的RF子板。那是哪裏買的?能配合PICDEM-Z來做實驗嗎?

發表於: 2007/2/26 5:18
頂部


Re: 有關ZigBee的問題
#3
中級會員
中級會員


我用的多數是微芯提供的:

1)PICDEM-Z演示板(用CC2420的)
2)ZENA Network Analyser DM183023
3)CC2420 RF Daughter Card
4)MRF24J40 RF Daughter Card

我買的時候1和2是分開裝的。現在1和2已經變成了DM163027-4,那是用MRF24J40的。買這個包裝比分開來買比較划算。包裝裏有2套母板+2套MRF子板+ZENA硬件軟件。

3好像斷貨了,微芯似乎也不想賣了。

現在微芯宣傳的是利用MRF的4。這個子板基本上和DM163027-4裏的是一樣的。我做了一些自製的板子,配合3和4來做試驗。

發表於: 2007/2/25 17:11
頂部


Re: PIC12F675 MCLR programming ERROR
#4
中級會員
中級會員


在美國微芯網站有流傳着一則KB:

Why does MPLAB warn me about using internal MCLR and internal RC oscillator mode when I'm using an MPLAB ICD2 programmer?


Resolution: It is important to be very careful when using internal MCLR and internal RC oscillator mode on a device when using the ICD2. Since the ICD2 can not control the MCLR and it can not control the Vdd supply voltage of the part, a device programmed for internal MCLR and internal oscillator mode will often start running before the programming sequence begins. This can cause programming to fail, or in other cases, cause all manner of unusual behavior to be observed.

For example, one customer was using a PIC16F688 with an ICD2 and programmed the configuration bits to set the part to internal MCLR and internal oscillator mode. They also had code configured to write to the EEPROM memory on startup. The result was the EEPROM was written before the ICD2 could verify the EEPROM, and the device would appear to fail verify for what seemed like a mysterious reason. Disabling either or both internal options (setting them for external mode) cleared up the issue.

In other cases, a customer may find that the device can only be programmed with their code one time, and after that, the device will not respond to further programming attempts. Most likely they read an unusual target ID such as 0x0 or 0x3FF from the ICD2 unit. This is because when their code ran, it set the pins used for programming (usually GP0 and GP1 or RA0 and RA1) to outputs, and this conflicted with the programming sequence. The conflict occurs since the part start up faster than the programming sequence from the ICD2. The end result is the part can not be reprogrammed unless a different programmer, such as a PM3 is used. The other programmer is needed, since it can control Vdd directly and prevent the part from starting up before its programmed. As mentioned earlier, the ICD2 does not control Vdd directly, and even if it is programmed to supply Vdd, it does not control the time the Vdd appears to the device.

A good workaround to this is to either not use both internal MCLR and internal RC oscillator mode. However, if that is not a reasonable solution, than another good option is to simply program a small delay into the code that the PIC will run on startup. The delay will prevent the I/O lines from becoming outputs too soon after power-up and that will allow the ICD2 to still be able to reprogram the device. Finally, if that is also not an option for your design, use a production programmer such as a PM3. You can find out more about the PM3 at:
http://www.microchip.com/PM3

發表於: 2007/2/24 1:49
頂部


Re: 想請問中斷
#5
中級會員
中級會員


參照:

weyo 寫到:
INTSUB1:
    
MOVWF    W_TEMP
    SWAPF    STATUS
,W    
    MOVWF    STATUS_TEMP

    DECFSZ    COUNT0
,F
                
GOTO    ISR_END1
    COMF    PORTC
,0
    MOVLW    .5
    MOVWF    COUNT0
ISR_END1
:
    
BCF    PIR1,TMR1IF
    CLRF    TMR1H
    
...
                
RETFIE



就如OP的帖子里,DECFSZ COUNT0,F 那行就有問題了。就算COUNT是在通用存儲區里,那也是暫時逃過劫數而已。再看下去,PORTC那行就有50-50的機會發生災難。再看PIR1, 災難指數已經提升到了75%了...

再說一遍:怎么會麻煩?是遲和早的問題而已。

發表於: 2007/2/16 3:11
頂部


Re: 想請問中斷
#6
中級會員
中級會員


參照:

Beee 寫到:

如放在其他位址 , 則要注意 BANK 的切換 ( 太麻煩了! )


怎么會麻煩?BANK的切換基本上是避免不了的!

發表於: 2007/2/16 2:53
頂部


Re: 請問一下有關於Software UART
#7
中級會員
中級會員


參照:

ilovetoc 寫到:
如果只改上面腳位的話..compiler會有以下錯誤
MPLINK 3.40, Linker
Copyright (c) 2003 Microchip Technology Inc.
Error - could not find definition of symbol 'DelayRXHalfBitUART' in file 'OPENUART.O'.
Errors : 1



我後來去別的地方看,他是說還要定義下列function,我把下列function寫在sw_uart.h裡面...


Function哪有寫在頭文件里的?

這是我以前做過的,僅供參考。你還需要依照你的FOSC改一改。

;*************************************************************************************
Delay.asm

Delay routines for C18 software UART
;
Fosc 48MHz
Baudrate 115,200 bps
;
;*************************************************************************************
 
udata_acs
DelayCount res 1

 code
DelayTXBitUART
;*************************************************************************************
Delay for (((((2*FOSC) / (4*BAUDRATE)) + 1) / 2) - 12)
; = 
92.66
; = 93 (nearest integer)
;
settle for 91 (after excluding call instruction cycle count)
; = 
DelayRXBitUART
;*************************************************************************************
    global 
DelayTXBitUART    89 91 Tcy
    bra DelayRXBitUART


DelayRXHalfBitUART
;*************************************************************************************
Delay for (((((2*FOSC) / (8*BAUDRATE)) + 1) / 2) - 9)
; = 
43.58
; = 44 (nearest integer)
;
settle for 42 (after excluding call instruction cycle count)
;*************************************************************************************
    global 
DelayRXHalfBitUART
    movlw .12
    movwf DelayCount
    bra loop                
;   (1+1+2)
                            ; + (
1+2)*12
                            
; + (2)
                            ;   --------
                            ;   
42 Tcy
                            
;   ========


DelayRXBitUART
;*************************************************************************************
Delay for (((((2*FOSC) / (4*BAUDRATE)) + 1) / 2) - 14)
; = 
90.66
; = 91 (nearest integer)
;
settle for 89 (after excluding call instruction cycle count)
;*************************************************************************************
    global 
DelayRXBitUART
    movlw .28
    movwf DelayCount
    nop
loop
    decfsz DelayCount
    bra loop
    
    
return        ; (1+1+1) + (1+2)*28 + (2)= 89 Tcy
    
    end

發表於: 2007/2/16 2:20
頂部


Re: 請問PIC12F629 的 Internal Oscillator需要校正嗎?
#8
中級會員
中級會員


參照:

tonys 寫到:

由於每一顆 pic 的頻率校正數值(Calibration Value)不盡相同,因此,如果要保存頻率校正數值,必須先讀回該數值,再與程式一併寫回。 因此,如果該 PIC 無法讀回正確的頻率校正數值(例如:已經開啟了 Code Protection),則重新寫入程式的結果自然不能有正確的內部振盪頻率。

如果以上研判沒錯的話,那就不是 ICD2 的問題...


第一,調試期間,從來不曾開啟過Code Protection,但問題還是發生了。所以無法接受上面的解析。

第二,即使開啟了Code Protection,所有的PM讀取時都是“0",除了地址0x03FF。有關的細節可以參閱:

http://ww1.microchip.com/downloads/en/DeviceDoc/41191D.pdf


參照:

tonys 寫到:

... 一些新的 8M INTOSC 的 PIC (印象中好像不是 Low pin count 系列),具有不同的設計,出廠時已作好硬體校正,不需要再用以上方式校正,則即使重寫已被 Code Protection 的晶片,也就不會有此問題。


既然是不同的設計,那當然沒有類似OP提到的問題。

發表於: 2007/2/14 19:22
頂部


Re: 請問PIC12F629 的 Internal Oscillator需要校正嗎?
#9
中級會員
中級會員


參照:

chynsyan 寫到:

...如果ICD2 真的有這個 bug ,會把校正值弄丟,那該如何生產才好呢?...



Microchip有聲明在先:ICD2只供開發用途,不是生產級編程器!

發表於: 2007/2/6 17:48
頂部


Re: 請問PIC12F629 的 Internal Oscillator需要校正嗎?
#10
中級會員
中級會員


參照:

chynsyan 寫到:
感謝回覆...

您所提到的校正,是將 call 0x3FF 的 return value寫入 OSCAL 之中,這對於 clock 的精準度的確很有幫助的...

但可否再請教一下,如果經過上述調整之後,CLOCK 仍然不準,就必須要進行這個 RETURN VALUE 的調整..也就是 MPLAB 裡頭的 Allow ICD2 to program calibration memory.

我現在面臨的是,要針對每一個 IC 去做 Allow ICD2 to program calibration memory. ,而且寫入的值每顆還不相同,這樣會很麻煩。

不曉得 12F675 有類似的情形嗎?



用ICD2調試時,切記要先把OSCCAL的廠方校正值先讀出來,然后紀錄下來。我用過的經驗告訴我:雖然Microchip說他們的工具都會保留校正值,但是很多時候ICD2把這個校正值弄丟了!

發表於: 2007/2/5 23:58
頂部



(1) 2 3 4 ... 6 »



:::

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... ]

教育訓練中心

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