資源簡(jiǎn)介
Sillcon lab 8051 單片機(jī) ADC PCA I2C UART SPI USB FLASH TIMER 等等 相關(guān)實(shí)例 代碼

代碼片段和文件信息
//-----------------------------------------------------------------------------
//?F38x_ADC0_ExternalInput.c
//-----------------------------------------------------------------------------
//?Copyright?2006?Silicon?Laboratories?Inc.
//?http://www.silabs.com
//
//?Program?Description:
//?--------------------
//
//?This?example?code?takes?and?averages?2048?analog?measurements?from?input
//?P1.1?using?ADC0?then?prints?the?results?to?a?terminal?window?via?the?UART.
//
//?The?system?is?clocked?by?the?internal?12MHz?oscillator.??Timer?2?triggers
//?a?conversion?on?ADC0?on?each?overflow.??The?completion?of?this?conversion
//?in?turn?triggers?an?interrupt?service?routine?(ISR).??The?ISR?averages?
//?2048?measurements?then?prints?the?value?to?the?terminal?via?printf?before
//?starting?another?average?cycle.
//
//?The?analog?multiplexer?selects?P1.1?as?the?positive?ADC0?input.??This?
//?port?is?configured?as?an?analog?input?in?the?port?initialization?routine.
//?The?negative?ADC0?input?is?connected?via?mux?to?ground?which?provides
//?for?a?single-ended?ADC?input.
//
//?A?100kohm?potentiometer?may?be?connected?as?a?voltage?divider?between?
//?VREF?and?AGND?on?the?terminal?strip?as?shown?below:
//
//?---------
//??????????|
//??????????|
//??????????|????????
//?????????o|?VREF?----|?
//?????????o|?GND???---|<-|
//?????????o|?????????????|
//?????????o|?P1.1--------|????????
//??????????|
//----------???
//?C8051F380-TB
//
//?Terminal?output?is?done?via?printf?which?directs?the?characters?to?
//?UART0.??A?UART?initialization?routine?is?therefore?necessary.
//
//?ADC?Settling?Time?Requirements?Sampling?Rate:
//?----------------------------------------------
//
//?The?total?sample?time?per?input?is?comprised?of?an?input?setting?time?
//?(Tsettle)?followed?by?a?conversion?time?(Tconvert):?
//
//?Tsample??=?Tsettle?+?Tconvert
//
//?|--------Settling-------|==Conversion==|----Settling---?.?.?.
//?Timer?2?overflow????????^??????????????????????????
//?ADC0?ISR???????????????????????????????^???????
//
//?The?ADC?input?voltage?must?be?allowed?adequate?time?to?settle?before?the?
//?conversion?is?made.??This?settling?depends?on?the?external?source
//?impedance?internal?mux?impedance?and?internal?capacitance.
//?Settling?time?is?given?by:
//
//???????????????????|?2^n?|
//????Tsettle?=???ln?|?---?|?*?Rtotal?*?Csample
//???????????????????|?SA??|???????
//
//?In?this?application?assume?a?100kohm?potentiometer?as?the?voltage?divider.
//?The?expression?evaluates?to:
//
//???????????????????|?2^10?|
//????Tsettle?=???ln?|?----?|?*?105e3?*?5e-12?=?4.4uS
//???????????????????|?0.25?|????
//
//?In?addition?one?must?allow?at?least?1.5uS?after?changing?analog?mux?
//?inputs?or?PGA?settings.??The?settling?time?in?this?example?then?is?
//?dictated?by?the?large?external?source?resistance.
//
//?The?conversion?is?10?periods?of?the?SAR?clock?.??At?3?MHz?
//?this?time?is?10?*?400nS?=?3.3
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件??????13350??2011-02-14?16:52??C8051F38x\ADC\F38x_ADC0_ExternalInput.c
?????文件??????19955??2017-07-12?09:26??C8051F38x\ADC\F38x_ADC0_ExternalInput_Mux.#1
?????文件??????19953??2017-07-12?09:21??C8051F38x\ADC\F38x_ADC0_ExternalInput_Mux.#2
?????文件??????19953??2017-07-12?09:06??C8051F38x\ADC\F38x_ADC0_ExternalInput_Mux.#3
?????文件??????19952??2017-07-12?09:27??C8051F38x\ADC\F38x_ADC0_ExternalInput_Mux.c
?????文件??????28923??2017-07-14?05:53??C8051F38x\ADC\F38x_ADC0_ExternalInput_Mux.LST
?????文件??????22850??2017-07-14?05:53??C8051F38x\ADC\F38x_ADC0_ExternalInput_Mux.OBJ
?????文件????????178??2017-07-14?05:53??C8051F38x\ADC\tmp.out
?????文件??????18607??2011-02-14?16:54??C8051F38x\bl
?????文件??????21513??2011-02-14?16:54??C8051F38x\bl
?????文件??????23803??2011-02-14?16:54??C8051F38x\bl
?????文件???????2719??2011-02-14?16:52??C8051F38x\bl
?????文件???????5920??2011-02-14?16:52??C8051F38x\bl
?????文件??????35536??2011-02-14?16:52??C8051F38x\bl
?????文件??????35597??2011-02-14?16:52??C8051F38x\bl
?????文件???????8426??2011-02-14?16:52??C8051F38x\Comparators\F38x_Comparator0_ResetSource.c
?????文件??????18607??2011-02-14?16:54??C8051F38x\Header_Files\C8051F380.INC
?????文件??????21513??2011-02-14?16:54??C8051F38x\Header_Files\C8051F380_defs.h
?????文件??????23803??2011-02-14?16:54??C8051F38x\Header_Files\compiler_defs.h
?????文件???????6993??2011-02-14?16:52??C8051F38x\Interrupts\F38x_External_Interrupts.c
?????文件???????9002??2011-02-14?16:52??C8051F38x\Oscillators\F38x_Clock_Multiplier.c
?????文件??????10346??2011-02-14?16:52??C8051F38x\Oscillators\F38x_LFO_Idle.c
?????文件???????5713??2011-02-14?16:52??C8051F38x\Oscillators\F38x_Oscillator_Capacitor.c
?????文件???????8695??2011-02-14?16:52??C8051F38x\Oscillators\F38x_Oscillator_CMOS.c
?????文件???????5962??2011-02-14?16:52??C8051F38x\Oscillators\F38x_Oscillator_Crystal.c
?????文件???????5809??2011-02-14?16:52??C8051F38x\Oscillators\F38x_Oscillator_RC.c
?????文件??????10414??2011-02-14?16:52??C8051F38x\PCA\F38x_PCA0_16Bit_PWM_Output.c
?????文件???????8312??2011-02-14?16:52??C8051F38x\PCA\F38x_PCA0_8Bit_PWM_Output.c
?????文件??????11017??2011-02-14?16:52??C8051F38x\PCA\F38x_PCA0_Capture_Input.c
?????文件???????6482??2011-02-14?16:52??C8051F38x\PCA\F38x_PCA0_Frequency_Output.c
............此處省略319個(gè)文件信息
評(píng)論
共有 條評(píng)論