PIC Microcontroller

PIC12F508 Source file

EP 기술연구소 2011. 7. 7. 22:54

 

1. Device : PIC12F508

2. Compiler : CCS-C

3. Down Loader : MPLAB IDE & PICKIT2

4. Source file

 

#include "C:\KnifeSterilizer\KnifeCtl.h"
#include <stdio.h>
#ZERO_RAM

#include "KeyCheck.c" // Key Scan Routine

//==============================================================================
void main()
{
 GPIO = 0x20;
 set_tris_b(0x18);  // 1=input, 0=output

 setup_timer_0(RTCC_INTERNAL|RTCC_DIV_8);

 while(1){
  if(TMR0 == 0x80){
   // 1mSec Timer counter Interrupt Routine
   TMR0 = 0;
   if(++mSec250Counter >= 250){
    TestPin = ~TestPin;
    // 250mSec Timer counter Interrupt Routine
    mSec250Counter = 0;
   }
   // Key Scan Routine
   KeyScan();
  }
  
 }

}