SE-CLOCK-ES

ÃʵîÇб³ ƯȰ °úÁ¦¿ë ÀüÀÚ ½Ã°è KIT

BASIC ¾ð¾î¸¦ »ç¿ëÇÑ °¡Àå °£´ÜÇÑ ½Ã°è KITÀÔ´Ï´Ù.
Demo ¹öÁ¯ ÄÄÆÄÀÏ·¯ »ç¿ëÀ¸·Î 
´©±¸³ª  ½±°Ô ¸¶ÀÌÅ©·Î ÇÁ·Î¼¼¼­¸¦ ¹è¿ï ¼ö ÀÖ½À´Ï´Ù.

SE-CLOCK-ES ¼Ò½º(Bascom 8051 BASIC)

BASCOM 8051 µ¥¸ð ¹öÁ¯ ÄÄÆÄÀÏ·¯(4K »ç¿ë°¡´É)

BASCOM 8051 ÄÄÆÄÀÏ·¯ ÇÑ±Û ¸Å´º¾ó


CPU¿¡ HEX ÆÄÀÏÀÌ ¶óÀÌÆà µÇ¾î ÀÖ½À´Ï´Ù.

'---------------------------------------------------------------------------
' Description:
'
' SE-CLOCK-ES
'
' Especially Designed CLOCK for Elementary School Student
'
' +-----------------------------------------+
' | |
' | O +----+ +----+ +----+ +----+ |
' | A.M| | | | O | | | | |
' | | | | | | | | | |
' | +----+ +----+ +----+ +----+ |
' | | | | | | | | | |
' | P.M| | | | O | | | | |
' | O +----+ +----+ +----+ +----+ |
' | WWW.SAMPLE.CO.KR |
' | |||| | -NNN- | |||||||| +-+--+-- | |
' | ZZZZ = -NNN- Z ZZZZZZZZ |o| |-- = |
' | ZZZZ | -NNN- Z ZZZZZZZZ +-+--+-- | |
' | ZZZZ -NNN- Z ZZZZZZZZ 7805 1uF|
' | |||| 1uF -NNN- | |||||||| |
' | -NNN- ||| |
' |1uF -NNN- O ALM|||ZZZ |
' || ||ZZZZZZ |
' |= +-------------------+ ZZZZZZZZ |
' || ___ | | ZZZZZ||| |
' | / \ > 8051 | ZZ||| |
' | | | | | || DC9V|
' | | | +-------------------+ +----|
' | \___/ __ | |
' | PIEZO ALARM EXIT HOUR MIN<__>33P+----|
' | BUZER [ ] [ ] [ ] [ ] -||- |
' | -||- --|>|-|
' | 33P 1N4007|
' +-----------------------------------------+
'
' Written by Junghoon Kim 08-NOV-2005
' Compiled by BASCOM 8051 Demo
'
' http://www.mcselec.com
'
' SAMPLE Electronics co.
' C-18 P1-fl. Main-bd. ET-Land
' 16-9 Hangangno-3ga Yongsan-gu
' Seoul 190-879 South KOREA
' Tel: +82-2-701-8051
' Fax: +82-2-701-8058
' Mail : sample@korea.com
' Web : HTTP://WWW.SAMPLE.CO.KR
'===========================================================================
$regfile = "REG51.DAT"
'---------------------------------------------------------------------------
' 7 Segment Pattern Data
Const Segpat0 = &B11000000 ' 0 ****A***
Const Segpat1 = &B11111001 ' 1 * *
Const Segpat2 = &B10100100 ' 2 F B
Const Segpat3 = &B10110000 ' 3 * *
Const Segpat4 = &B10011001 ' 4 ****G***
Const Segpat5 = &B10010010 ' 5 * *
Const Segpat6 = &B10000010 ' 6 E C
Const Segpat7 = &B11011000 ' 7 * *
Const Segpat8 = &B10000000 ' 8 ****D***
Const Segpat9 = &B10011000 ' 9
Const Segpblk = &B11111111 ' 10 BLANK
'---------------------------------------------------------------------------
Hour10 Alias P1.0
Led_am Alias P1.1
Led_pm Alias P1.2
Piezo Alias P1.3
Sw_alarm Alias P1.4
Sw_exit Alias P1.5
Sw_hour Alias P1.6
Sw_min Alias P1.7
'---------------------------------------------------------------------------
Dim Icount As Word
Dim Clock_cent As Byte ' 1/100 ÃÊ ´ÜÀ§(0 ~ 99)
Dim Clock_second As Byte ' ÃÊ ´ÜÀ§ º¯¼ö (0 ~ 59)
Dim Clock_min As Byte ' ºÐ ´ÜÀ§ º¯¼ö (0 ~ 59)
Dim Clock_hour As Byte ' ½Ã ´ÜÀ§ º¯¼ö (0 ~ 23)
Dim Alarm_min As Byte ' ºÐ ´ÜÀ§ º¯¼ö (0 ~ 59)
Dim Alarm_hour As Byte ' ½Ã ´ÜÀ§ º¯¼ö (0 ~ 23)
Dim Data_min As Byte
Dim Data_hour As Byte
Dim Tempa As Byte
Dim Tempb As Byte
Dim Tempc As Byte
Dim Beep As Bit
Dim Dot_high As Bit
Dim Dot_low As Bit
Dim Dot_alarm As Bit
'===========================================================================
On Timer0 Timebase ' Timer0 Interrupt
'---------------------------------------------------------------------------
Config Timer0 = Timer , Gate = Internal , Mode = 2 ' Timer0 Auto Reload Timer Mode
Load Timer0 , 200 ' Auto Reload Constant 200 uSec
Start Timer0 ' Start Timer0
Enable Timer0 ' Enable Timer0
Enable Interrupts ' Enable All Interrupt
'===========================================================================
Icount = 0
Clock_cent = 0
Clock_second = 0
Clock_min = 0
Clock_hour = 0
Alarm_min = 0
Alarm_hour = 0
Beep = 0
Dot_alarm = 1
'---------------------------------------------------------------------------
Main_clock: ' ½Ã°è µ¿ÀÛ¸ðµå
'
If Clock_cent > 99 Then
Clock_cent = 0
Incr Clock_second
End If
'
If Clock_second > 59 Then
Clock_second = 0
Incr Clock_min
End If
'
If Clock_min > 59 Then
Clock_min = 0
Incr Clock_hour
End If
'
If Clock_hour > 23 Then
Clock_hour = 0
End If
'
Data_min = Clock_min : Data_hour = Clock_hour
'
Gosub Dot_proc
Gosub Clock_disp
'
If Sw_alarm = 0 Then
Gosub Alarm_proc
End If
'
If Sw_min = 0 Then
Clock_second = 0
Incr Clock_min
If Clock_min > 59 Then
Clock_min = 0
End If
Waitms 100
End If
'
If Sw_hour = 0 Then
Incr Clock_hour
If Clock_hour > 23 Then
Clock_hour = 0
End If
Waitms 100
End If
'
If Dot_alarm = 0 Then
If Clock_hour = Alarm_hour Then
If Clock_min = Alarm_min Then
Set Beep
Else
Reset Beep
End If
Else
Reset Beep
End If
Else
Reset Beep
End If
'
Goto Main_clock
'===========================================================================
Clock_disp:
'
Tempa = Data_min Mod 10 : Gosub Patconv
If Dot_alarm = 0 Then
Tempb = Tempb And &H7F
End If
P3 = Tempb
'
Tempa = Data_min / 10 : Gosub Patconv
If Dot_high = 0 Then
Tempb = Tempb And &H7F
End If
P2 = Tempb
'
If Data_hour < 12 Then
Reset Led_am : Set Led_pm
Tempc = Data_hour
Else
Reset Led_pm : Set Led_am
Tempc = Data_hour - 12
End If
'
If Tempc = 0 Then
Tempc = 12
End If
'
Tempa = Tempc Mod 10 : Gosub Patconv
If Dot_low = 0 Then
Tempb = Tempb And &H7F
End If
P0 = Tempb
'
Tempa = Tempc / 10
'
If Tempa = 1 Then
Reset Hour10
Else
Set Hour10
End If
'
Return
'
'===========================================================================
Dot_proc:
'
If Clock_second < 30 Then
Reset Dot_low
If Clock_cent < 50 Then
Reset Dot_high
Else
Set Dot_high
End If
Else
Reset Dot_high
If Clock_cent < 50 Then
Reset Dot_low
Else
Set Dot_low
End If
End If
'
Return
'
'===========================================================================
Alarm_proc:
'
Set Dot_high : Set Dot_low
Data_min = Alarm_min : Data_hour = Alarm_hour
Gosub Clock_disp
Waitms 100
'
Alarm_loop:
Data_min = Alarm_min : Data_hour = Alarm_hour
Gosub Clock_disp
If Sw_min = 0 Then
Incr Alarm_min
If Alarm_min > 59 Then
Alarm_min = 0
End If
Waitms 50
End If
'
If Sw_hour = 0 Then
Incr Alarm_hour
If Alarm_hour > 23 Then
Alarm_hour = 0
End If
Waitms 50
End If
'
If Sw_alarm = 0 Then
Set Dot_alarm
Goto Alarm_ret
End If
'
If Sw_exit = 0 Then
Reset Dot_alarm
Goto Alarm_ret
End If
'
Goto Alarm_loop
'
Alarm_ret:
'
Waitms 500
'
Return
'===========================================================================
Patconv: ' FND ÆÐÅÏ º¯È¯
'
Tempa = Tempa And &H0F
Select Case Tempa
Case 0 : Tempb = Segpat0
Case 1 : Tempb = Segpat1
Case 2 : Tempb = Segpat2
Case 3 : Tempb = Segpat3
Case 4 : Tempb = Segpat4
Case 5 : Tempb = Segpat5
Case 6 : Tempb = Segpat6
Case 7 : Tempb = Segpat7
Case 8 : Tempb = Segpat8
Case 9 : Tempb = Segpat9
Case Else
End Select
'
Return
'===========================================================================
Timebase: ' ŸÀÌ¸Ó ÀÎÅÍ·´Æ® ½ÇÇà
'
Incr Icount
'
If Icount > 49 Then ' 49
'
Icount = 0
Incr Clock_cent
End If
'
If Beep = 1 Then
If Piezo = 1 Then
Reset Piezo
Else
Set Piezo
End If
End If
'
Return
'---------------------------------------------------------------------------
'
'============================ END OF FILE ==================================
'
'

ÀÚ·á½Ç:

SE-CLOCK-ES ¼Ò½º(Bascom 8051 BASIC)

BASCOM 8051 µ¥¸ð ¹öÁ¯ ÄÄÆÄÀÏ·¯(2K »ç¿ë°¡´É)

SE-CLOCK-ES ¼Ò½º( C Language )

BASCOM 8051 ÄÄÆÄÀÏ·¯ ÇÑ±Û ¸Å´º¾ó

AT89C51 µ¥ÀÌÅÍ

¡¡

¡¡

»ùÇÃÀüÀÚ ½Ã°è Á¶¸³ KIT ºñ±³Ç¥
(±×¸²À» Ŭ¸¯ÇÏ½Ã¸é °ü·Ã ÆäÀÌÁö·Î À̵¿ÇÕ´Ï´Ù.)

SE-CLOCK-UNI


Lan: C ¾ð¾î
CPU: AT89C51
±âÆÇ: ¸¸´É±âÆÇ

SE-CLOCK-FND


Lan: BASIC
CPU: AT89C51
±âÆÇ: ¾ç¸é PCB

SE-CLOCK-LED


Lan: C, BASIC
CPU: AT89C2051
±âÆÇ: ´Ü¸é PCB

SE-CLOCK-LED-U


Lang: C, BASIC
CPU: AT89C2051
±âÆÇ: ¸¸´É±âÆÇ

SE-CLOCK-DM


Lan: C, BASIC
CPU: AT89C2051
±âÆÇ: ¾ç¸é PCB

SE-CLOCK-DM-U


Lan: C, BASIC
CPU: AT89C2051
±âÆÇ: ¸¸´É±âÆÇ

SE-CLOCK-ES


Lan: C, BASIC
CPU: AT89C51
±âÆÇ: ´Ü¸é PCB

SE-CLOCK-MINI


Lan: BASIC
CPU: AT89C2051
±âÆÇ: ¾ç¸é PCB

¡¡

°¡ °Ý Á¤ º¸

¡¡

¡¡

¡¡

¡¡