Re: 詢問pic18f452 USART傳送問題
|
||||
---|---|---|---|---|
資深會員
|
你寫的 while(TXSTAbits.TRMT=0); 我寫的 while(TXSTAbits.TRMT==0); 有差嗎? 我的習慣是 putcUSART(0xA7); while(TXSTAbits.TRMT==0); putcUSART(0xA5); while(TXSTAbits.TRMT==0); putcUSART(0x5A); while(TXSTAbits.TRMT==0);
發表於: 2007/3/21 14:41
|
|||
|
Re: 請教一下,CCS與C18的問題
|
||||
---|---|---|---|---|
資深會員
|
基本上,用 CCS 編程並不需要用到 TMR1IF,因為 CCS 會幫您編中斷派遣程式,所以,你只需要編中斷處理程式,然後在主程式中啟動中斷,就完成啦。
例 #INT_TIMER1 { } void main() { .... disable_enterrupts(INT_TIMER1); .... enable_interrupts(INT_TIMER1); ... } 根本用不到TMR1IF 啊,呵呵 enjoy ! 當然啦,如果您要自己編中斷派遣程式也行,請參考下列 HELP 資訊 #INT_GLOBAL Syntax: #int_global Elements: None Purpose: This directive causes the following function to replace the compiler interrupt dispatcher. The function is normally not required and should be used with great caution. When used, the compiler does not generate start-up code or clean-up code, and does not save the registers. Examples: #int_global isr() { // Will be located at location 4 #asm bsf isr_flag retfie #endasm } Example Files: ex_glint.c Also See: #int_xxxx
發表於: 2007/3/18 11:26
|
|||
|
Re: 有誰還有留著,沒有使用的DISCOUNT COUPON
|
||||
---|---|---|---|---|
資深會員
|
哇哩,哇哩
為什麼我沒有看到這些好康的折扣 哇哩,哇哩 上星期買 Explorer-16 ,刷完卡才看到折扣 哇哩,哇哩 我以後一定會乖乖的仔細的慢慢的找折扣啦 嗚嗚 不甘心喔,多喝水,多喝水
發表於: 2006/12/27 0:33
|
|||
|
Re: 關於 CCS 製作LIBRARY
|
||||
---|---|---|---|---|
資深會員
|
1. CCS v4 才有 Linker, 才能做 Library
2. CCS v3 沒有 Linker, 不能做 Library 3. CCS v3.225 以後的版本有加密的功能, 可以滿足你的需求 例 要將 my_function.c 加密, 就編輯 my_function.c , 然後, 點擊 File -> Encrypt 就會產生 my_function.c.encrypted 這個新檔案, 然後 就把這加密後的檔案給客戶用就好啦 #include "my_function.c.encrypted" my_function.c 裡面再加上 #nolist 則在 LST 檔案裡面就連編出來的組語也都看不到啦
發表於: 2006/12/16 13:34
|
|||
|
Re: about printf and ccs-c
|
||||
---|---|---|---|---|
資深會員
|
參照:
PIC 的程式要先啟用 UART,才能使用 printf() #use rs232( baud = 115200, xmit = PIN_C6, rcv = PIN_C7 ) 然後,你必須要有一台終端機 ... 接線如下 PIC 的 UART 的 TX / RX 線 (通常是 RC6 與 RC7) 接到 RS232 準位轉換器 (通常用 MAX232 這顆 IC) ,將 PIC 的 0V / 5V 的 TTL/CMOS 信號轉換為 +/- 9V 的 RS232 信號,然後,將 MAX232 的線接到 PC 的 COM port (或 USB / RS232 轉換器),然後, 啟動 PC 的終端機程式 (通常是 Hyperterminal, hypertrm.exe,或是 CCS 提供的 C:\Program Files\PICC\siow.exe) 然後,設定好 com port, baud rate 等參數,然後,就可以在 PC 的螢幕上看到輸出啦 先看看你的實驗板上有沒有 MAX232 這顆 IC 吧
發表於: 2006/10/30 12:37
|
|||
|
Re: about printf and ccs-c
|
||||
---|---|---|---|---|
資深會員
|
CCS 最令人感動的就是這些 功能強大,高彈性的 fprintf, sprintf 啦,
printf (), printf (cstring, values...) printf (fname, cstring, values...) fprintf (stream, cstring, values...) sprintf(string, cstring, values...); PIC12, PIC16, PIC18 都可以用,呵呵 還可以自行創造些 printf( lcd_putc, ... ) 之類的好東西,只要有 lcd_putc ( char c ) 就可以直接送去 LCD,把函數 lcd_putc 當成檔案來用!呵呵 ----------------- Syntax: sprintf(string, cstring, values...); Syntax: printf (string) or printf (cstring, values...) or printf (fname, cstring, values...) fprintf (stream, cstring, values...) Syntax: sprintf(string, cstring, values...); Parameters: string is an array of characters. cstring is a constant string or an array of characters null terminated. Values are a list of variables separated by commas.
發表於: 2006/10/27 2:13
|
|||
|
Re: CCS problem
|
||||
---|---|---|---|---|
資深會員
|
參照:
1. 請先說明你用的 CPU, 是 16F 的嗎? 若是 16F, 則 MOVWF 05 應寫入 0x85 (PORTA) 而非 0x05 0007: BSF 03.5 <= 注意這行 0008: BSF 1F.0 0009: BSF 1F.1 000A: BSF 1F.2 000B: BCF 1F.3 .................... set_tris_a(0x38); 000C: MOVLW 38 000D: MOVWF 05 設定 option => file format => symbolic 則 LST 檔出現 0007: BSF STATUS.5 <= 注意這行 0008: BSF ADCON1.0 0009: BSF ADCON1.1 000A: BSF ADCON1.2 000B: BCF ADCON1.3 .................... set_tris_a(0x38); 000C: MOVLW 38 000D: MOVWF TRISA 2. CCS 4.012 尚未穩定,若你是要開發產品,則建議退回 3.249 版,若僅是學習或玩耍,也建議與 3.249 比較一下 詳見 CCS 討論區 http://www.ccsinfo.com/forum http://www.ccsinfo.com/forum/viewtopi ... c7d483d4af1a6935f6eecdbe3
發表於: 2006/10/25 12:33
|
|||
|
Re: Filter
|
||||
---|---|---|---|---|
資深會員
|
參照:
這 s 是 Laplace operator 喔,也稱為微分算子,s = d/dt,在程式裡 s 和 a 是不能加的啦! 要轉成程式嘛,呼呼,先看你的取樣頻率,然後 ... 說來話長 ... 過完中秋再說吧 中秋愉快
發表於: 2006/10/6 0:00
|
|||
|
Re: 10F202用CCS寫software UART
|
||||
---|---|---|---|---|
資深會員
|
GPS 的 UART 是 TTL 準位還是 RS232 準位?
是 5V TTL 還是 3.3 V TTL ? 有加 MAX232 做準位轉換嗎? CCS 的 #use rs232 用於 software UART 時可以選用 INVERT INVERT Invert the polarity of the serial pins (normally not needed when level converter, such as the MAX232). May not be used with the internal UART. 先確認準位吧
發表於: 2006/10/5 23:51
|
|||
|