1 | $regfile = "m8def.dat"
|
2 | $crystal = 1000000
|
3 |
|
4 | ' *****************************************************
|
5 | $include "font8x8.font"
|
6 | $include "font16x16.font"
|
7 | $lib "glcdSED1520.lbx"
|
8 | Config Graphlcd = 120 * 64sed , Dataport = Portd , Controlport = Portc , Ce = 4 , Ce2 = 5 , Cd = 2 , Rd = 3
|
9 | 'The dataport is the portname that is connected to the data lines of the
|
10 | 'LCD
|
11 | 'The controlport is the portname which pins are used to control the lcd
|
12 | 'CE =CS Chip Enable/ Chip select 'CE2= Chip select / chip enable of chip 2
|
13 | 'CD=A0 Data direction 'RD=Read
|
14 | ' *****************************************************
|
15 | Glcdcmd &H3E , 1 : Glcdcmd &H3E , 2 ' both displays off
|
16 | Cls
|
17 | Waitms 10
|
18 | Glcdcmd &H3F , 1 : Glcdcmd &H3F , 2 'both on
|
19 | '------------------------------------------------------------------
|
20 | ' Arbeitsschleife
|
21 | Dim Sec_s As String * 2 , Min_s As String * 2 , Std_s As String * 2
|
22 | Dim Z1 As Byte , Puls As Byte
|
23 | Config Clock = Soft , Gosub = Sectic
|
24 | Do
|
25 |
|
26 | Sec_s = Str(_sec)
|
27 | Sec_s = Format(sec_s , "00")
|
28 | Min_s = Str(_min)
|
29 | Min_s = Format(min_s , "00")
|
30 | Std_s = Str(_hour)
|
31 | Std_s = Format(std_s , "00")
|
32 | Portb.0 = Puls
|
33 | If Z1 < 10 Then
|
34 | Setfont Font16x16
|
35 | Lcdat 1 , 1 , " " ; Std_s ; ":" ; Min_s ; " " , 0
|
36 | Setfont Font8x8
|
37 | Lcdat 2 , 98 , ":" ; Sec_s , 0
|
38 | Lcdat 3 , 1 , " AVR-Praxis.de "
|
39 | Lcdat 4 , 1 , " " ; Date$ ; " " , 0
|
40 | Else
|
41 | Setfont Font16x16
|
42 | Lcdat 1 , 1 , "A V R - " , 0
|
43 | Lcdat 3 , 1 , "Praxis " , 0
|
44 | Wait 3
|
45 | End If
|
46 |
|
47 | Loop
|
48 |
|
49 | End 'end program
|
50 | ' ------------------------------------------------------------------
|
51 | Sectic:
|
52 | Toggle Puls
|
53 | If Z1 < 10 Then
|
54 | Incr Z1
|
55 | Else
|
56 | Z1 = 0
|
57 | End If
|
58 | Return
|