Depok Instruments

We Present Technologies As Arts

Source Code BASCOM-AVR for RTC DS1307

$regfile = “m8535.dat”
$crystal = 11059200
$lib “lcd4busy.lib”
$baud = 9600

Const _lcdport = Portb
Const _lcdddr = Ddrb
Const _lcdin = Pinb
Const _lcd_e = 2
Const _lcd_rw = 1
Const _lcd_rs = 0
Config Lcd = 16 * 2

Cursor Off
Cursor Noblink

Dim _sec As Byte
Dim _min As Byte
Dim _hour As Byte
Dim _day As Byte
Dim _month As Byte
Dim _year As Byte
Dim _weekday As Byte

Dim Sa(3) As String * 2
Dim Sb(3) As String * 2

Config Sda = Portd.5
Config Scl = Portd.4
Const Ds1307w = &HD0 ‘ Addresses of Ds1307 clock
Const Ds1307r = &HD1

Declare Sub Getdatetime
Declare Sub Settime
Declare Sub Getsec
Declare Sub Disptime
Declare Sub Dispdate
Declare Sub Format_00
Declare Sub Setdate
Declare Sub Subset

Dim I As Byte
Dim Flagset As Bit ‘0 = Waktu, 1 = Tanggal
Dim Flagreset As Bit
Dim Line1 As String * 1

‘=========================================RTC

Baca lebih lanjut

Maret 15, 2012 Posted by | 3.2 Program | , , , | 1 Komentar

   

Ikuti

Get every new post delivered to your Inbox.

Bergabunglah dengan 63 pengikut lainnya.