#include <htc.h>
#device adc=8
#FUSES NOWDT //No Watch Dog Timer
#FUSES HS //High speed Osc (> 4mhz for PCM/PCH) (>10mhz for PCD)
#FUSES NOPUT //No Power Up Timer
#FUSES NOPROTECT //Code not protected from reading
#FUSES NODEBUG //No Debug mode for ICD
#FUSES NOBROWNOUT //No brownout reset
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NOCPD //No EE protection
#FUSES NOWRT //Program memory not write protected
#use delay(clock=20000000)
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8)
#include <lcd.c>
int x=0,bpm;
void main()
{
lcd_init();
lcd_gotoxy(1,1);
lcd_putc("start");
lcd_gotoxy(1,2);
lcd_putc("tmr set");
delay_ms(2900);
setup_timer_0( RTCC_EXT_L_TO_H);
set_timer0(0);
delay_ms(5000);
lcd_putc("\f");
lcd_gotoxy(1,1);
lcd_putc("dlay cmpt");
x=get_timer0();
lcd_gotoxy(1,2);
lcd_putc("timer read");
lcd_gotoxy(1,1);
printf(lcd_putc,"val%d",x);
bpm=x*24;
lcd_putc("\f");
printf(lcd_putc,"bpm%d",bpm);
// TODO: USER CODE!!