1  Embedded system

  An embedded system is a combination of computer hardware and software, and perhaps additional mechanical or other parts, designed to perform a specific function. (E.g. microwave oven)

2  Infinite loop

  One of the most fundamental differences between programs developed for embedded systems and those written for other computer platforms is that the embedded programs almost always end with an infinite loop.

  The infinite loop is necessary because the embedded software's job is never done. It is intended to be run until either the world comes to an end or the board is reset, whichever happens first.

3  Blinking LED

 /**********************************************************************
*
* Function: main()
*
* Description: Blink the green LED once a second.
*
* Notes: This outer loop is hardware-independent. However,
* it depends on two hardware-dependent functions.
*
* Returns: This routine contains an infinite loop.
*
**********************************************************************/
void main(void)
{
while ()
{
toggleLed(LED_GREEN); /* Change the state of the LED. */
delay(); /* Pause for 500 milliseconds. */
}
}

  3.1  toggleLed

 /**********************************************************************
*
* Function: toggleLed()
*
* Description: Toggle the state of one or both LEDs.
*
* Notes: This function is specific to Arcom's Target188EB board.
*
* Returns: None defined.
*
**********************************************************************/ #define LED_GREEN 0x40 /* The green LED is controlled by bit 6.*/
#define P2LTCH 0xFF5E /* The offset of the P2LTCH register. */ void toggleLed(unsigned char ledMask)
{
asm {
mov dx, P2LTCH /* Load the address of the register. */
in al, dx /* Read the contents of the register. */ mov ah, ledMask /* Move the ledMask into a register. */
xor al, ah /* Toggle the requested bits. */ out dx, al /* Write the new register contents. */
}; } /* toggleLed() */

  3.2  delay

 /**********************************************************************
*
* Function: delay()
*
* Description: Busy-wait for the requested number of milliseconds.
*
* Notes: The number of decrement-and-test cycles per millisecond
* was determined through trial and error. This value is
* dependent upon the processor type and speed.
*
* Returns: None defined.
*
**********************************************************************/ void delay(unsigned int nMilliseconds)
{
#define CYCLES_PER_MS 260 /* Number of decrement-and-test cycles. */ unsigned long nCycles = nMilliseconds * CYCLES_PER_MS; while (nCycles--); } /* delay() */

Embedded之Introduction的更多相关文章

  1. MySQLdb User's Guide

    MySQLdb MySQLdb-1.2.2 API documentation http://mysql-python.sourceforge.net/MySQLdb-1.2.2/ MySQLdb U ...

  2. 嵌入式(Embedded System)笔记 —— Cortex-M3 Introduction and Basics(上)

    随着课内的学习,我想把每节课所学记录下来,以作查阅.以饲读者.由于我所上的是英文班课程,因此我将把关键术语的英文给出,甚至有些内容直接使用英文. 本次所介绍内容是关于Cortex-M3的基础内容. - ...

  3. 嵌入式(Embedded System)笔记 —— Cortex-M3 Introduction and Basics(下)

    随着课内的学习,我想把每节课所学记录下来,以作查阅.以饲读者.由于我所上的是英文班课程,因此我将把关键术语的英文给出,甚至有些内容直接使用英文. 本次所介绍内容仍是关于Cortex-M3的基础内容,相 ...

  4. [转]A Guide To using IMU (Accelerometer and Gyroscope Devices) in Embedded Applications.

    原文地址http://www.starlino.com/imu_guide.html Introduction There’s now a FRENCH translation of this art ...

  5. Chromium Embedded Framework 中文文档(简介)

    转自:http://www.cnblogs.com/think/archive/2011/10/06/CEF-Introduce.html 简介 Chromium Embedded Framework ...

  6. Introduction to ASP.NET Web Programming Using the Razor Syntax (C#)

    1, http://www.asp.net/web-pages/overview/getting-started/introducing-razor-syntax-c 2, Introduction ...

  7. A brief introduction to weakly supervised learning(简要介绍弱监督学习)

    by 南大周志华 摘要 监督学习技术通过学习大量训练数据来构建预测模型,其中每个训练样本都有其对应的真值输出.尽管现有的技术已经取得了巨大的成功,但值得注意的是,由于数据标注过程的高成本,很多任务很难 ...

  8. An Introduction To The SQLite C/C++ Interface

    1. Summary The following two objects and eight methods comprise the essential elements of the SQLite ...

  9. SpagoBI 教程 Lesson 1:Introduction and Installation

    SapgoBI Lesson 1: Introduction and Installation Downloading and installing SpagoBI. Download SpagoBI ...

随机推荐

  1. Java并发编程知识总结

    一.线程 1.线程创建: 继承Thread类创建线程类 实现Runnable接口创建线程类 使用Callable和Future创建线程 Runnable是执行工作的独立任务,但是它不返回任何值,如果希 ...

  2. BZOJ 2342 双倍回文(manacher算法)

    题目链接:http://61.187.179.132/JudgeOnline/problem.php?id=2342 题意:定义双倍回文串为:串的长度为4的倍数且串的前一半.后一半.串本身均是回文的. ...

  3. svn版本库包含多个项目 ; git svn clone; 某一个子项目,有多个分支;

    情况描述: 公司的svn版本库,包含了多个项目,每个项目对应于1个文件夹 假设版本库名字为Main,其下的项目用 A项目,对应文件夹A B项目,对应文件夹B 通过git svn clone获取了svn ...

  4. Codeforces Round #272 (Div. 2) C. Dreamoon and Sums (数学 思维)

    题目链接 这个题取模的时候挺坑的!!! 题意:div(x , b) / mod(x , b) = k( 1 <= k <= a).求x的和 分析: 我们知道mod(x % b)的取值范围为 ...

  5. css中图片的四种地址引用

    URL: CSS中四种引用图片asset的方式:

  6. Mybatis 插入与批量插入以及多参数批量删除

    实体类: import java.io.Serializable; public class AttachmentTable implements Serializable { private sta ...

  7. bzoj2982: combination

    借(cao)鉴(xi)自popoqqq大爷的lucas定理的写法 #include<cstdio> #include<cstring> #include<cctype&g ...

  8. css各浏览器的兼容性写法

    各浏览器下的兼容性写法 老版Chrome     -webkit-xxx FF                  -moz-xxx IE9                 -ms-xxx opera ...

  9. UVa 1586 Molar mass

    题意:给出物质的分子式,计算它的相对原子质量 因为原子的个数是在2到99之间的,所以找出一个是字母之后,再判断一下它的后两位就可以找出这种原子的个数了 #include<iostream> ...

  10. win7x64安装wince6

    Windows Embedded CE 安装方法 Wince的安装相对比较复杂,即使是一个Wince的老手,也可能遇到这样那样的问题.想来真是悲摧,Windows XP, Windows 7,64位, ...