2007 17 Nov

Just made some tests to see how CCSInfo Compiler works! I’m really impressed! Very simple and easy!

For this test I’ve used Microchip PIC 16F628A working with an external 4MHz resonator and 1 led connected to the RB0 (pin6) - also requires one 1KOhm pull-up resistor to the led and the MCLR resistor to VCC.

Led Blink Test

  1. #include <16F628A.h>
  2. #use delay(clock=4000000)
  3. #fuses NOWDT, HS, PUT, NOPROTECT, BROWNOUT, MCLR, NOLVP, NOCPD
  4. //————————————————————————————————————————————————————————————
  5. void main(void)
  6. {
  7.   delay_ms(100); // power up delay
  8.  
  9.   setup_comparator(NC_NC_NC_NC);
  10.   setup_vref(FALSE);
  11.   set_tris_b(0b11111110);
  12.  
  13.   while( TRUE )
  14.   {
  15.     output_low(PIN_B0);
  16.     delay_ms(500);
  17.     output_high(PIN_B0);
  18.     delay_ms(500);
  19.   }
  20. }
  21. //————————————————————————————————————————————————————————————

Continue reading »

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...