Electronic Components Datasheet Search
  English  ▼
ALLDATASHEET.NET

X  

AN3260 Datasheet(PDF) 14 Page - STMicroelectronics

Part # AN3260
Description  Building a thermometer using the STM8S-DISCOVERY
PDF  24 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  STMICROELECTRONICS [STMicroelectronics]
Direct Link  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

AN3260 Datasheet(HTML) 14 Page - STMicroelectronics

Back Button AN3260 Datasheet HTML 10Page - STMicroelectronics AN3260 Datasheet HTML 11Page - STMicroelectronics AN3260 Datasheet HTML 12Page - STMicroelectronics AN3260 Datasheet HTML 13Page - STMicroelectronics AN3260 Datasheet HTML 14Page - STMicroelectronics AN3260 Datasheet HTML 15Page - STMicroelectronics AN3260 Datasheet HTML 16Page - STMicroelectronics AN3260 Datasheet HTML 17Page - STMicroelectronics AN3260 Datasheet HTML 18Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 14 / 24 page
background image
Software description
AN3260
14/24
Doc ID 17836 Rev 1
4.3.2
Interrupt function flowcharts
Pushbutton acquisition
Each time Button1 or Button2 is pressed, an interrupt is triggered and the
PORTA_IRQhandler() function is called. The PORTA_IRQhandler() routine identifies which
pushbutton has been pressed by testing port A input register and asserts the
ButtonPressed1 or ButtonPressed2 flag accordingly (see Section 4.3.3: State machine
flowchart). These flags trigger a change of state in the application state machine
Figure 5 shows the flowchart of the PORTA_IRQhandler() function.
Figure 5.
PORTA_IRQhandler() function flowchart
Timer-triggered acquisition
TIMER3 is configured to generate an interrupt every 50 ms to trigger temperature
acquisitions.
After each conversion of ADC1 channel 2, the digital value is stored in the buffer array for
further computations and ADC1 is powered down. A maximum of 16 samples are saved in
the buffer array. This allows dividing by a power of two by performing a simple right shift,
when calculating the average temperature over one-second period.
TIM3_IRQHandler() calls the TRtc_CntUpdate() function which simulate a real time clock. It
sets the flags representing seconds, minutes, and hours. This RTC routine is based on TIM3
50 ms timebase. Every second, the state machine automatically switches to state 3 (normal
mode) (see Section 4.3.3: State machine flowchart).
Figure 6 shows the flowchart of the TIM3_IRQhandler() function.
฀
฀฀
฀฀
฀฀฀฀
฀
฀
฀฀฀฀



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


Datasheet Download

Go To PDF Page


Link URL



Does ALLDATASHEET help your business so far?  [ DONATE ] 

About Alldatasheet   |   Advertisement   |   Contact us   |   Privacy Policy   |   Link to Datasheet    |   Link Exchange   |   Manufacturer List
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