资源简介
松翰芯片的一些例程,在官网也能下载到,这些例程都是最简单的例子。

代码片段和文件信息
//-----------------------------------------------------------------------------
// FILE: ADC.c
//-----------------------------------------------------------------------------
// Copyright 2015 Sonix Technology Corp. All rights reserved.
//
// AUTHOR: Sonix
// DATE: 2015/11/20
//
//
// ADC decription:
// User can select ADC channel 0~14
// note-
// 1. channel 0~11 are usual pins
// 2. channel 12 input is OP0O pin
// 3. channel 13 input is OP1O pin
// 4. channel 14 input voltage by VHS[1:0]
// and if user select internal VREFH
// the internal VREFH MUST BE “internal VDD“
//
// The system clock frequency is IHRC 32MHz
//
// Device: SN8F5708
// Tool chain: KEIL C51 V9.54
//
//-----------------------------------------------------------------------------
// Includes
//-----------------------------------------------------------------------------
#include
#include “ADC.h“
//-----------------------------------------------------------------------------
// Global Constants
//-----------------------------------------------------------------------------
#define CLR_ADCCH (ADM & 0xE0) // clear CHS[4:0]
#define _ADENB ADM |= 0x80 // ADC enable (ADENB)
#define EnADC_Coverting ADM |= 0x40 // ADC converting start (ADS)
//-----------------------------------------------------------------------------
// Global Variables
//-----------------------------------------------------------------------------
unsigned int uiADCL;
unsigned int uiADC;
//-----------------------------------------------------------------------------
// Function Prototypes
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// Function: void ADC_Enable_Interrupt(void)
// Description:
// enable ADC interrupt
//
//-----------------------------------------------------------------------------
void ADC_Enable_Interrupt(void)
{
IEN2 |= 0x08; // ADC interrupt enable (EADC)
EAL = 1; // Interrupt enable
}
//-----------------------------------------------------------------------------
// Function: void ADC_Init(void)
// Description:
// Init ADC parameter
// Set ADC high/low refernce
// Set interrupt and enable ADC
//
//-----------------------------------------------------------------------------
void ADC_Init(void)
{
uiADCL = 0; // init ADC parameter
uiADC = 0;
ADR |= 0x40; // Enable AIN channel (GCHS)
ADR |= 0x20; // ADCˇs clock source is Fhosc/1 (ADCKS1/ADCKS0)
VREFH &= 0x7F; // Enable ADC internal VREFH function (EVHENB)
VREFH &=
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
....... 91946 2019-06-05 16:17 SN8F5708_Sample_Code_V0.3\Sample_Code_V03\ADC\ADC.uvgui.Administrator
....... 57907 2019-06-05 18:30 SN8F5708_Sample_Code_V0.3\Sample_Code_V03\ADC\ADC.uvopt
....... 13761 2019-06-05 18:30 SN8F5708_Sample_Code_V0.3\Sample_Code_V03\ADC\ADC.uvproj
....... 57883 2019-06-05 18:29 SN8F5708_Sample_Code_V0.3\Sample_Code_V03\ADC\ADC_uvopt.bak
....... 13737 2019-06-05 18:29 SN8F5708_Sample_Code_V0.3\Sample_Code_V03\ADC\ADC_uvproj.bak
文件 13681 2019-06-05 15:25 SN8F5708_Sample_Code_V0.3\Sample_Code_V03\ADC\LST\ADC.lst
文件 11064 2019-06-05 15:25 SN8F5708_Sample_Code_V0.3\Sample_Code_V03\ADC\LST\ADC.m51
文件 4449 2019-06-05 15:25 SN8F5708_Sample_Code_V0.3\Sample_Code_V03\ADC\LST\Main.lst
文件 6048 2019-06-05 15:25 SN8F5708_Sample_Code_V0.3\Sample_Code_V03\ADC\LST\OPTIONS_SN8F5708.lst
文件 2980 2015-04-28 09:31 SN8F5708_Sample_Code_V0.3\Sample_Code_V03\ADC\OPTIONS_SN8F5708.A51
文件 10627 2019-06-05 15:25 SN8F5708_Sample_Code_V0.3\Sample_Code_V03\ADC\Output\ADC
文件 16384 2019-06-05 15:25 SN8F5708_Sample_Code_V0.3\Sample_Code_V03\ADC\Output\ADC.BIN
文件 1536 2019-06-05 15:25 SN8F5708_Sample_Code_V0.3\Sample_Code_V03\ADC\Output\ADC.build_log.htm
文件 1265 2019-06-05 15:25 SN8F5708_Sample_Code_V0.3\Sample_Code_V03\ADC\Output\ADC.hex
文件 182 2019-06-05 15:25 SN8F5708_Sample_Code_V0.3\Sample_Code_V03\ADC\Output\ADC.lnp
文件 7436 2019-06-05 15:25 SN8F5708_Sample_Code_V0.3\Sample_Code_V03\ADC\Output\ADC.obj
文件 197 2019-06-06 09:24 SN8F5708_Sample_Code_V0.3\Sample_Code_V03\ADC\Output\ADC.plg
文件 3966 2019-06-05 15:25 SN8F5708_Sample_Code_V0.3\Sample_Code_V03\ADC\Output\Main.obj
文件 473 2019-06-05 15:25 SN8F5708_Sample_Code_V0.3\Sample_Code_V03\ADC\Output\OPTIONS_SN8F5708.obj
文件 9341 2015-11-20 11:48 SN8F5708_Sample_Code_V0.3\Sample_Code_V03\ADC\SRC\ADC.c
文件 879 2015-11-20 11:49 SN8F5708_Sample_Code_V0.3\Sample_Code_V03\ADC\SRC\ADC.h
文件 2524 2015-11-20 11:48 SN8F5708_Sample_Code_V0.3\Sample_Code_V03\ADC\SRC\Main.c
文件 6040 2016-03-15 11:35 SN8F5708_Sample_Code_V0.3\Sample_Code_V03\CMP\Cmp0\Cmp.uvopt
文件 14184 2016-03-15 11:35 SN8F5708_Sample_Code_V0.3\Sample_Code_V03\CMP\Cmp0\Cmp.uvproj
文件 2980 2015-04-28 09:31 SN8F5708_Sample_Code_V0.3\Sample_Code_V03\CMP\Cmp0\OPTIONS_SN8F5708.A51
文件 5438 2015-05-18 14:37 SN8F5708_Sample_Code_V0.3\Sample_Code_V03\CMP\Cmp0\SRC\Cmp0.c
文件 5999 2015-09-30 19:11 SN8F5708_Sample_Code_V0.3\Sample_Code_V03\CMP\Cmp1\Cmp1.uvopt
文件 14185 2015-09-30 19:11 SN8F5708_Sample_Code_V0.3\Sample_Code_V03\CMP\Cmp1\Cmp1.uvproj
文件 2980 2015-04-28 09:31 SN8F5708_Sample_Code_V0.3\Sample_Code_V03\CMP\Cmp1\OPTIONS_SN8F5708.A51
文件 5326 2015-05-18 14:37 SN8F5708_Sample_Code_V0.3\Sample_Code_V03\CMP\Cmp1\SRC\Cmp1.c
............此处省略195个文件信息
相关资源
- boost::asio::serial下6个工程演示多种串口
- visio软件64位破解版本
- 专业版 Visio 工具cn_visio_professional_20
- Visio2016 激活工具
- DOS中断和BIOS中断手册
- 电脑BIOS设置各种中英文对照表
- Theoretical study of the interaction between C
- Assembly Language for x86 Processors (7th Ed
- The IDA Pro Book 2nd Edition
- 《THE ONE-PAGE PROJECT MANAGER FOR EXECUTION(
- ANSYS 14.5 Design Exploration User Guide
- VMware Workstation Pro 15 注册机
- 技嘉H310M S2 BIOS
- Numerical Optimization 2ed-Nocedal
- 技嘉z77p-d3 rev 1.0 添加nvme模块的最新
- IOS水印
- MySQL Notes For Professionals
- AsyncTask文件控制暂停和继续,在状态
- Visio大全模具(含Cisco、IBM等常用拓扑
- AXURE移动端素材元件库68580
- Rational Rose Common破解文件
- umeshmotion网格推移
- Visio图标-最新最全的网络通信图标库
- 联想H61主板BIOS升级F9KT58AUS支持22NM.i
-
Actionsc
ript 1.0实现能跟随鼠标运动的 - The direction of synaptic plasticity mediated
- Reparatory Effects of Nicotine on NMDA Recepto
- Apolipoprotein E4 Impairs in vivo Hippocampal
- Histamine excites rat lateral vestibular nucle
- Lenovo Z460 SLIC2.1 LENOVO-29CN38WW(V2.15)
评论
共有 条评论