Subversion Repositories svnkaklik

Rev

Details | Last modification | View Log

Rev Author Line No. Line
140 kakl 1
#include ".\camerus.h"
136 kakl 2
 
3
 
4
void main()
5
{
6
   setup_adc_ports(NO_ANALOGS);
7
   setup_adc(ADC_OFF);
8
   setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
9
   setup_timer_1(T1_DISABLED);
10
   setup_timer_2(T2_DISABLED,0,1);
11
 
12
   output_high(PIN_C0);
13
 
14
   i2c_start();      // Reset
15
   i2c_write(0xC0);
16
   i2c_write(0x12);
17
   i2c_write(0x80 | 0x24);
18
   i2c_stop();
19
 
20
   i2c_start();      // BW
21
   i2c_write(0xC0);
22
   i2c_write(0x28);
23
   i2c_write(0b01000001);
24
   i2c_stop();
25
 
26
   i2c_start();      // Contrast
27
   i2c_write(0xC0);
28
   i2c_write(0x05);
29
   i2c_write(0xFF);
30
   i2c_stop();
31
 
32
   i2c_start();      // Brightness
33
   i2c_write(0xC0);
34
   i2c_write(0x06);
35
   i2c_write(0x80);
36
   i2c_stop();
37
 
38
/*
39
   i2c_start();      // Band Filter
40
   i2c_write(0xC0);
41
   i2c_write(0x2D);
42
   i2c_write(0x04 | 0x03);
43
   i2c_stop();
44
 
45
   i2c_start();      // 4-bit, (CLK/4)
46
   i2c_write(0xC0);
47
   i2c_write(0x3E);
48
   i2c_write(0x10 | 0x80);
49
   i2c_stop();
50
*/
51
   i2c_start();      // VSTRT
52
   i2c_write(0xC0);
53
   i2c_write(0x19);
54
   i2c_write(45);
55
   i2c_stop();
56
 
57
   i2c_start();      // VEND
58
   i2c_write(0xC0);
59
   i2c_write(0x1A);
60
   i2c_write(45);
61
   i2c_stop();
62
 
63
   output_low(PIN_C0);
64
 
65
   while(true);
66
}