数据搜索系统,热门电子元器件搜索
  Chinese  ▼
ALLDATASHEETCN.COM

X  

ST9 数据表(PDF) 73 Page - STMicroelectronics

部件名 ST9
功能描述  USER GUIDE
PDF  146 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
制造商  STMICROELECTRONICS [STMicroelectronics]
网页  http://www.st.com
标志 STMICROELECTRONICS - STMicroelectronics

ST9 数据表(HTML) 73 Page - STMicroelectronics

Back Button ST9 Datasheet HTML 69Page - STMicroelectronics ST9 Datasheet HTML 70Page - STMicroelectronics ST9 Datasheet HTML 71Page - STMicroelectronics ST9 Datasheet HTML 72Page - STMicroelectronics ST9 Datasheet HTML 73Page - STMicroelectronics ST9 Datasheet HTML 74Page - STMicroelectronics ST9 Datasheet HTML 75Page - STMicroelectronics ST9 Datasheet HTML 76Page - STMicroelectronics ST9 Datasheet HTML 77Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 73 / 146 page
background image
73/146
ST9 USER GUIDE
/* *********** Configure Watchdog for Periodic Interrupt *************/
void ConfigWDT ( void )
{
SelectPage( WDT_PG )
;/* select Watchdog page */
WDTPR = 0 ;/* 122 us = 366 ticks */
WDTR = 365 ;/* preset is nb ticks-1 (WDTR is the pair WDTLR and WDTHR) */
WDTCR = (WDTm_stsp) ;/* WDT is set to continuous mode, no inputs, no
outputs */
/* Interrupt must be connected to intA0 in the EIVR register */
}
The initialisation routine for INTA0 follows. In this example application, interrupt A0 is the only
"external" interrupt enabled, and it is assigned priority level 2:
/* ***********Initialise Interrupt A0 and Current Level **************/
void ConfigInterrupts ( void )
{
SelectPage( EXINT_PG ) ;
EIVR = (EIm_tlism+(unsigned char)INTA0VECT) ;/* int. A0 is generated
on WDT overflow */
EIPLR = 1 ;/* intr A0 (and that of same group) with high priority */
EIMR = EIm_ia0m ;/* intr A0 alone enabled */
CICR = (Im_gcenm+Im_iamm+Im_ienm)+7 ;
/* current processing level: minimum ; int. enabled, nested mode */
/* This starts also the MFT */
}
4.3.3 Watchdog Application 1: Generating a PWM
This application provides a PWM with a programmable duty cycle. You can use it as an appli-
cation exercise for learning to use the programming and debugging tools since it is very
simple. The only hardware required to watch the effect of the program is a LED in series with
a resistor connected between P4.4 and Vcc (anode towards Vcc). You will find the application
in the Companion software in the WDT/appli1 directory.
The WDT can only provide a delay after which the output may change its state, and an inter-
rupt is triggered. The principle of using the WDT as a rectangular signal generator is to set it
to Continuous mode, to load it with a time value, and let it count down until zero. The control
register is set so that an interrupt is then generated, and the output pin is updated at the same
time. The interrupt service routine will reload with the other value, and preset the WROUT bit
to the complement of the current value, so that the opposite state will be transferred to the



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100  ...More


数据表 下载

Go To PDF Page


链接网址



ALLDATASHEET是否为您带来帮助?  [ DONATE ] 

关于 Alldatasheet   |   广告服务   |   联系我们   |   隐私政策   |   数据表链接    |   链接交换   |   制造商名单
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com