• slider image 442
  • slider image 477
  • slider image 479
  • slider image 480
  • slider image 481
  • slider image 482
:::


Browsing this Thread:   1 Anonymous Users






Re: About A/D sample frequency and resolution
#10
版主
版主


查看用戶資訊
有關AD的範例可以在右邊的下載區找到,但是資料是繁體中文的。
可以參考 W100 , W400 , Hi-Tech PICC , W401 及 W210 的教材。
http://www.microchip.com.tw/material.htm

發表於: 2005/3/11 9:55
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: About A/D sample frequency and resolution
#9
新會員
新會員


查看用戶資訊

前辈所言甚是,我也感觉电路设计还是得多动手才行。
这次主要是时间太紧张,剩下的时间不多拉。太着急拉。
所以还请各位前辈多多包涵,对我提出的种种幼稚问题多包涵。
有关程序设计还望前辈多多帮助,毕竟你们经验丰富,如果有相似的程序,也请赐教。我也会夺下苦功的。


关于单片机内置A/D 再接外部DAC 输出 不知有没有比较现成的例子 (hi-tech C)的。感激不尽

發表於: 2005/3/10 13:22
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: About A/D sample frequency and resolution
#8
資深會員
資深會員


查看用戶資訊
參照:

fish512 寫道:
非常感谢大家的帮助,给了我很大的信心

冒昧的再提个问题:

模数转换器与数模转换器可不可以单独使用,即不与控制 器(单片机)相连,加晶振和电源, 也能实现改变采样频率和量化比特?
PIC单片机如何进行数字信号处理?
是否进行A/D D/A 转换前后必须得加模拟滤波器?参数如何设置?


1. 模数转换器若不與單片機連接,數字要傳去哪裡?数模转换器若不與單片機連接,數字要從哪裡來?沒意義喔

2. PIC单片机如何进行数字信号处理 ... 不就一堆算數運算嗎,寫在程式裡就好啦

3. 模拟滤波器 ... analog filter ... 看需求啦,不一定需要

先去買本書,買塊實驗版,買套編譯器,動手做,拿示波器觀察 ... 多言無益,學而不思則罔,思而不學則殆,多動手吧

發表於: 2005/3/9 10:27
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: About A/D sample frequency and resolution
#7
新會員
新會員


查看用戶資訊
非常感谢大家的帮助,给了我很大的信心

冒昧的再提个问题:

模数转换器与数模转换器可不可以单独使用,即不与控制 器(单片机)相连,加晶振和电源, 也能实现改变采样频率和量化比特?
PIC单片机如何进行数字信号处理?
是否进行A/D D/A 转换前后必须得加模拟滤波器?参数如何设置?

發表於: 2005/3/8 20:42
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: About A/D sample frequency and resolution
#6
新會員
新會員


查看用戶資訊



發表於: 2005/3/8 20:00
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: About A/D sample frequency and resolution
#5
資深會員
資深會員


查看用戶資訊
采样频率 不是 Tad,Tad 是轉換一個 bit 所需的時間,
采样频率 是每秒鐘採樣的次數。

以下是用 CCS 公司的 C-compiler 寫的範例

// AD_DA.c --------------------------------------------------------------------
//
// Function:
//
// 1. 10-bit ADC, Sampling Frequency:  20 Hz, take sample every 50 msec
//                convert 0 ~ 5 volt into 0 ~ 1023
//
// 2. PWM DA at PIN_C2 using 19.53 kHz PWM with R-C low-pass, 1 kohm - 10 uF
//                convert 0 ~ 1023 into 0 ~ 100% duty PWM signal
//
// 3. RS232 printout at 115200 baud rate
//
#include <16F877.h>
#device  ADC=10            // select 10 bit AD, or, ADC=8 for 8 bit AD

#fuses   HS, NOLVP, PUT, NOWDT

#use delay(clock=20000000) // 20 MHz X'tal
#use rs232(baud=115200,xmit=PIN_C6,rcv=PIN_C7)

void main()
{
   
int16 ad_data;
   
   
printf("rnn PIC16F877 ADC and PWM_DAC test ... rn ");
   
   
setup_adc_portsAN0 );          // set PIN_RA0/AN0 as analog input
   
setup_adcADC_CLOCK_DIV_32 );   // Tad= 32*T_osc= 1.6 usec/bit at 20 MHz
                                    // Tconv= (10 bit + 2)* 1.6 = 19.2 usec

   
setup_ccp1CCP_PWM );           // configure CCP1 (RC2) as PWM1
   
setup_timer_2(T2_DIV_BY_1,255,1);// 19.53 kHz PWM with 20 MHz X'tal

   
while(1)
   {
      
set_adc_channel);   // select channel, S/H Cap. start charging
      
delay_us 60 );        // wait for S/H Cap. reach 1/2 LSB accuracy
      
ad_data read_adc();   // open S/H, start ADC, T_conversion ~ 20 us,

      
set_pwm1_duty(ad_data); // send AD data to PWM output at PIN_C2
                              // set_pwm1_duty(1023) will generate 100% duty
                              
      
printf("%lu ",ad_data); // print out data to TTL-RS232 at PIN_C6

      
delay_ms50 );         // delay loop, set sampling freq ~ 20 Hz
   
}
}

發表於: 2005/3/7 11:20
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: About A/D sample frequency and resolution
#4
版主
版主


查看用戶資訊
1. 如果你要用C來編輯會比較簡單,PIC16F877A可以用 Hi-Tech PICC or CCS , PIC18Fxxxx則可以用MPLAB C18來編譯。 MPLAB C18 可以在"www.microchip.com"下載。

2. 16F877 及 18F452 的 ADC resoutions 是 10-bits, 最快轉換時間為19.2us ( 12Tad * 1.6uS), sampling time are 20uS
therefore the totally conversion time are 39.2uS (19.2uS+20uS。 如果要更快一點可考慮PIC18F4520 轉換速度為 10uS。

3. 有關固定取樣轉換的機制,是可以用Timer來驅動的。例如有一聲音需以 8KHz的頻率取樣,則可以設定Timer 每隔 125uS 來中斷並啟動AD轉換,這樣AD就會成為8KHz的轉換。

4. PIC 的硬體 PWM 輸出最高解析度為 10-bits , 最高輸出頻率為 19.5KHz,你只要在加入一個 RC low pass filter 就可以成為一個具有10-bits的 DAC.

5. 有關範例程式可參考右邊 "教育訓練" 裡的講義 W410 教材



發表於: 2005/3/7 10:00
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: About A/D sample frequency and resolution
#3
新會員
新會員


查看用戶資訊
非常感谢
我想用C 编,感觉上Assemble会写很长且复杂
仍有一些困惑
1。怎样改变resolution? 8 or 10 or 4 bits? 不太懂
有没有比较现成的程序可参考
2。 采样频率。是Tad吗? 与外接时钟有何直接关系?
关于timer interrupt or simply delay loop
可否请您再详细解释? 有没有比较现成的程序可参考
因为我新手一个,对于编程很触,自学了好久也没有入门的感觉
还望高手赐教。

發表於: 2005/3/7 0:56
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: About A/D sample frequency and resolution
#2
資深會員
資深會員


查看用戶資訊
1. resolution: you got only two choice with hardware, 8 or 10 bits. you can chop it down to 4 bit at your wish.

2. sampling freq.: you can use either timer interrupt or simply delay loop.

3. D/A: you can use either external DA or built-in PWM with simple external R-C low-pass.

Please specify what kind of program you want, C code or Assembly ?

發表於: 2005/3/5 10:06
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


About A/D sample frequency and resolution
#1
新會員
新會員


查看用戶資訊
Hello

i want to build a sample and quantization
demonstrate board. It aims to build an A/D and D/A
hardware interface and let the student use sample
frequency and resolution (number of bits) to make
experiment.

And observe the result by investage the digital
presatation(such as bit rate) and anologe output
(such as audio).

The anolog input can be a sine wave or square wave or
sanjiao wave.

At first I planned to use separate ADC and DAC(such as
ADC0804, ADC0809 or DAC0832,MC1408) But it seems I still need a MCU. So I planned to use Singlechip such as PIC.
But I am not sure How to chang the sample frequency and resolution?!!!
An idea: Use pic16f877 3 channels are set different sample frquencies. And use PWM output DAC or connect a DAC(such as DAC0832)

Anybody can give me some idea about the program?! and How to change the sample frequency and resolution?!!! Thank you cvery much

發表於: 2005/3/5 3:54
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部







You can view topic.
不可以 發起新主題
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.

[進階搜尋]


:::

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

教育訓練中心

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