Attachment 'mod_TIMER0.tex'

Download

   1 \section{module TIMER0}
   2 
   3 Auteur: Santiago Gonzalez
   4 
   5 Courrier: santigoro en gmail.com
   6 
   7 Voici les fonctions pour travailler avec le TIMER0 des PIC16F87X.
   8 
   9 \subsection{timer0\_init}
  10 Initialise TIMER0 avec l'horloge interne (mode timer) ou externe (mode compteur).
  11 
  12 void timer0\_init(unsigned char intern\_extern);
  13 
  14 intern\_extern Établit si on utilise une horloge interne ou une horloge/stímuli externe (modo compteur).\\
  15 TIMER\_INTERN :Utilise l'horloge interne. \\
  16 COUNTER\_EXTERN :Utilise l'horloge/stimuli externe (mode compteur)
  17 
  18 timer0\_init(TIMER\_INTERN);
  19 
  20 Met à 0 le compteur du timer0 y 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.)
  21 \subsection{timer0\_set\_edge}
  22 Indique si l'incrément du compteur se produit sur le front montant ou descendant (mode compteur).
  23 
  24 void timer0\_set\_edge(unsigned char set\_risfal);
  25 
  26 Met à 0 le compteur du timer0 y efface le drapeau (flag) des interruptions Le compteur s'incrémente sur le front montant ou descendant présent sur la broche (pin) RA4 si on n'utilise pas le pré-diviseur (prescaler.)
  27 
  28 set\_risfal Établit si l'incrément du compteur se produit sur le front montant ou descendant
  29 
  30 Les options possibles sont :
  31 
  32   RIS\_EDGE
  33   FAL\_EDGE
  34 
  35 Où RIS\_EDGE indique l'incrément du compteur sur front montant (rising) et FAL\_EDGE sur front descendant (falling).
  36 
  37 timer0\_set\_edge(FAL\_EDGE);
  38 
  39 \subsection{timer0\_set\_prescaler}
  40 Assigne le pré-diviseur (prescaler) du timer0 , ceci annule l'usage du prédiviseur (prescaler) du chien de garde (watchdog) et établit la valeur du pré-diviseur (prescaler.)
  41 
  42 void timer0\_set\_prescaler(unsigned char set\_presc);
  43 
  44 set\_presc Établit la valeur du pré-diviseur (prescaler.)
  45 
  46 Les options possibles sont :
  47 
  48 // Fréquence du cycle d'instructions \\
  49 PRESC\_DIV\_2 // (FOSC/4) del PIC divisé par 2 \\
  50 PRESC\_DIV\_4 // (FOSC/4) del PIC divisé par 4 \\
  51 PRESC\_DIV\_8 \\
  52 PRESC\_DIV\_16 \\
  53 PRESC\_DIV\_32 \\
  54 PRESC\_DIV\_64 \\
  55 PRESC\_DIV\_128 \\
  56 PRESC\_DIV\_256 \\ 
  57 PRESC\_OFF // assigné au chien de garde (watchdog)
  58 
  59 N'importe quelle opération d'écriture dans le registre TMR0 met automatiquement  à 0 le compteur du pré-diviseur (prescaler), bien qu'il garde sa configuration.
  60 \subsection{timer0\_write}
  61 Écrit la valeur du compteur TMR0. \\
  62 void timer0\_write(unsigned char set\_count); \\
  63 set\_count Écrit la valeur du compteur TMR0.
  64 \subsection{timer0\_read}
  65 Lit la valeur du compteur TMR0. \\
  66 \#define timer0\_read() TMR0
  67 \subsection{Exemple module TIMER0}
  68 Pour compiler tu as besoin des commandes suivantes 
  69 
  70 Exemple de compilation : ./compila.sh ej\_timer0.c 16f877a
  71 
  72 ej\_timer0.c
  73 \verbatiminput{source/ej_timer0.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.

Site hébergé sur un Cloud Public IKOULA Ikoula