#include "C:\Demo\PIC16F723_Board\16F72_Ctl.h"
#include <stdio.h>
#include <stdlib.h>
#ZERO_RAM
#include "16F73Ctl_sub.c"
#include "KeyCheck.c"
//===========================================================
#ZERO_RAM
#int_RTCC
void RTCC_isr(void)
{
TMR0 = (256-239); // 1mSec(4MHz OSC) Timer interrupt
mSec1Flag = 1;
}
#int_AD
void AD_isr(void)
{
}
#int_TBE
void TBE_isr(void)
{
}
#int_RDA
void RDA_isr(void)
{
}
#int_TIMER1
void TIMER1_isr(void)
{
}
#int_TIMER2
void TIMER2_isr(void)
{
}
//===========================================================
void main()
{
PORTA = 0x00;
set_tris_a(0x11);
PORTB = 0xFF;
set_tris_b(0xFF); // PortB = all input
PORTC = 0;
set_tris_c(0x0); // PORTC.7(Rx) = input, Other = All Output
//setup_adc_ports(AN0_AN1_AN3);
setup_adc(ADC_OFF);
//setup_spi(SPI_SS_DISABLED);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_4);
setup_timer_1(T1_INTERNAL|T1_DIV_BY_8);
setup_timer_2(T2_DIV_BY_16,0,1);
enable_interrupts(INT_RTCC);
//enable_interrupts(INT_AD);
//enable_interrupts(INT_TBE);
//enable_interrupts(INT_RDA);
//enable_interrupts(INT_TIMER1);
//enable_interrupts(INT_TIMER2);
enable_interrupts(GLOBAL);
while(true){
if(mSec1Flag){
mSec1Flag = 0;
if(BuzFlag) BuzTimeCtl();
if(BuzOnFlag) BuzOut =1;
else BuzOut = 0;
InputPinCheck();
//KeyScan_Metrix(); //
KeyScan(); // Key check
//Segment_disp();
}
//if(DispData) BuzOut =1;
//else BuzOut =0;
if(PressSignal) TestPin = ~TestPin;
}
}
Hrader file : 16F723_ctl.h
'PIC Microcontroller' 카테고리의 다른 글
PIC12F675 기본 프로그램 (0) | 2011.05.31 |
---|---|
MPLAB IDE ( Target 보드 구성시 주의 사항 ) (0) | 2010.08.12 |
PIC16F887 Basic Source Program (0) | 2010.06.14 |
Tilt Sensor (ADXL203, 2-Axis, AnalogDivices社) Example Program (0) | 2010.05.26 |
Summary of CCS C compiler Access to PIC internal peripherals (0) | 2010.05.14 |