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

論壇索引


Board index » All Posts (mechwu)




Re: 如何用PIC來實現軟體低階濾波器!
資深會員
資深會員


1. 不是
2. 他的程式也有點小錯誤,傷腦筋,我沒注意到,抱歉啦

正確版

b = 0.9; // 若設零,則無濾波;數值越大,時間常數就越大,反應越慢,濾波效果也越好

void timer_isr() // 定時執行的中斷,時距 T
{
data = read_analog();
filtered_data = ( 1.0 - b ) * data + b* filtered_data
}

濾波效果與定時中斷的時距 T 有關喔,
時間常數 = -1/log(b)*T ,其中 log 是自然對數

你可以視需要改寫成定點數或整數運算,縮短運算時間

發表於: 2004/9/24 15:02
頂部


Re: 討論版 應該增加貼圖功能
資深會員
資深會員


貼圖,上傳 ... 還可以加很多很多功能的

參考一下這個 Microchip 代理商的站吧

http://www.goldenchip.com.cn/gdbbs/index.asp

http://www.goldenchip.com.cn

加油喔!

發表於: 2004/9/24 10:06
頂部


Re: 如何用PIC來實現軟體低階濾波器!
資深會員
資深會員



發表於: 2004/9/24 10:01
頂部


Re: 關於CCS COMPILER問題?
資深會員
資深會員


參照:

mickeys_wu 寫道:
再請問一下,stream=high_speed這個是指把BRGH設為1嗎?謝謝
不是,stream 指的是設備代號以及其通訊設定

#use rs232(baud=4800,xmit=pin_a3,rcv=pin_a4,stream=GPS)
#use rs232(baud=4800,xmit=pin_b1,rcv=pin_b2,stream=PIC_2)
#use rs232(baud=4800,xmit=pin_c6,rcv=pin_c7,stream=PC)

main()
{
fprintf(PC, "test_123"); // 傳給 PC

fprintf(PIC_2, "test_456"); // 傳給 PIC_2

c = fgetc(GPS); //接收 GPS

用 help 看看吧

發表於: 2004/9/24 9:55
頂部


Re: 關於CCS COMPILER問題?
資深會員
資深會員


有三招,
第一招,用 CCS 的函數,看你的版本夠不夠新
A new function has been added: SETUP_UART that works the same as SET_UART_SPEED.
A new feature of this function is when a FALSE (or 0) is passed it turns off the UART
and when a TRUE (or 1) is passed in it turns the UART on. Passing in a baud rate also
turns on the UART.

第二招,直接硬幹
#byte SPBRG = 0xFAF // 18F452 的鮑率 暫存器
RS232_baud_rate_code = 21; // 42 for 57600 baud rate
// 21 for 115200 @ 40 MHz
// 9 for 250000

SPBRG = RS232_baud_rate_code; // 寫入暫存器,隨你改鮑率設定

第三招,沒玩過,不太確定

#use rs232(baud=19200,xmit=pin_c6,rcv=pin_c7,stream=high_speed)

#use rs232(baud=9600,xmit=pin_c6,rcv=pin_c7,stream=low_speed)

#use rs232(baud=4800,xmit=pin_c3,rcv=pin_c4,stream=GPS)

main()
{
fprintf(high_speed, "test_123");

delay_ms(200);

fprintf(low_speed, "test_456");

發表於: 2004/9/23 22:49
頂部


Re: TCP/IP的傳輸速率太慢,有辦法可以改善嗎?
資深會員
資深會員


參照:

joyce 寫道:
... 10MBYTE的資料.


10 MB ! 有夠厲害!

TCP 的瓶頸在於要計算檢查碼,大概跑不到 100 KB/s,能夠跑到 60 kB /s 就很棒了。

AN833 的 UDP 雖然沒有計算檢查碼,但程式寫得不好,恐怕也跑不到 200 KB/s,能有 100 kB/s 就不錯啦。

你要拿這 PICDEM.net 做啥啊?真需要這麼快嗎?好奇中 ...

發表於: 2004/9/23 1:13
頂部


Re: TCP/IP的傳輸速率太慢,有辦法可以改善嗎?
資深會員
資深會員


參照:

joyce 寫道:
...但傳輸速率每秒只有27KByte...


是每秒接收 27 KB,還是發送 27KB,還是 收發共 27KB ?

每個封包的大小是多少? 這也會影響傳輸率喔。
封包越大,傳輸率越高!

發表於: 2004/9/19 11:08
頂部


Re: TCP/IP的傳輸速率太慢,有辦法可以改善嗎?
資深會員
資深會員


不可能達到 1 MByte 的,那是 8019 的瞬間極速,平均起來就差多了。

改用 UDP 吧,TCP 是不可能達到 200 kB/sec 的

TCP/IP Lean 這本書上就有寫到,每秒用 UDP 發送 2 M bit 的未壓縮的影像檔,做到平均 200 kB /sec。

TCP/IP Lean 用的不是 AN833。

發表於: 2004/9/15 21:55
頂部


Re: 請問為何無法控制PORTA,4 ?
資深會員
資深會員


參照:

Ryang 寫道:
PIC對連續的PORT動作時,中間需插入 NOP 的指令以修正 Read/Modify Write 的延遲問題。

BTG PORTA,4
NOP
BTG PORTA,3
NOP
BTG PORTB,4


18 系列的,有 LAT 暫存器,解決 RMW 問題,
改用
BTG LATA,4
就不需要加 NOP,

再說,你怎麼知道該加多少 NOP 延遲才夠?
還得查查線路上的阻抗與電容有多大才能算出該加多少 NOP 喔!

發表於: 2004/9/14 23:17
頂部


Re: MPLAB-C18 或 CCS C 是否有這個功能?
資深會員
資深會員


CCS-C:

看 Help 就有啦

#OPT

Syntax:
#OPT n

Elements:
n is the optimization level 0-9

Purpose:
The optimization level is set with this directive. The directive applies to the entire program and may appear anywhere in the file. Optimization level 5 will set the level to be the same as the PCB,PCM,PCH stand-alone compilers. The PCW default is 9 for full optimization. This may be used to set a PCW compile to look exactly like a PCM compile for example. It may also be used if an optimization error is suspected to reduce optimization

發表於: 2004/9/2 20:36
頂部



« 1 ... 12 13 14 (15) 16 »



:::

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

教育訓練中心

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