Subversion Repositories svnkaklik

Rev

Go to most recent revision | Details | Last modification | View Log

Rev Author Line No. Line
6 kaklik 1
#include "D:\KAKLIK\programy\PIC_C\mereni\otmer\16F873\otmer.h"
2
 
3
//Definice portu:                     // Datovy port displeje pripojeny na 4 bity za sebou na jeden port
4
 
5
#define LCD_RS          PIN_B1      // rizeni registru LCD displeje
6
#define LCD_E           PIN_B0      // enable LCD displeje
7
#define LCD_DATA_LSB    PIN_C4      // pripojeni LSB bitu datoveho portu LCD displeje (celkem 4 bity vzestupne za sebou)
8
 
9
#include "LCD.C"
10
 
11
#define DATA   PIN_A1
12
#define CP     PIN_A0
13
#define STROBE PIN_A2
14
 
15
#include "C:\library\kaklik\ccs\shift_reg.c"
16
 
17
void main()
18
{
19
unsigned int16 otacky;
20
 
21
   setup_adc_ports(NO_ANALOGS);
22
   setup_adc(ADC_OFF);
23
   setup_spi(FALSE);
24
   setup_timer_0(RTCC_EXT_H_TO_L|RTCC_DIV_1);
25
   setup_timer_1(T1_EXTERNAL|T1_DIV_BY_2);
26
   setup_timer_2(T2_DISABLED,0,1);
27
   setup_ccp1(CCP_PWM);
28
   setup_ccp2(CCP_OFF);
29
 
30
   lcd_init();
31
 
32
   while (true)
33
   {
34
      set_timer1(0);
35
 
36
      Delay_ms(500);
37
      otacky=get_timer1();
38
      otacky=otacky*40;
39
 
40
      LCD_gotoxy(2,2);
41
      printf(lcd_putc,"otacky:%lu ot/min  ",otacky);
42
   }
43
 
44
}