Attachment 'mod_TIMER2.tex'

Download

   1 \section{module timer2}
   2 Voici les fonctions pour travailler avec le TIMER2 des PIC16F87X.
   3 \subsection{timer2\_init}
   4 Initialise le timer2.
   5 
   6 void timer2\_init(void);
   7 
   8 Met à  0 le compteur du timer2 et efface le drapeau (flag) des interruptions. Le compteur s'incrémente à chaque cycle d'instructions (Freq.Osc. / 4) si on n'utilise pas le pré-diviseur (prescaler).
   9 \subsection{timer2\_set\_period}
  10 Établit la période du timer2.
  11 
  12 void timer2\_set\_period(unsigned char set\_period);
  13 
  14 set\_period Établit la période du timer2, cela doit être une valeur entre 0 et 255.
  15 \subsection{timer2\_set\_prescaler}
  16 Établit la valeur du  prédiviseur (prescaler) du timer2.
  17 
  18 void timer2\_set\_prescaler(unsigned char set\_presc);
  19 
  20 set\_presc Établit la valeur du  prédiviseur (prescaler) 
  21 
  22 Les options possibles sont :
  23 PRESC\_DIV\_1
  24 PRESC\_DIV\_4 // Fréquence du cycle d'instructions (FOSC/4) del PIC / 4
  25 PRESC\_DIV\_16
  26 
  27 \subsection{timer2\_set\_postscaler}
  28 Établit la valeur du post-diviseur (postscaler) del timer2.
  29 
  30 void timer2\_set\_postscaler(unsigned char set\_postsc);
  31 
  32 set\_postsc Établit la valeur du post-diviseur (postscaler) 
  33 
  34 Les options possibles sont : \\
  35      POSTSC\_DIV\_1 \\
  36      POSTSC\_DIV\_2  // TMR2IF à l'état haut chaque 2 débordements de TMR2. \\
  37      POSTSC\_DIV\_3 \\
  38      POSTSC\_DIV\_4 \\
  39      POSTSC\_DIV\_5 \\
  40      POSTSC\_DIV\_6 \\
  41      POSTSC\_DIV\_7 \\
  42      POSTSC\_DIV\_8 \\
  43      POSTSC\_DIV\_9 \\
  44      POSTSC\_DIV\_10 \\
  45      POSTSC\_DIV\_11 \\
  46      POSTSC\_DIV\_12 \\
  47      POSTSC\_DIV\_13 \\
  48      POSTSC\_DIV\_14 \\
  49      POSTSC\_DIV\_15 \\
  50      POSTSC\_DIV\_16 
  51 
  52 La sortie du post-diviseur (postscaler) met à 1 le drapeau (flag) des interruptions du timer2 (TMR2IF).
  53 \subsection{timer2\_write}
  54 Écrit la valeur du registreTMR2. \\
  55 void timer2\_write(unsigned char set\_count); \\
  56 set\_count Écrit la valeur du registreTMR2..
  57 \subsection{timer2\_read}
  58 Lit a valeur du registreTMR2. \\
  59 \#define timer2\_read() TMR2
  60 \subsection{Exemple d'utilisation du timer2}
  61 Pour compiler tu as besoin des commandes suivantes 
  62 
  63 Exemple de compilation  : ./compila.sh ej\_timer2.c 16f877a
  64 
  65 ej\_timer2.c
  66 \verbatiminput{source/ej_timer2.c}

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2009-03-02 23:05:40, 28.2 KB) [[attachment:GtkPicGccAbout.png]]
  • [get | view] (2009-03-27 08:20:28, 1.5 KB) [[attachment:LISEZ_MOI]]
  • [get | view] (2009-03-02 23:02:00, 0.2 KB) [[attachment:baud.h]]
  • [get | view] (2009-03-02 23:02:09, 0.5 KB) [[attachment:clavier.txt]]
  • [get | view] (2009-03-02 23:02:21, 0.4 KB) [[attachment:compila.txt]]
  • [get | view] (2009-03-02 22:47:50, 0.3 KB) [[attachment:dispo.tex]]
  • [get | view] (2009-03-02 23:02:36, 0.7 KB) [[attachment:ej_adc_87Xa.c]]
  • [get | view] (2009-03-02 23:02:46, 1.0 KB) [[attachment:ej_comp_87Xa.c]]
  • [get | view] (2009-03-02 23:02:59, 0.5 KB) [[attachment:ej_delay.c]]
  • [get | view] (2009-03-02 23:03:12, 0.6 KB) [[attachment:ej_eeprom.c]]
  • [get | view] (2009-03-02 23:03:22, 0.0 KB) [[attachment:ej_i2c.c]]
  • [get | view] (2009-03-02 23:03:39, 0.6 KB) [[attachment:ej_intext.c]]
  • [get | view] (2009-03-02 23:03:51, 0.4 KB) [[attachment:ej_keypad4x4.c]]
  • [get | view] (2009-03-02 23:04:00, 0.5 KB) [[attachment:ej_keypad4x4flex.c]]
  • [get | view] (2009-03-02 23:04:09, 0.4 KB) [[attachment:ej_memory.c]]
  • [get | view] (2009-03-02 23:04:17, 0.3 KB) [[attachment:ej_pinio.c]]
  • [get | view] (2009-03-02 23:04:25, 0.2 KB) [[attachment:ej_pwm.c]]
  • [get | view] (2009-03-02 23:04:35, 0.8 KB) [[attachment:ej_system.c]]
  • [get | view] (2009-03-02 23:04:46, 0.9 KB) [[attachment:ej_timer0.c]]
  • [get | view] (2009-03-02 23:04:58, 1.2 KB) [[attachment:ej_timer2.c]]
  • [get | view] (2009-03-02 23:05:08, 0.4 KB) [[attachment:ej_uart.c]]
  • [get | view] (2009-03-02 23:05:26, 0.4 KB) [[attachment:ej_uart2.c]]
  • [get | view] (2009-03-02 22:48:40, 0.7 KB) [[attachment:exemples.tex]]
  • [get | view] (2009-03-02 23:05:53, 0.5 KB) [[attachment:interruption1.c]]
  • [get | view] (2009-03-02 23:06:14, 0.4 KB) [[attachment:interruption2.c]]
  • [get | view] (2009-03-02 22:49:06, 3.9 KB) [[attachment:intro.tex]]
  • [get | view] (2009-03-02 23:33:12, 2.7 KB) [[attachment:keypad.tex]]
  • [get | view] (2009-03-02 22:49:18, 3.3 KB) [[attachment:mod_ADC.tex]]
  • [get | view] (2009-03-02 22:49:54, 3.2 KB) [[attachment:mod_I2C.tex]]
  • [get | view] (2009-03-02 22:50:44, 5.9 KB) [[attachment:mod_IO.tex]]
  • [get | view] (2009-03-02 22:51:18, 1.0 KB) [[attachment:mod_PWM.tex]]
  • [get | view] (2009-03-02 22:51:26, 1.5 KB) [[attachment:mod_RAM.tex]]
  • [get | view] (2009-03-02 22:51:42, 2.7 KB) [[attachment:mod_TIMER0.tex]]
  • [get | view] (2009-03-02 22:51:50, 2.1 KB) [[attachment:mod_TIMER2.tex]]
  • [get | view] (2009-03-02 22:51:59, 1.7 KB) [[attachment:mod_UART.tex]]
  • [get | view] (2009-03-02 22:52:07, 3.9 KB) [[attachment:mod_UART2.tex]]
  • [get | view] (2009-03-02 22:49:28, 3.5 KB) [[attachment:mod_comp.tex]]
  • [get | view] (2009-03-02 22:49:37, 0.6 KB) [[attachment:mod_delay.tex]]
  • [get | view] (2009-03-02 22:49:47, 0.7 KB) [[attachment:mod_eeprom.tex]]
  • [get | view] (2009-03-02 22:50:27, 7.0 KB) [[attachment:mod_int.tex]]
  • [get | view] (2009-03-02 22:51:33, 0.4 KB) [[attachment:mod_system.tex]]
  • [get | view] (2009-03-02 22:52:17, 0.8 KB) [[attachment:pic.tex]]
  • [get | view] (2009-03-02 22:52:26, 0.2 KB) [[attachment:pilote.tex]]
  • [get | view] (2009-03-02 22:52:35, 1.0 KB) [[attachment:presentation.tex]]
  • [get | view] (2009-03-02 23:06:23, 0.2 KB) [[attachment:pwm.txt]]
  • [get | view] (2009-03-02 22:52:44, 1.1 KB) [[attachment:questions.tex]]
  • [get | view] (2009-03-02 22:53:01, 0.7 KB) [[attachment:ref.tex]]
  • [get | view] (2009-03-02 22:53:10, 7.4 KB) [[attachment:standard.tex]]
  • [get | view] (2009-03-02 23:06:34, 4.8 KB) [[attachment:tabla1.3]]
  • [get | view] (2009-03-02 23:06:44, 8.9 KB) [[attachment:tabla1.5]]
  • [get | view] (2009-03-02 22:53:26, 380.4 KB) [[attachment:tutoriel.pdf]]
  • [get | view] (2009-03-27 08:18:11, 309.2 KB) [[attachment:tutoriel.tar.gz]]
  • [get | view] (2009-03-02 22:53:34, 0.7 KB) [[attachment:tutoriel.tex]]
  • [get | view] (2009-03-02 22:53:42, 0.2 KB) [[attachment:util.tex]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.