Advertisement
RuiViana

Teste PIC18F4550

Dec 29th, 2015
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. #include <18F4550.h>
  2. #fuses XTPLL,PLL1,CPUDIV1,PUT,NOBROWNOUT,NOVREGEN,NOWDT,NOPBADEN,MCLR,NOLVP,NODEBUG,NOPROTECT,NOCPD,USBDIV
  3. #use delay(clock=48000000)
  4.  
  5. #byte porta=0xF80 // Dirección de los puertos A, B, C, D y E.
  6. #byte portb=0xF81
  7. #byte portc=0xF82
  8. #byte portd=0xF83
  9. #byte porte=0xF84
  10.  
  11. void main() //Programa principal.
  12. {
  13. set_tris_d(0b00000000); // RD on LEDs.
  14. while(true); // Bucle infinito.
  15. {
  16. portd=0XFF; // Acende todos LEDs portD
  17. delay_ms(2000); // delay 2 secs
  18. portd=0; // Apaga todos LEDs portD
  19. delay_ms(2000); // delay 2 secs
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement