资源简介
非常详细的单电机代码,包含了C8051F410外设的源码,为你的开发带了方便.
![](http://www.nz998.com/pic/40147.jpg)
代码片段和文件信息
//-----------------------------------------------------------------------------
// F41x_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 24.5MHz 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| P1.1 | |
// o| | |
// o| --------
// o|
// |
//----------
// C8051F410-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 uS.
//
//
// Tsample minimum = Tsettle + Tconvert
//
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 13241 2010-07-20 13:25 C8051F41x\ADC\F41x_ADC0_ExternalInput.c
文件 20344 2010-07-20 13:25 C8051F41x\ADC\F41x_ADC0_ExternalInput_Mux.c
文件 16320 2010-07-20 13:26 C8051F41x\bl
文件 14349 2010-07-20 13:26 C8051F41x\bl
文件 18885 2010-07-20 13:26 C8051F41x\bl
文件 2796 2010-07-20 13:25 C8051F41x\bl
文件 5700 2010-07-20 13:25 C8051F41x\bl
文件 47052 2010-07-20 13:25 C8051F41x\bl
文件 47002 2010-07-20 13:25 C8051F41x\bl
文件 8414 2010-07-20 13:25 C8051F41x\Comparators\F41x_Comparator0_ResetSource.c
文件 12575 2010-07-20 13:25 C8051F41x\DAC\F41x_DACs_SineCosine.c
文件 16320 2010-07-20 13:26 C8051F41x\Header_Files\c8051F410.h
文件 14349 2010-07-20 13:26 C8051F41x\Header_Files\C8051F410.INC
文件 18885 2010-07-20 13:26 C8051F41x\Header_Files\C8051F410_defs.h
文件 7044 2010-07-20 13:25 C8051F41x\Interrupts\F41x_External_Interrupts.c
文件 9474 2010-07-20 13:25 C8051F41x\Oscillators\F41x_Clock_Multiplier.c
文件 5763 2010-07-20 13:25 C8051F41x\Oscillators\F41x_Oscillator_Capacitor.c
文件 9031 2010-07-20 13:25 C8051F41x\Oscillators\F41x_Oscillator_CMOS.c
文件 5880 2010-07-20 13:25 C8051F41x\Oscillators\F41x_Oscillator_Crystal.c
文件 5856 2010-07-20 13:25 C8051F41x\Oscillators\F41x_Oscillator_RC.c
文件 17906 2010-07-20 13:25 C8051F41x\Oscillators\F41x_RTC_Suspend.c
文件 10500 2010-07-20 13:25 C8051F41x\PCA\F41x_PCA0_16Bit_PWM_Output.c
文件 8402 2010-07-20 13:25 C8051F41x\PCA\F41x_PCA0_8Bit_PWM_Output.c
文件 11095 2010-07-20 13:25 C8051F41x\PCA\F41x_PCA0_Capture_Input.c
文件 6564 2010-07-20 13:25 C8051F41x\PCA\F41x_PCA0_Frequency_Output.c
文件 9636 2010-07-20 13:25 C8051F41x\PCA\F41x_PCA0_High_Speed_Output.c
文件 10426 2010-07-20 13:25 C8051F41x\PCA\F41x_PCA0_Software_Timer_bl
文件 6773 2010-07-20 13:25 C8051F41x\PortIO\F41x_PortMatch.c
文件 5920 2010-07-20 13:25 C8051F41x\PortIO\F41x_Ports_SwitchesLEDs.c
文件 29740 2010-07-20 13:25 C8051F41x\SMBus\F41x_SMBus_EEPROM.c
............此处省略36个文件信息
- 上一篇:spooling技术源代码+word实验报告
- 下一篇:理发师问题Linux,c
相关资源
- STM32 2.4G通信例程
- 我的世界源码(易语言版)
- labview编程软件滤波器以及编写程序设
- 我的界面(visual foxpro)源码
- 易语言:一键cf基址源码
- 直流无刷电机方波驱动 stm32 例程代码
- The Secret Path 3D 3D魔方迷宫[源码][scra
- scratch垃圾分类源码(最终版本).sb
- PCIe速度测试例程
- STM32f103超声波模块例程
- 安卓QQ6.71协议源码易语言,qq协议源码
- 编译原理实验工具及参考源码(lex&
- E盾偷后台工具源码
- UNIX/LINUX编程实践教程的源码
- 嵌入式图形界面MiniGUI的示例程序9例
- 十以内加减法练习 powerbuilder源码
- 农场开发项目
- OCR源码
- PLC上位机编程软件
- 用foobar2000听google音乐[更新一下]
- 学生信息管理系统源码
- 用VC 编写的仿QQ聊天室程序源代码
- 毕业论文之温度传感器DS18B20(源码
- 可自定义导航网站源码
- 栅栏填充算法源码(VC)
- msp430F149操作红外接收模块源码
- [免费]图像识别c 源码
- 周易排盘源码
- CCP标定例程
- RSA算法源码
评论
共有 条评论