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

論壇索引


Board index » All Posts (jacc007tw)




Re: flash memory and eeprom memory~~~??
#1
新會員
新會員


感恩~

發表於: 2005/7/23 2:40
頂部


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


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 結果不一樣
#3
新會員
新會員


以下是我的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
頂部


flash memory and eeprom memory~~~??
#4
新會員
新會員


現在不是都用 flash 當 program memory 了嗎? 那為何還須要 eeprom memory 的部份呢? 請指教,謝謝。

發表於: 2005/7/8 2:50
頂部


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


CCP1CON=0b00001100; // Duty cycle low bits 00, PWM mode
TRISC2=0; // PWM out as output
ADCON1=0b00101110;
ADCON0=0b10000001;

以上是我的設定,只有在AN0 腳的地方是 analog input, 其它都是 digital mode. 但是我還是看不出問題在哪?

請指教,謝謝。

發表於: 2005/7/8 2:46
頂部


Re: 用Capture 量測PWM的High的時間的問題
#6
新會員
新會員


你的輸入波形已經是方波了嗎?

不然你必須做一下訊號的處理,不然 Capture mode 會抓不到訊號的。

Jack

發表於: 2005/7/3 3:54
頂部


Debug mode and Programmer mode output 結果不一樣
#7
新會員
新會員


我現在用一顆 PIC18F452 PICmicro 做 PWM 控制,不知為何在debug mode 下看到的 PWM output 是正確的 (漂亮的方波),但是等我用 programmer mode program chip 後,output 卻是不正確的 ( 怪怪的波形) 。

而且在接有 ICD-2 的情況下,Vdd 腳輸出的電壓才夠。如果沒接 ICD-2, Vdd 就不夠力去驅動馬達。

請指教~ 謝謝

Jack

發表於: 2005/7/3 3:48
頂部


Re: 菜鸟求助:
#8
新會員
新會員


看一下 MPLAB 的 Help 檔吧。

如果你是打算用 C 寫 program, 至少你還須要一個 compiler, 不然就只能寫 組語。

如果你不只想跑 simulation, 那你可能還須要 ICD-2 和一塊 PIC 的實驗板。

Jack

發表於: 2005/6/24 2:06
頂部


Re: Program Memory 不是 flash type 記憶體嗎?
#9
新會員
新會員


Thanks a lot. I found the problem myself, too. Actually, when I turn off the LAB-X1 board, just the program stop running. But it is definitely true that the program still resides in the PIC18F452.

And your opinion is valuable to me, too. Now my motor is running like hell and next step would be discover its RPM through the CAPTURE mode.

Jack

發表於: 2005/6/18 4:20
頂部


Program Memory 不是 flash type 記憶體嗎?
#10
新會員
新會員


各位先進:

Program Memory 不是 flash type 記憶體嗎? 那為何我program 晶片後? 關掉電源後再開啟,程式似乎不存在了呢?

Thanks in advance.

發表於: 2005/6/14 6:24
頂部



(1) 2 »



:::

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

教育訓練中心

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