Attachment 'ej_system.c'

Download

   1 #include <pic/p16f877a.h>
   2 #include <system.h>
   3 #include <pinio.h>
   4 int main(void)
   5  {
   6    unsigned char dato=0xF0;
   7    unsigned char res;
   8    //Port B comme sortie
   9    ASM("BANKSEL TRISB");
  10    ASM("MOVLW 0x00");
  11    ASM("MOVWF TRISB");
  12    //0xF0 --> PORTB
  13    ASM("BANKSEL F_REG");// la donnée se trouve dans la banque de F_REG
  14    ASM("MOVF %0,W"::"r" (dato));
  15    ASM("BANKSEL PORTB");
  16    ASM("MOVWF PORTB");
  17    //PORTB --> res
  18    ASM("BANKSEL PORTB");
  19    ASM("MOVF PORTB,W");
  20    ASM("BANKSEL F_REG");//res se trouve en la banque de F_REG
  21    ASM("MOVWF %0":"=v" (res));
  22    //Quand tu finis d'écrire en assembleur
  23    // tu dois toujours le quitter dans la banque de F_REG,
  24    //dans le cas contraire le programme ne fonctionnera pas..
  25    //Je mets le micro en sommeil
  26    sleep();
  27    return 0;
  28  }

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.