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

論壇索引


Board index » All Posts




16F873與16F873A的差異
新會員
新會員


我的MPLAB 的development mode只有16F873,complie之後的hex可以在16F873A上面動嗎??
有A沒A的差別在哪裡??
請各位高手指教, 謝謝!!!

發表於: 2005/7/13 18:33
頂部


Re: 延時程式 delay loop
資深會員
資深會員


我的想法是類似第二種那樣
程式中檢查按鍵及決定輸出頻率
用timer中斷來控制輸出頻率

主程式檢查完按鍵後設定頻率計數器數值
timer中斷去根據那數值計數而產生你要的頻率

發表於: 2005/7/12 8:52
頂部


Re: 延時程式 delay loop
資深會員
資深會員


樓上的
你還是說國語好了...

其他字打錯就算了
人名打錯可是很不禮貌
選一下字有那麼困難嗎?

發表於: 2005/7/12 8:42
頂部


PIC18F本身不可以构成CAN bus 通信, 一般还要加MCP2515, 还有其他Solution
新會員
新會員


PIC18F本身不可以构成CAN bus 通信, 一般还要加MCP2515, 还有其他Solution.

發表於: 2005/7/12 5:08
頂部


Re: Debug mode and Programmer mode output 結果不一樣
新會員
新會員


I found the problem already. It turns out the GND is not clean enough.

After I put it the GND to truly ground, it solves the problem in no time.

Thanks.

Jack

發表於: 2005/7/12 2:43
頂部


Re: Debug mode and Programmer mode output 結果不一樣
新會員
新會員


以下是我的code, 我用的晶片是PIC18F452, 基本上如果把 code 分別用debug 和 programmer mode 在MPLAB 7.10 上 run 一下, 然後量一下 RC2 (PortC Pin 腳 2) 在這兩個 modes 下的PWM輸出,我就可以看到波形的不一樣。

我是用PWM 通過 LPF 的訊號去控制一顆 npn的基極電流, 電流沒有過載的問題,謝謝。



#include <pic18.h>

__CONFIG(1,HSPLL&OSCSDIS);
__CONFIG(2,BORDIS&PWRTEN&WDTDIS);
__CONFIG(3,CCP2RC1);
__CONFIG(4,DEBUGEN&LVPDIS);

#define UPDATE_H 254
#define UPDATE_L 12

interrupt void ISR( ){
TMR1IF=0; // clear interrupt
TMR1H=UPDATE_H;
TMR1L=UPDATE_L; // timeout after 500 Tcyc
GODONE=1; // start ADC
}
void main( ){


//Timer 1 Initialization -- See Above
TMR1H=UPDATE_H;
TMR1L=UPDATE_L; // timeout after 500 Tcyc
TMR1IE=1; // enable Timer 1 interrutps, otherwise when rollover, it can not update CCP1L value.
//Timer 2 Initialization
PR2=0b11111111; // max count for 0.82 millisecond period. This register set up the PWM period.
T2CON=0b00000100; // Postscale 1:1, Timer 2 on, Prescale 1:1
// Prescaler 1:1 for Fpwm = 19.53 KHz
// Prescaler 1:4 for Fpwm = 4.88 KHz
// Prescaler 1:16 for Fpwm = 1.2 KHz
TMR2IE=0; // disable Timer 2 interrupts
//CCP Initialization
CCP1CON=0b00001100; // Duty cycle low bits 00, PWM mode
CCPR1L=0; // Duty cycle 0%
TRISD=0x00;
TRISC2=0; // PWM out as output
CCP1IE=0; // Disable CCP1 interrupts

ADCON1=0b00101110;

ADCON0=0b10000001;

ADIE=0; // disable interrupt from ADC
//Enable Interrupts and turn on interrupt source
PEIE=1;
GIE=1;
TMR1ON=1; //Turn on 100us spaced interrupts
endless:

while(GODONE); // wait for conversion to be done
PORTD=ADRESH; // the variable is case-sensitive. Xk1 is not equal to xk1.
CCPR1L=ADRESH;
goto endless;
}



發表於: 2005/7/12 0:49
頂部


请教各位先进: 哪里有PIC18F CAN BUS "C" 源码的例子?
新會員
新會員


请教各位先进: 哪里有PIC18F CAN BUS "C" 源码的例子? 谢了.

發表於: 2005/7/12 0:49
頂部


Re: 延時程式 delay loop
新會員
新會員


請參考爐春林 那本書第2章
那個說的很仔細 書有交指令週期怎麼算等等 自己一定看的˙懂
城市因該都適用大回圈保小回圈來拖時間
DEBUG機本上就是射斷點+STOP WATCH WINDOW 這樣子吧
我也正在學醫起加油吧 ^_^

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


訪客
Re: 延時程式 delay loop
訪客-訪客
有冇人可以給些建議給我 ....

頂部


請問關於LKR檔裡面的gprX
高級會員
高級會員


原本灌完C18 18F6520的LKR檔裡面有gpr0~7
我因為程式需要把2~6改成我要的名字
因為程式有時候在run了4~5天會掛掉
一直找不到原因~~
像gpr7是放stack的東西~gpr1是放共用變數的地方
不知道其他是否有什麼特別的東西,導致我的程式會在4~5天就當掉,希望知道的大大可以幫忙解決
謝謝~~辛苦了
對了~還有用c定義的區域變數會放在stack裡面對吧
用debugger模式看是這樣
還是我的觀念錯了咧


發表於: 2005/7/11 17:45
頂部



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

教育訓練中心

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