资源简介
非常详细的单电机代码,包含了C8051F410外设的源码,为你的开发带了方便.
代码片段和文件信息
//-----------------------------------------------------------------------------
// 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
相关资源
- 小程序源码 豆瓣书城
- labview串口中断控制例程
- 文件系统源码--操作系统课程设计
- mpq解压工具易语言源码
- 逻辑回归分类鸢尾花和红酒等级,源
- 线性回归数值型预测:预测鲍鱼的年
- Word2000/XP中内部COM插件的编程实现(源
- 电力系统电表开发源码
- 仿中国婚博会小程序源码
- 大转盘抽奖游戏源码(完整版)
- SPCOMM_DELPHI_串口工具源码
- 火柴人跑步flash源码
- dubbo全套视频教程(含有文档、ppt、源
- proj4源代码
- mb85铁电存储器C例程
- TMS320F28069 例程
- RabbitMQ消息中间件技术精讲包含源码等
- 计算机图形学OpenGL源码
- Proteus 7 仿真 单片机双积分式AD转换电
- 自适应简约网站菜单源码
- DEV GridControl GridView导出到Excel 支持多
- 支持8核的中国象棋引擎源码
- filedisk-21最新版本驱动和应用源码
- js框架源码
- qt贪吃蛇游戏源码
- 逍遥注册充值权限源码
- 学生信息管理系统 数据库课程设计源
- 企业工资管理系统 数据库课程设计源
- 操作系统实验报告 主存空间的分配与
- 基于AVR单片机的OLED现实源码
评论
共有 条评论