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

論壇索引


Board index » All Posts




Re: 程式問題出在哪理???真的不了解.............
版主
版主


btfss這個指令的第二個參數,只能接長度為3個bit的常數,不能接變數。

所以,實際上,您的指令:

btfss Number, Count

其中的Count,會被譯成Count這個變數的位址,且只抓最低位的3個bit:它是一個定值。假設說它的值是5好了,那麼,您的指令每次都會檢查Number這個變數的bit 5。如果Number 的bit 5皆為0,當然每次都會跳到Out_0囉!

發表於: 2005/7/11 14:23
頂部


程式問題出在哪理???真的不了解.............
中級會員
中級會員


請問版上個位高手~~~
假設有一程式片段如下:

movlw 0xAA
movwf Number
movlw 0x07
movwf Count

Start:
btfss Number,Count
bra Out_0
bra Out_1

Continue:
decf Count
bra Start

Out_0:
bcf PORTD,0
bra Continue
Out_1:
bsf PORTD,0
bra Continue

為何每次執行均會跑到Out_0???
這是什麼樣的問題???
謝謝~~~

發表於: 2005/7/11 14:15
頂部


關於PIC16F877 ICD 連RESET都不行
新會員
新會員


我用P16F877的ICD 到PROGRAM 都有燒進去沒問體 但是每次要跑就醫職 ERROR PERFORMING REQUESTED OPERAION 然後我想說不能跑 那來個RESET吧 他就不會回去000 一直給我跑去00FF 真是快氣瘋了 我程式試用ICD說明書上那個TUT877
.ASM 有沒有辦法試看看PIC 有沒有掛掉阿 ~

發表於: 2005/7/9 21:38
頂部


請問各位大大Microchip Ic 中那一顆IC有支援RS-232通訊界面
新會員
新會員


請問各位大大Microchip Ic 中那一顆IC有支援RS-232通訊界面
三個急用

發表於: 2005/7/9 19:52
頂部


Re: 請問有關 : I2 C BUS ...
初級會員
初級會員


謝謝您的提示...

已經在美國網站下載相關資料...

發表於: 2005/7/9 19:48
頂部


Re: 請問各位高手...在台北..哪裡買得到PIC18F2455..急..
高級會員
高級會員


PIC18F4550 可以先試一下啦

發表於: 2005/7/9 11:26
IWC
IWC
JL
Rolex


PP
有點距離
越來越遠
頂部


Re: 一直出現的問題 Error[173]
高級會員
高級會員


資料夾路徑太長
換個地方吧
Example:

D:\100 answer\

發表於: 2005/7/9 11:22
IWC
IWC
JL
Rolex


PP
有點距離
越來越遠
頂部


10 F2XX , PWM ???
資深會員
資深會員


笨鴨我 ,有個地方不了 ??????
煩請大哥能解惑囉!!! 謝謝啦 !!!!
那就是這麼個指令 讓笨鴨我左思右不解

-------> btfsc STATUS,2 <-----------------
2 又表示甚麼呢 ????


全文如下---->

; File Name:PIC10F206_04.asm, by John Massa, Nov 20, 2004, Ver 1.00
; Description: Press the pushbutton and the LED will pulsate on and off.
LIST
; P10F206.INC Standard Header File, Version 1.01 Microchip Technology, Inc.
NOLIST
#include <p10F206.inc> ; processor specific variables
; Configure: Controls the reset pin, code protect, oscillator selection, WDT.
__CONFIG _MCLRE_OFF & _CP_OFF & _WDT_OFF
;-----[Defines & Variable Assignments]---------------------------------------
cblock 0x08
COUNT ; Count buffer
COUNT1 ; Count buffer #1
PWM_BUF ; PWM buffer
endc
;-----[Reset Vector]---------------------------------------------------------
ORG 0x000 ; PIC goes here (Origin of code) after reset.
movwf OSCCAL ; Load the oscillator calibration factor.
goto init ; go to initialization routine
;-----[Initialization]-------------------------------------------------------
init
;-----[OPTION]---------------------------------------------------------------
; OPTION register controls wake on GP0,1,3 change, GP0,1,3 pull-ups, TM0, etc
movlw b'10000111' ; Set pull-ups only, max pre-scaler
OPTION ;
;-----[CMCON0]---------------------------------------------------------------
; Comparator control register
movlw b'10001111' ; Turn-off the comparator, enable the I/O pins.
movwf CMCON0
;-----[TRIS]-----------------------------------------------------------------
; TRIS (reg#) tri-state I/O register. All I/O pins default to inputs at reset.
movlw b'00001000' ; Set GPIO pin 3 to an input, pins 0 - 3 to outputs.
TRIS GPIO ; Register 06h
;-----[Main routine]---------------------------------------------------------
main ; Routine pulsates an LED connected to GP0 thru 220 Ohms
btfsc GPIO,3 ; Press the pushbutton to begin
goto main ; ...Loop, if the pushbutton is not pressed

clrf COUNT ; The reg COUNT causes the subroutine to loop 255 times.
clrf COUNT1 ; The reg COUNT1 sets the PWM value
clrf PWM_BUF ; The reg PWM_BUF holds the PWM ratio of 'on' to 'off'
bcf GPIO,0 ; Start with the LED turned off
main1
movf COUNT1,W ; Transfer the value in reg COUNT1 to reg PWM_BUF
movwf PWM_BUF
call pwm
incfsz COUNT1,F ; Has COUNT1 counted from 0 to 255?
goto main1 ; ...No, loop again
main2
decf COUNT1,F ; ...Yes, and now COUNT1 holds the decrementing PWM value
main3
movf COUNT1,W ; Transfer the value in reg COUNT1 to reg PWM_BUF
movwf PWM_BUF
call pwm
decfsz COUNT1,F ; Has COUNT1 counted from 255 to 0?
goto main3 ; ...No, loop again
goto main ; ...Yes, start over.
;-----[Subroutines]----------------------------------------------------------
pwm ; This subroutine performs pulse width modulation.
movlw 0xFF ; Move the literal count of 255 to reg 'W'
movwf COUNT ; ...then store it in the register 'COUNT'
pwm1
movf PWM_BUF,F ; Test if the register PWM_BUF is zero
btfsc STATUS,2 ; ...Is PWM_BUF = 0?
goto led_off ; ...No, not yet, skip this instruction for now.
led_on
bsf GPIO,0 ; ...Yes, set GPIO pin-1 high, turn-on the LED
decf PWM_BUF,F ; Decrement the register PWM_BUF
goto exit
led_off
bcf GPIO,0 ; Set GPIO pin-1 low, turn-off the LED
nop
goto exit ;
exit
decfsz COUNT,F ; Has this sobroutine looped 255 times?
goto pwm1 ; ...No, keep looping
retlw 0 ; ...yes, return to the calling program

END ; Directive to end the program

發表於: 2005/7/9 1:09
頂部


Re: 10F2xx, wake on pin change????
資深會員
資深會員


3Q ,,, lar !
笨鴨我 查看 I/O port and wake up from sleep 的細節是有提到 Right before entering SLEEP,read the input pins.

那就是去睡覺前還要做 一件事....

-----> MOVF GPIO,W <------

對吧 ??? 哈...哈... 了解......

發表於: 2005/7/9 0:50
頂部


Re: 關於asm與C混和使用的問題
中級會員
中級會員


不知道在 C 裡面加入Asm 後,變數如何宣告使用?

發表於: 2005/7/9 0:43
頂部



« 1 ... 7009 7010 7011 (7012) 7013 7014 7015 ... 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... ]

教育訓練中心

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