at91-看门狗驱动修改指南详解
watchdog解析

watchdog 解析mg2580看门狗硬件,实现分析1. 看门狗使用的是DW_WDT的看门狗.DW是一个公司的看门狗芯片.此驱动程序实现两个看门狗操作:硬件和软件。
硬件看门狗监控系统在下列情况下将reset.它已经停止响应,或软件看门狗有问题.软件看门狗由用户空间应用程序处理应用程序申请挂起处理.2.如何使用看门狗?(1). 打开/dev/watchdog.(2). 使用IOCTL接口来设置超时。
(3). 指定所需的设置。
(4). 通过IOCTL接口喂狗。
应用程序必须这样做是为了避免触发看门狗。
(5). 关闭/dev/watchdog。
如果软件看门狗关闭,驱动将试图杀死进程的看门狗定时器。
如果驱动程序无法杀死该进程系统将重置。
注意!应特别注意使用时使用,因为该软件看门狗明显的影响重置系统。
3. 加载看门狗看门狗驱动默认加载,如果没有加载,可以手动加载,默认超时时间是17s,两种方法可以改变,一种为:(1). modparam dw_wdt hw_default_heartbeat=XX(XX 为1-17s)(2). echo XX > /proc/driver/watchdog/expires看硬件看门狗超时时间.cat /proc/driver/watchdog/expires看软件和硬件看门狗信息:cat /proc/driver/watchdog/status这个前一个命令: 是硬件看门狗启动,超时为17s,没有启动软件看门狗.后一个命令: 是硬件看门狗启动,超时为17s,启动软件看门狗,进程为1161,超时为10s.系统超时总时间为: 10< watch timer < 10+17 s3. 原理:1.软件看门狗通过定时器实现:当定时器超时,运行,定时器处理函数, 重启或kill 进程.2.硬件的喂狗:写寄存器重新启动WDT计数器。
作为安全措施,值0x76必须写入。
重新启动并且清除WDT的中断。
AT91SAM7X256中文版

PIOA
PIT WDT RTT PIOB
APB
PDC
USART0
PDC PDC
USART1
PDC PDC
SPI0
PDC PDC
SPI1
PDC PDC
ADC
SAM-BA
DMA FIFO Ethernet MAC 10/100
FIFO
USB Device
PWMC
PDC
SSC
PDC Timer Counter TC0 TC1 TC2 TWI
– 8 个完全可编程消息对象邮箱, 16 位时间标志计数器
• 一个同步串行控制器 (SSC)
– 每个接受器和发送器都有独立的时钟和帧同步信号 – 支持I²S 模拟接口, 支持分时复用 – 支持 32 位数据传输的高速连续数据流功能
• 两个通用同步/异步收发器 (USART)
– 独立的波特率发生器, 可以 IrDA 红外调制/解调 – 支持 ISO7816 T0/T1 智能卡, 硬件握手信号以及 RS485 – USART1 口支持全 Modem 线
欢迎访问本公司网站 /
免责声明
本资料英文版本来源于互联网,将其译成中文版本以便于中国广大ARM爱好者交 流、学习,请勿用于任何商业目的。
本文件为英文原本之非正式翻译,不保证翻译的真实性和准确性,同时声明文件以英 文版本为准。
由于嵌入式领域我国并无统一名称规范,大部分术语均直译,另有部分术语参考了 ATMEL 公司的 AT91SAM7S64 中文资料,由于译者对嵌入式领域理解的深度有限,难 免有疏漏和错误之处,也希望大家指出。
AT91 ARM® Thumb®-based Microcontrollers
AT91SAM7X256 AT91SAM7X128
AT91RM9200-DVK2.3 开发板 说明书

AT91RM9200-DVK2.3开发板软硬件配置清单1.硬件配置开发板照片1.1. 核心板序号项目配置说明1 处理器: AT91RM9200工业级2片2 内存 64M HY5616203 NOR FLASH 4MB AMD29LV320D B4 扩展总线80 x 2 引出ARM绝大部分信号1.2. 主板序号项目配置说明1.调试接口 20芯JTAG 符合ARM公司的标准定义2. USB主1个支持U盘,键盘等。
12Mb/s3. USB从1个12Mb/s4. CAN 1个 CAN2.0A/B接口。
5.红外1个6. RS485 1个7. RS232 3个1个9针,2个3针8. SD卡1个支持<1G SD卡。
9. LCM接口1个 LCM240X128 支持青云的LCM2401281单色液晶模块。
(液晶单独选配)10.矩阵键盘 8X8 支持1-64个键。
11.实时钟 DS1302外扩实时钟带后备电池。
12.网络1个10/100M DM916113. NAND-FLASH 64M K9f1208支持YAFFS文件系统。
14.扩展总线接口 40针扩展接口可用于连接用户自己开发的接口应用板。
15.电源 +5V电源输入2.软件配置序号项目配置说明1.引导程序 U-BOOT-1.1.2开放源代码。
2.操作系统 ARM-LINUX内核源代码3.开发环境。
ARM-LINUX-2.95.3编译器ARM-LINUX-3.4.1编译器LCD字符和图形显示的示例。
演示在240X128单色液晶上显示英文字符数字和简单图形符号。
键盘的读取演示对键盘按键值的读取实时时钟读写演示如何读取和设置系统实时钟。
TCP/UDP协议的SOCKET 编程演示客户-服务器通讯ARM和PC通讯4.LINUX应用开发演示源代码RS232接口的TTY串口通信演示开发板与PC机之间的RS232双向通讯。
红外线IrDA 的通信 RS485接口通信USB 接口的U 盘挂装和读写 硬件看门狗应用演示源代码pthread 多线程编程 学习多任务编程 5. CAN 总线通讯CAN MCP2510(选购) LCD LCM 单色屏(选购) MTD NAND -FLASH NET以太网RTC DS1302及9200内部RTC IO IO 口读写SERIAL 串口及485 USBWATCHDOG 看门狗SD 支持512MB SD 卡(选购)6. 板子上所有硬件的驱动程序源代码。
SAM9260V1 Linux配置编译手册

SAM9260V1 Linux配置编译手册Rev. 1.0Release: 2008-08-26联系信息更多信息请访问:Revision history Rev DateDescription1.0 20080826 Initial version目录第一章引言 (5)1.1概述 (5)1.2必要准备 (5)第二章编译L INUX内核 (6)第三章制作YAFFS文件系统映像 (7)第四章内核驱动配置 (8)4.1串口 (8)4.2实时时钟(RTC) (9)4.3看门狗 (10)4.4 I2C总线 (12)4.5 AD转换器(ADC) (13)4.6 I2C EEPROM (14)4.7 GPIO接口 (15)4.8 SPI总线 (16)4.9 CAN总线 (17)4.10网络 (18)4.11 MMC/SD卡 (21)4.12 USB接口 (22)4.13 NAND Flash上使用YAFFS (25)PrefaceSAM9260V1是一款高度集成的工业控制单板机,采用ATMEL公司的AT91SAM9260控制器,并支持多种存储模式和提供多种通信接口,可以直接嵌入到客户系统内部,作为主控板使用。
SAM9260V1提供Linux2.6.19操作系统及完善的底层驱动程序,客户可直接基于驱动进行上层应用开发工作。
SAM9260V1 Linux配置编译手册主要介绍用户在开发驱动的过程中对linux内核进行编译配置的方法,用户可参考此文档按照实际需求对linux进行定制,及制作相应的文件系统。
第一章引言1.1概述本文档主要介绍用户在开发驱动的过程中对linux内核进行编译配置的方法,用户可参考此文档按照实际需求对linux进行定制,及制作相应的文件系统。
1.2必要准备首先在解压光盘中所提供的源码包,进入光盘路径,运行解压指令,进行如下解压缩指令(注:本手册须在PC机linux系统上操作,且需要用root用户权限进行解压缩)[root@localhost]$ tar –jxvf sam9260V1.tar.bz2 –C /解压缩后,会在opt下生成两个文件夹,各个文件夹内容如下:/opt/timesys/toolchains/armv5l-linux/ 为交叉编译工具文件夹/opt/sam9260V1/linux-2.6.19/ linux内核文件夹/opt/sam9260V1/rootfs 文件系统文件夹/opt/sam9260V1/tools/mkyaffsimage yaffs制作工具/opt/sam9260V1/test_code/ 测试代码文件夹如果用户需要对相应的文件进行操作,用户可进入相应的文件夹中。
AT91SAM9R64 ARM Thumb-based微控制器USB认证应用指南说明书

AT91SAM9R64 USB Certification1.IntroductionThis Application Note describes the USB certification process for the AT91SAM9R64 ARM® Thumb®-based microcontroller that contains a USB V2.0 High Speed Device. It describes the full USB peripheral environment required for USB-IF compliance.The following table gives the references of applicable documents:Document Reference DenominationAtmel lit° 6289A T91SAM9R64 and RL64 Datasheet and Summary DatasheetAtmel lit° 6193 Mass Storage and File System Demo for A T91SAM7S_EK Development Board User GuideAtmel softpack A T91 Software packageusb_20.pdf Universal Serial Bus Revision 2.0 Specification (from /developers/docs)usb-msc-overview-1.3b.pdf Universal Serial Bus - Mass Storage Class Specific Overview (from /developers/devclass_docs)usbmassbulk_10.pdf Universal Serial Bus - Mass Storage Bulk-Only T ransport (from /developers/devclass_docs)compliance tools USB-IF Compliance Program (from /developers/compliance)compchkperisil080205.pdf USB Compliance Checklist, Peripheral Silicon (Excluding Hub Silicon) (from /developers/compliance/checklist)compchkperi080205.pdf USB Compliance Checklist, Peripherals (Excluding Hubs) (from /developers/compliance/checklist)26487A–ATARM–30-Jul-09Application NoteB CertificationInformation used in this chapter is available on the USB web site/home2.1The Purpose of USB CertificationThe Universal Serial Bus (USB) is a huge success! This presents a great market opportunity for USB vendors. In order to realize this opportunity, USB products must continue to enhance the consumer’s experience through high quality and ease of use. That is why USB Implementers Forum, Inc. introduced a trademark-protected logo for use with qualified products. To qualify for the right to display the certified USB logo in conjunction with a product, the product must pass USB-IF compliance testing for product quality.Figure B HighSpeed LogoEach type of USB product requires specific testing to get on the USB Integrator’s List. End user products (peripherals) have to fill the USB Compliance Checklist. For instance, peripherals which require identification of the receptacles, cable assembly or, if the cable is captive, the A connector, and manufacturer and model identifier of the USB Silicon used in the peripheral.If the silicon used in the peripheral is not listed on the USB Integrator’s List, then a Peripheral Silicon Checklist covering this peripheral’s USB silicon must be provided.Atmel has already submitted the AT91SAM9R64 and this product is now referenced in the USB integrator list:AT91SAM9R64Revision GTID 40000827To pass the peripheral silicon testing, it was necessary for Atmel to construct a final product based on the AT91SAM9R64 and test that product as anyone using the AT91SAM9R64 would do. The final product application is a mass-storage based application using the AT91SAM9R-VBboard.36487A–ATARM–30-Jul-09Application Note2.2Where to Apply for USB CertificationThe USB-IF logos may be used only in conjunction with products that have passed USB-IF com-pliance testing and are currently on the USB Integrator’s List. This requires that the company be assigned a USB vendor ID number. Atmel’s USB vendor ID is 03EBh.There is a logo administration fee of US $2000 for non-USB-IF members, to be submitted with the signed agreement and a Vendor ID form, that you can get from the “Getting a Vendor ID”page:/developers/vendor/VID_Only_Form_withCCAuth_02042009.pdfif your company does not already have a vendor ID. The fee is waived for USB-IF members.Registration to the USB-IF community can be done on-line.There are two mechanisms for testing products to get them on the USB Integrator’s List:•you can participate in the USB-IF Sponsored Compliance Workshops, or•contact one of the Independent Test Labs.A complete list of test labs and contact information is available at:/developers/complianceTo qualify the AT91SAM9R64 product, Atmel has been working with the following lab:Testronic Laboratories/ PMTCJohan CraeybeckxWetenschapspark 7B-3590 DiepenbeekBelgiumTel: +32 11 30 36 53Fax: +32 11 30 36 90Email:**********************************URL: Companies should contact the lab of their choice directly for pricing and scheduling. To submit a testing request to the lab of choice, follow the instructions below:•Go to the “Compliance Member Tools” section of the Web site:/kcompliance/membersType in your User name and Password.•Click on “Register a Product for testing”•Select the type of product to submit for testing, the test lab of choice and enter the product information completely. The product submission will be in the “New” state. The selected test lab will receive email notification of the request. Once the test lab reviews and accepts the testing request, the product’s status will be “Accepted for T esting”.46487A–ATARM–30-Jul-09Application Note2.3Peripheral Test RequirementsThe following must be successfully completed for Peripherals:•Electrical Tests (full speed and high speed)•Interoperability Tests (full speed and high speed)•Functional Tests (full speed and high speed)•Submission of Completed Peripheral ChecklistAdditional information is available at /developers/docs:•for full speed, select the USB-IF Compliance T est Procedure•for high speed, select the High-speed Electrical Test Procedure corresponding to the equipment to test56487A–ATARM–30-Jul-09Application Note3.AT91SAM9R64 Test Product Description3.1System DescriptionTo pass the peripheral silicon testing, Atmel built a final product based on the AT91SAM9R64.The final product application is a mass-storage based application using the AT91SAM9R-VB board.Once the AT91SAM9R-VB board is connected to the host PC, a new disk drive appears on screen. The SDRAM of the AT91SAM9R-VB board appears as a new flash drive. Through Win-dows ®OS, applications can perform file transfer with the target external flash. As the peripheral enumerates as a standard mass-storage device (please refer to the USB Mass-storage class specification), this application does not require any Windows 2000 drivers.The mass-storage source code is freely delivered by Atmel in the Software Package.The AT91SAM9R-VB board has not been modified.3.2Main ConstraintsThe tested peripheral should match all requirements specified in the USB Revision 2.0 Specifi-cation. Only a few constraints with immediate consequences on application programming and board design are highlighted here.3.2.1Clock ConstraintsThe high-speed data rate (T HSDRA T ) is nominally 480.00 Mb/s, with a required bit rate accuracy of ±500 ppm. For high-speed capability, the required data-rate accuracy when transmitting at any speed is ±0.05% (500 ppm). Refer to the USB Rev2.0 Specification, chapter “Data Signaling Rate”.The application firmware must configure clocks and PLL in order to match these requirements.3.2.2Timing ConstraintsAfter connecting a peripheral to a host, the device has at least 100 ms after the detection of the pull-up by the host to configure and be able to answer host requests.A peripheral begins the transition to the suspend state after it observes a constant Idle state on its upstream facing bus lines for more than 3.0 ms. The device must actually be suspended,drawing only suspend current from the bus after no more than (T 2SUSP ) 10 ms of bus inactivity on all its ports. Thus the application firmware has 7 ms to reduce power consumption of the board.Refer the USB Rev2.0 Specification, chapter “Suspending”.The host must provide a 10 ms resume recovery time (T RSMRCY ) during which it will not attempt to access any device connected to the affected (just-activated) bus segment. During this time the application firmware must restore clocks and software context.3.3AT91SAM9R-VB Certified Board Description 3.3.1Hardware DescriptionNo change has been made on this board.3.3.2Software DescriptionThis is the usb-device-massstorage-project of the Software Package, freely delivery by ATMEL.66487A–ATARM–30-Jul-09Application Note4.AppendixThe pages shown in the Appendix are scanned copies of the original documents as listed B Compliance Checklist, Peripheral Silicon .USB Compliance Checklist, PeripheralsUSB Certification Report for the AT91SAM9R64 Rev G76487A–ATARM–30-Jul-09Application NoteRevision History Doc. RevComments Change Request Ref.6487A First issueHeadquarters InternationalAtmel Corporation 2325 Orchard Parkway San Jose, CA 95131 USATel: 1(408) 441-0311 Fax: 1(408) 487-2600Atmel AsiaUnit 1-5 & 16, 19/FBEA Tower, Millennium City 5418 Kwun Tong RoadKwun Tong, KowloonHong KongTel: (852) 2245-6100Fax: (852) 2722-1369Atmel EuropeLe Krebs8, Rue Jean-Pierre TimbaudBP 30978054 Saint-Quentin-en-Yvelines CedexFranceTel: (33) 1-30-60-70-00Fax: (33) 1-30-60-71-11Atmel Japan9F, Tonetsu Shinkawa Bldg.1-24-8 ShinkawaChuo-ku, Tokyo 104-0033JapanTel: (81) 3-3523-3551Fax: (81) 3-3523-7581Product ContactWeb Site/AT91SAMTechnical SupportAT91SAM SupportAtmel techincal supportSales Contacts/contacts/Literature Requests/literatureDisclaimer: The information in this document is provided in connection with Atmel products. No license, express or implied, by estoppel or otherwise,to any intellectual property right is granted by this document or in connection with the sale of Atmel products. EXCEPT AS SET FORTH IN ATMEL’S TERMS AND CONDI-TIONS OF SALE LOCATED ON ATMEL’S WEB SITE, ATMEL ASSUMES NO LIABILITY WHATSOEVER AND DISCLAIMS ANY EXPRESS, IMPLIED OR STATUTORY WARRANTY RELATING TO ITS PRODUCTS INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE, SPECIAL OR INCIDEN-TAL DAMAGES (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF PROFITS, BUSINESS INTERRUPTION, OR LOSS OF INFORMATION) ARISING OUT OF THE USE OR INABILITY TO USE THIS DOCUMENT, EVEN IF ATMEL HAS BEEN ADVISED OF THE P OSSIBILITY OF SUCH DAMAGES. Atmel makes no representations or warranties with respect to the accuracy or completeness of the contents of this document and reserves the right to make changes to specifications and product descriptions at any time without notice. Atmel does not make any commitment to update the information contained herein. Unless specifically provided otherwise, Atmel products are not suitable for, and shall not be used in, automotive applications. Atmel’s products are not intended, authorized, or warranted for use as components in applications intended to support or sustain life.© 2009 Atmel Corporation. All rights reserved. Atmel®, Atmel logo and combinations thereof, and others are registered trademarks or trade-marks of Atmel Corporation or its subsidiaries. Other terms and product names may be trademarks of others.6487A–ATARM–30-Jul-09。
at91-看门狗驱动修改指南详解

附录一、驱动程序:at91sam9g20核心板的看门狗驱动看门狗的驱动一般来说比较简单,只要做寄存器的设置实现开启、关闭、喂狗功能。
本项目中我们使用的是at91sam920处理器,带有看门狗定时器。
这个看门狗的驱动却比较复杂,应用层想用它的话,将涉及到boot引导设置,uboot配置及驱动,改写驱动程序。
下面将逐步说明。
1、boot引导(bootstrap-v1.15)由于该看门狗的MR寄存器只能写一次(Only a processor reset resets it.),而默认情况下看门狗在boot引导程序中被关闭了,所以在boot引导程序中我们要开启看门狗。
在board/at91sam9g20ek/at91sam9g20ek.c文件的硬件初始化函数hw_init中注释掉下面的配置即可开启看门狗:/* writel(AT91C_WDTC_WDDIS, AT91C_BASE_WDTC + WDTC_WDMR); */为了功能设置:我们配置如下:writel(AT91C_WDTC_WDV | AT91C_WDTC_WDD | AT91C_WDTC_WDRSTEN | AT91C_WDTC_WDFIEN, AT91C_BASE_WDTC + WDTC_WDMR);2、uboot配置及驱动(uboot-v1.3.4):默认情况下,看门狗在uboot中没有配置,需要手动添加配置,在文件include/configs/at91sam9g20ek.h中添加如下配置#define CONFIG_HW_WA TCHDOG 1#define CONFIG_AT91SAM9_WA TCHDOG 1此时编译uboot,会提示你找不到hw_watchdog_reset复位函数,这是因为虽然我们配置看门狗,但看门狗的uboot驱动并不存在,下面就来添加uboot下的看门狗驱动。
1)添加include/asm-arm/arch-at91sam9/at91_wdt.h,内容如下/** [origin: Linux kernel arch/arm/mach-at91/include/mach/at91_wdt.h]** Copyright (C) 2008 Jean-Christophe PLAGNIOL-VILLARD <plagnioj at >* Copyright (C) 2007 Andrew Victor* Copyright (C) 2007 Atmel Corporation.** Watchdog Timer (WDT) - System peripherals regsters.* Based on AT91SAM9261 datasheet revision D.** This program is free software; you can redistribute it and/or modify* it under the terms of the GNU General Public License as published by* the Free Software Foundation; either version 2 of the License, or* (at your option) any later version.*/#ifndef AT91_WDT_H#define AT91_WDT_H#define AT91_WDT_CR (AT91_WDT + 0x00) /* Watchdog Control Register */ #define AT91_WDT_WDRSTT (1<<0) /* Restart */#define AT91_WDT_KEY (0xa5 << 24) /* KEY Password */#define AT91_WDT_MR (AT91_WDT + 0x04) /* Watchdog Mode Register */ #define AT91_WDT_WDV (0xfff << 0) /* Counter Value */#define AT91_WDT_WDFIEN (1 << 12) /* Fault Interrupt Enable */#define AT91_WDT_WDRSTEN (1 << 13) /* Reset Processor */#define AT91_WDT_WDRPROC (1 << 14) /* Timer Restart */#define AT91_WDT_WDDIS (1<< 15) /* Watchdog Disable */#define AT91_WDT_WDD (0xfff << 16) /* Delta Value */#define AT91_WDT_WDDBGHLT (1 << 28) /* Debug Halt */#define AT91_WDT_WDIDLEHLT (1 << 29) /* Idle Halt */#define AT91_WDT_SR (AT91_WDT + 0x08) /* Watchdog Status Register */#define AT91_WDT_WDUNF (1 << 0) /* Watchdog Underflow */#define AT91_WDT_WDERR (1 << 1) /* Watchdog Error */#endif2)添加drivers/watchdog/at91sam9_wdt.c,内容如下/** [origin: Linux kernel drivers/watchdog/at91sam9_wdt.c]** Watchdog driver for Atmel AT91SAM9x processors.** Copyright (C) 2008 Jean-Christophe PLAGNIOL-VILLARD <plagnioj at > * Copyright (C) 2008 Renaud CERRATO r.cerrato at til-technologies.fr** This program is free software; you can redistribute it and/or* modify it under the terms of the GNU General Public License* as published by the Free Software Foundation; either version* 2 of the License, or (at your option) any later version.*//** The Watchdog Timer Mode Register can be only written to once. If the * timeout need to be set from U-Boot, be sure that the bootstrap doesn't * write to this register. Inform Linux to it too*/#include <common.h>#include <watchdog.h>#include <asm/arch/hardware.h>#include <asm/arch/io.h>#include <asm/arch/at91_wdt.h>//#include <asm-arm/arch-at91sam9/at91_wdt.h>#define ms_to_ticks(t) (((t << 8) / 1000) - 1)#define ticks_to_ms(t) (((t + 1) * 1000) >> 8)/* Hardware timeout in seconds */#define WDT_HW_TIMEOUT 2/** Set the watchdog time interval in 1/256Hz (write-once)* Counter is 12 bit.*/static int at91_wdt_settimeout(unsigned int timeout){unsigned int reg;unsigned int mr;/* Check if disabled */mr = at91_sys_read(AT91_WDT_MR);if (mr & AT91_WDT_WDDIS){printf("sorry, watchdog is disabled/n");return -1;}/** All counting occurs at SLOW_CLOCK / 128 = 256 Hz** Since WDV is a 12-bit counter, the maximum period is* 4096 / 256 = 16 seconds.*/reg = AT91_WDT_WDRSTEN /* causes watchdog reset *//* | AT91_WDT_WDRPROC causes processor reset only */| AT91_WDT_WDDBGHLT /* disabled in debug mode */| AT91_WDT_WDD /* restart at any time */| (timeout & AT91_WDT_WDV); /* timer value */at91_sys_write(AT91_WDT_MR, reg);return 0;}void hw_watchdog_reset(void){at91_sys_write(AT91_WDT_CR,A T91_WDT_KEY | AT91_WDT_WDRSTT); }void hw_watchdog_init(void){/* 16 seconds timer, resets enabled */at91_wdt_settimeout(ms_to_ticks(WDT_HW_TIMEOUT * 1000));}3)添加drivers/watchdog/Makefile## (C) Copyright 2008# Wolfgang Denk, DENX Software Engineering, wd at denx.de.## See file CREDITS for list of people who contributed to this# project.## This program is free software; you can redistribute it and/or# modify it under the terms of the GNU General Public License as# published by the Free Software Foundation; either version 2 of# the License, or (at your option) any later version.## This program is distributed in the hope that it will be useful,# but WITHOUT ANY W ARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details.## You should have received a copy of the GNU General Public License# along with this program; if not, write to the Free Software# Foundation, Inc., 59 Temple Place, Suite 330, Boston,# MA 02111-1307 USA#include $(TOPDIR)/config.mkLIB := $(obj)libwatchdog.aCOBJS-$(CONFIG_AT91SAM9_WATCHDOG) += at91sam9_wdt.oCOBJS := $(COBJS-y)SRCS := $(COBJS:.o=.c)OBJS := $(addprefix $(obj),$(COBJS))all: $(LIB)$(LIB): $(obj).depend $(OBJS)$(AR) $(ARFLAGS) $@ $(OBJS)######################################################################### # defines $(obj).depend targetinclude $(SRCTREE)/rules.mksinclude $(obj).depend######################################################################### 4)修改uboot的Makefile,主要是把watchdog编辑到工程里修改1:LIBS += drivers/video/libvideo.a+LIBS += drivers/watchdog/libwatchdog.a(添加)LIBS += common/libcommon.a修改2:TAG_SUBDIRS += drivers/usbTAG_SUBDIRS += drivers/video+TAG_SUBDIRS += drivers/watchdog (添加)5)另外,为了在其它地方调用WA TCHDOG_RESET函数,可以将watchdog.h添加包含到include/common.h文件中:#if defined (CONFIG_HW_WATCHDOG)#include <watchdog.h>#endif6)修改串口驱动drivers/serial/atmel_usart.c,主要是在串口读的时候复位看门狗,防止系统重启int serial_getc(void){- while (!(usart3_readl(CSR) & USART3_BIT(RXRDY))) ; (删除)+ while (!(usart3_readl(CSR) & USART3_BIT(RXRDY))) (添加)+ WATCHDOG_RESET(); (添加)return usart3_readl(RHR);}3、改写驱动程序(linux2.6.30内核)1、配置内核在默认情况,系统并不加载看门狗驱动,需要配置内核:make menuconfigDevice drivers-->Watchdog Timer Support-->AT91SAM9X / A T91CAP9 watchdog 然后编译,重新烧写uImage文件到板子上。
AT91SAM9260数据手册

AT91SAM9260数据手册1、描述AT91SAM9260是以ARM926EJ-S处理器为核心的片上系统,它扩展了快速ROM、RAM 以及大量的外设。
AT91SAM9260集成了以太网的MAC、一个USB设备端口、一个USB主机控制器。
此外,它还集成了几种标准的外设,如USART、SPI、TWI、TimerCounter、同步串行控制器、ADC和多媒体卡接口。
AT91SAM9260采用了6层总线矩阵构架,大大增强了6条32位总线的内部带宽。
同时它的外部总线接口能支持大量的存储设备。
2、方框图该方框图显示了217脚LFBGA封装的所有特征,有些功能在208脚PQFP封装里面是没有的。
3、信号描述4、封装与引脚排列5、电源事宜5.1 电源AT91SAM9260有如下几种类型的电源管脚:●VDDCORE 管脚:内核电源,包括处理器、内嵌存储器和外设,电压范围从1.65~1.95,额定电压为1.8V●VDDIOM 管脚:外部总线接口I/O口电源;电压范围从1.65V~1.95V(1.8V);或3.0~3.6(3.3),具体的电压范围可有软件确定●VDDIOP0 管脚:外设I/O口线和USB收发器电压;电压范围3.0~3.6(3.0/3.3)●VDDIOP1 管脚:外设I/O口线,包括图像传感器接口;电压范围1.65~3.6(1.8/2.5/3/3.3)●VDDBU 管脚:慢速时钟振荡器和部分系统控制器电源;电压范围 1.65V~1.95V(1.8V)●VDDPLL 管脚:主时钟和锁相环部件电源;电压范围1.65~1.95(1.8)●VDDANA 管脚:模数转换器供应电源;电压范围3.0~3.6(3.3)VDDIOM、VDDIOP0、VDDIOP1,这些电源使得用户能对存储器接口和外设接口设备分配不同的电源。
接地引脚GND是VDDCORE、VDDIOM、VDDIOP0、VDDIOP1引脚电源的公共端。
VDDBU、VDDPLL、VDDANA采用各自相应的接地管脚:GNDBU、GNDPLL、GNDANA。
广播电视预警信息显示屏原理分析及维修(电子报)剖析

广播电视预警信息电子显示屏原理分析及维修泸州广播电视发射台李良富(发表于:成都电子报2011年1月2日第1期)摘要:建设广播电视安全播出预警信息发布系统,构筑了覆盖全国的安全播出预警、调度指挥网络,为安全播出提供有力的技术支持。
本文对预警信息发布系统中使用的广播电视预警信息电子显示屏原理进行分析,以便于使用中的维护工作。
关键词:预警信息发布系统 LED显示屏近年来,面对高科技条件下日益严峻的安全播出形势,各级广播电视部门通过加大投入、健全体制、建立制度、完善技术,使得安全播出水平显著提高,进一步完善了广播电视安全播出技术防范体系。
初步形成了反应快捷、指挥有力、调度灵活、令行禁止的覆盖全国的安全播出调度指挥和管理机制。
特别是完善了广播电视安全播出预警信息发布系统,构筑了覆盖全国的安全播出预警、调度指挥网络,为安全播出提供有力的技术支持。
泸州广播电视发射台台作为泸州地区的主要发射台站,承担了中央、省、地方台的广播电视节目无线发射任务,电子预警屏的安装并投入使用为我台及时启动广播电视安全播出应急预案提供了技术保障。
本文将对广播电视预警信息电子显示屏原理进行分析,以便于使用中的维护工作。
一、系统基本原理GSM(Global System for Mobile communication)系统是目前基于时分多址技术的移动通讯体制中比较成熟、完善、应用最广泛的一种系统。
目前已建成的覆盖全国的GSM数字蜂窝移动通信网是我国公众通信的主要方式。
短信息服务是基于GSM移动网络传送简短信息的无线应用。
GSM的短信息业务(SMS,Short Messaging Service)利用信令信道传输,它不用拨号建立连接,只需把要发的信息加上目的地址发送到短信息服务中心,经短信服务中心完成存储后再发送给最- 1 -终的信宿。
所以当目的GSM终端没开机时信息也不会丢失,每个短信的信息量限制为160字节。
广播电视预警发布系统是全国广电系统通过GSM手机短信息业务(SMS)通讯方式进行广播发布的预警信息发布系统。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
附录一、驱动程序:at91sam9g20核心板的看门狗驱动看门狗的驱动一般来说比较简单,只要做寄存器的设置实现开启、关闭、喂狗功能。
本项目中我们使用的是at91sam920处理器,带有看门狗定时器。
这个看门狗的驱动却比较复杂,应用层想用它的话,将涉及到boot引导设置,uboot配置及驱动,改写驱动程序。
下面将逐步说明。
1、boot引导(bootstrap-v1.15)由于该看门狗的MR寄存器只能写一次(Only a processor reset resets it.),而默认情况下看门狗在boot引导程序中被关闭了,所以在boot引导程序中我们要开启看门狗。
在board/at91sam9g20ek/at91sam9g20ek.c文件的硬件初始化函数hw_init中注释掉下面的配置即可开启看门狗:/* writel(AT91C_WDTC_WDDIS, AT91C_BASE_WDTC + WDTC_WDMR); */为了功能设置:我们配置如下:writel(AT91C_WDTC_WDV | AT91C_WDTC_WDD | AT91C_WDTC_WDRSTEN | AT91C_WDTC_WDFIEN, AT91C_BASE_WDTC + WDTC_WDMR);2、uboot配置及驱动(uboot-v1.3.4):默认情况下,看门狗在uboot中没有配置,需要手动添加配置,在文件include/configs/at91sam9g20ek.h中添加如下配置#define CONFIG_HW_WA TCHDOG 1#define CONFIG_AT91SAM9_WA TCHDOG 1此时编译uboot,会提示你找不到hw_watchdog_reset复位函数,这是因为虽然我们配置看门狗,但看门狗的uboot驱动并不存在,下面就来添加uboot下的看门狗驱动。
1)添加include/asm-arm/arch-at91sam9/at91_wdt.h,内容如下/** [origin: Linux kernel arch/arm/mach-at91/include/mach/at91_wdt.h]** Copyright (C) 2008 Jean-Christophe PLAGNIOL-VILLARD <plagnioj at >* Copyright (C) 2007 Andrew Victor* Copyright (C) 2007 Atmel Corporation.** Watchdog Timer (WDT) - System peripherals regsters.* Based on AT91SAM9261 datasheet revision D.** This program is free software; you can redistribute it and/or modify* it under the terms of the GNU General Public License as published by* the Free Software Foundation; either version 2 of the License, or* (at your option) any later version.*/#ifndef AT91_WDT_H#define AT91_WDT_H#define AT91_WDT_CR (AT91_WDT + 0x00) /* Watchdog Control Register */ #define AT91_WDT_WDRSTT (1<<0) /* Restart */#define AT91_WDT_KEY (0xa5 << 24) /* KEY Password */#define AT91_WDT_MR (AT91_WDT + 0x04) /* Watchdog Mode Register */ #define AT91_WDT_WDV (0xfff << 0) /* Counter Value */#define AT91_WDT_WDFIEN (1 << 12) /* Fault Interrupt Enable */#define AT91_WDT_WDRSTEN (1 << 13) /* Reset Processor */#define AT91_WDT_WDRPROC (1 << 14) /* Timer Restart */#define AT91_WDT_WDDIS (1<< 15) /* Watchdog Disable */#define AT91_WDT_WDD (0xfff << 16) /* Delta Value */#define AT91_WDT_WDDBGHLT (1 << 28) /* Debug Halt */#define AT91_WDT_WDIDLEHLT (1 << 29) /* Idle Halt */#define AT91_WDT_SR (AT91_WDT + 0x08) /* Watchdog Status Register */#define AT91_WDT_WDUNF (1 << 0) /* Watchdog Underflow */#define AT91_WDT_WDERR (1 << 1) /* Watchdog Error */#endif2)添加drivers/watchdog/at91sam9_wdt.c,内容如下/** [origin: Linux kernel drivers/watchdog/at91sam9_wdt.c]** Watchdog driver for Atmel AT91SAM9x processors.** Copyright (C) 2008 Jean-Christophe PLAGNIOL-VILLARD <plagnioj at > * Copyright (C) 2008 Renaud CERRATO r.cerrato at til-technologies.fr** This program is free software; you can redistribute it and/or* modify it under the terms of the GNU General Public License* as published by the Free Software Foundation; either version* 2 of the License, or (at your option) any later version.*//** The Watchdog Timer Mode Register can be only written to once. If the * timeout need to be set from U-Boot, be sure that the bootstrap doesn't * write to this register. Inform Linux to it too*/#include <common.h>#include <watchdog.h>#include <asm/arch/hardware.h>#include <asm/arch/io.h>#include <asm/arch/at91_wdt.h>//#include <asm-arm/arch-at91sam9/at91_wdt.h>#define ms_to_ticks(t) (((t << 8) / 1000) - 1)#define ticks_to_ms(t) (((t + 1) * 1000) >> 8)/* Hardware timeout in seconds */#define WDT_HW_TIMEOUT 2/** Set the watchdog time interval in 1/256Hz (write-once)* Counter is 12 bit.*/static int at91_wdt_settimeout(unsigned int timeout){unsigned int reg;unsigned int mr;/* Check if disabled */mr = at91_sys_read(AT91_WDT_MR);if (mr & AT91_WDT_WDDIS){printf("sorry, watchdog is disabled/n");return -1;}/** All counting occurs at SLOW_CLOCK / 128 = 256 Hz** Since WDV is a 12-bit counter, the maximum period is* 4096 / 256 = 16 seconds.*/reg = AT91_WDT_WDRSTEN /* causes watchdog reset *//* | AT91_WDT_WDRPROC causes processor reset only */| AT91_WDT_WDDBGHLT /* disabled in debug mode */| AT91_WDT_WDD /* restart at any time */| (timeout & AT91_WDT_WDV); /* timer value */at91_sys_write(AT91_WDT_MR, reg);return 0;}void hw_watchdog_reset(void){at91_sys_write(AT91_WDT_CR,A T91_WDT_KEY | AT91_WDT_WDRSTT); }void hw_watchdog_init(void){/* 16 seconds timer, resets enabled */at91_wdt_settimeout(ms_to_ticks(WDT_HW_TIMEOUT * 1000));}3)添加drivers/watchdog/Makefile## (C) Copyright 2008# Wolfgang Denk, DENX Software Engineering, wd at denx.de.## See file CREDITS for list of people who contributed to this# project.## This program is free software; you can redistribute it and/or# modify it under the terms of the GNU General Public License as# published by the Free Software Foundation; either version 2 of# the License, or (at your option) any later version.## This program is distributed in the hope that it will be useful,# but WITHOUT ANY W ARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details.## You should have received a copy of the GNU General Public License# along with this program; if not, write to the Free Software# Foundation, Inc., 59 Temple Place, Suite 330, Boston,# MA 02111-1307 USA#include $(TOPDIR)/config.mkLIB := $(obj)libwatchdog.aCOBJS-$(CONFIG_AT91SAM9_WATCHDOG) += at91sam9_wdt.oCOBJS := $(COBJS-y)SRCS := $(COBJS:.o=.c)OBJS := $(addprefix $(obj),$(COBJS))all: $(LIB)$(LIB): $(obj).depend $(OBJS)$(AR) $(ARFLAGS) $@ $(OBJS)######################################################################### # defines $(obj).depend targetinclude $(SRCTREE)/rules.mksinclude $(obj).depend######################################################################### 4)修改uboot的Makefile,主要是把watchdog编辑到工程里修改1:LIBS += drivers/video/libvideo.a+LIBS += drivers/watchdog/libwatchdog.a(添加)LIBS += common/libcommon.a修改2:TAG_SUBDIRS += drivers/usbTAG_SUBDIRS += drivers/video+TAG_SUBDIRS += drivers/watchdog (添加)5)另外,为了在其它地方调用WA TCHDOG_RESET函数,可以将watchdog.h添加包含到include/common.h文件中:#if defined (CONFIG_HW_WATCHDOG)#include <watchdog.h>#endif6)修改串口驱动drivers/serial/atmel_usart.c,主要是在串口读的时候复位看门狗,防止系统重启int serial_getc(void){- while (!(usart3_readl(CSR) & USART3_BIT(RXRDY))) ; (删除)+ while (!(usart3_readl(CSR) & USART3_BIT(RXRDY))) (添加)+ WATCHDOG_RESET(); (添加)return usart3_readl(RHR);}3、改写驱动程序(linux2.6.30内核)1、配置内核在默认情况,系统并不加载看门狗驱动,需要配置内核:make menuconfigDevice drivers-->Watchdog Timer Support-->AT91SAM9X / A T91CAP9 watchdog 然后编译,重新烧写uImage文件到板子上。