Electronic Components Datasheet Search |
|
AN1530 Datasheet(PDF) 8 Page - STMicroelectronics |
|
AN1530 Datasheet(HTML) 8 Page - STMicroelectronics |
8 / 12 page 8/12 ACCURATE TIMEBASE FOR LOW-COST ST7 APPLICATIONS WITH INTERNAL RC... 3 SOFTWARE EXAMPLE This software example includes all the algorithms. It includes a basic algorithm for finding the fraction and also contains average and glitch algorithms. It has calibration routines for the PWM counter and SCI baud rate. 3.1 MAIN PROGRAM /******************************************************************************** COPYRIGHT 2002 STMicroelectronics Source File Name: main.c Group : IPSW, CMG - IPDF Author : MCD Application Team Date First Issued: 01/07/2002 ********************************Documentation********************************** General Purpose - This routine provides internal RC deviation measurement and calibration of PWM counter and SCI baud rate. ********************************Revision History******************************** Date: 01/07/2002 Release: 1.0 ******************************************************************************/ #include "ST7lib_config.h" /*Configuration File*/ unsigned char cap; unsigned int capture1,capture2; const unsigned char buff1[36]= " SCI CALIBRATION DONE "; /****************************************************************************** MAIN APPLICATION BEGINS ******************************************************************************/ #define TIMERB_PWM_CAL #define SCI_CAL void main (void) { /****************************************************************************** Variable declaration for measuring the capture inputs with averaging and glitch filter algorithm ******************************************************************************/ unsigned char i; unsigned int capture_range; float fraction=0.0; /****************************************************************************** Variable declaration for calibrating PWM w.r.t Internal RC frequency ******************************************************************************/ unsigned int PWM_CNT, PWM_CNT1; /****************************************************************************** Variable declaration to calibrate SCI baudrate w.r.t Internal RC frequency ******************************************************************************/ unsigned char CALTR; float CALTR_TEMP = 0.0; /****************************************************************************** Initialisation of the varibles ******************************************************************************/ cap=capture1=capture2=0; PWM_CNT = 0; PWM_CNT1 = 0; CALTR =0; capture_range = 0; |
Similar Part No. - AN1530 |
|
Similar Description - AN1530 |
|
|
Link URL |
Privacy Policy |
ALLDATASHEET.NET |
Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
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 |