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

論壇索引


Board index » All Posts




Re: 18F4431 ADC初始設定的問題
版主
版主


查了一下,Microchip 並沒有 AD 的函數庫可以支援 PIC18F4431 ,這顆IC 的 ADC 比較特殊一點。你可以用最基本的設定方式直接設定 ADC 暫存器,有關範例可以參考 AN900 或用 PIC18F4431 為搜尋字就可以找出一堆組合語言的範例,PIC18F4431 目前沒有 C18 的範例。

發表於: 2005/9/30 14:05
頂部


Re: 求助 12f675晶片簡單範例
版主
版主


list      p=12f675           ; list directive to define processor
    
#include <p12f675.inc>        ; processor specific variable definitions

    
errorlevel  -302              suppress message 302 from list file

    __CONFIG   _CP_OFF 
_CPD_OFF _BODEN_OFF _MCLRE_OFF _WDT_OFF _PWRTE_ON _EXTRC_OSC_NOCLKOUT 
please see the p12f675.inc for the configuration defination

;***** 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
        
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
        movwf    status_temp       
save off contents of STATUS register


isr code can go here or be located as a call subroutine elsewhere


        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


these first 4 instructions are not required if the internal oscillator is not used
main
;        call    0x3FF             retrieve factory calibration value
;        bsf     STATUS,RP0        set file register bank to 1 
;        movwf   OSCCAL            update register with factory cal value 
;        bcf     STATUS,RP0        set file register bank to 0
;
        
banksel TRISIO        Set to Bank 1
        movlw     
b'00100000'    Sep GPIO<4:0> for output
        movwf    TRIAIO
;
        
banksel    GPIO        to Bank 0
        bcf    GPIO
,0        Clear GP0
        nop            
Wait 1 cyclr for read-modify-write issue
        bsf    GPIO
,1        Set GP1
        
;
        ;
        ;

initialize eeprom locations

        ORG    0x2100
        DE    0x00
0x010x020x03


        END                       
directive 'end of program'


發表於: 2005/9/30 13:34
頂部


Re: rs232沒反應
版主
版主


輸出 : 11腳對14腳,10腳對7腳

輸入 : 12腳對13腳,9腳對8腳

發表於: 2005/9/30 13:16
頂部


Re: 是否可使用PIC16F或是18F的dem board來玩dsPIC呢?
版主
版主


The dsPIC isn't pin to pin compatible with PICmicro, so you can't use the dsPIC in the PICDEM 2 Plus directly.

發表於: 2005/9/30 13:15
頂部


Re: microchip 與步進馬達連接方式
版主
版主



發表於: 2005/9/30 13:11
頂部


Re: pic的rs232
版主
版主


Baud Rate 或 Communication protocol 設錯了。

發表於: 2005/9/30 13:06
頂部


求助 12f675晶片簡單範例
初級會員
初級會員


@@!!我試幾次寫簡單的程式讓該晶片run
可是無法動作= =''

之前有寫過18f452的跟16f88

這次要寫12f675我不是很清楚該晶片要動作時要設定哪些暫存器

能否請熟悉的人幫我寫一下簡單的範例

那容就是
將GP0跟GP1設定成0跟1
CLICK由GP5進入

另外一個問題
我GP5已經接輸入的CLICK 那是否代表我無法在將GP5規劃為輸出腳使用呢


感謝大家~~~Orz


發表於: 2005/9/30 12:20
頂部


Re: 請問 errorlevel -302 作用為何?
版主
版主


小小的建議,如果是初學 PIC 最好不要加入這一行以避免BANK 漏了切換。

如果你嫌它太煩了也可以直接將 Build Message 關掉,在 MPLAB IDE --> Project -->project -->MPASM Assembler 對話視窗裡點選 " Categories" 為 " Output" 將 Diagnostics Level 設為 Erroe and Warnings .

發表於: 2005/9/30 12:12
頂部


Re: 請問 errorlevel -302 作用為何?
初級會員
初級會員


感謝回覆~~

可是我還是不懂
我就算將該行程式註解掉 一樣沒您說的302 Message阿~~?

另外~~就是errorlevel -302 將此302訊息消除 為什要這樣做,不是應該有訊息就讓它顯示出來以便了解程式是否有問題,不是應該這樣嗎? @@?

困惑中~~= ="



發表於: 2005/9/30 12:08
頂部


Re: 請教有關Visual Initializer這一功能?
版主
版主


主要是幫你設定 dsPIC30F 及 PIC18F 系列的周邊,透過圖示化的設定後VDI 可以產生週邊設定檔的組合語言給C呼叫,這樣就不用花很多的心思去設定週邊。

至於其使用方式只有在 MPLAB IDE 底下的 Help 有使用說明。

發表於: 2005/9/30 11:52
頂部



« 1 ... 6914 6915 6916 (6917) 6918 6919 6920 ... 7522 »



:::

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

教育訓練中心

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