Åê¹ÆÊ罸¡ª¡¡¥¹¥ì¥Ã¥É°ìÍ÷

¥¹¥ì¥Ã¥ÉºîÀ® ¾¤Î¥¹¥ì¥Ã¥É¤òõ¤¹

[PR]  ¥°¥¢¥à³Ê°Âι¹Ô µá¿Í¡¦Å¾¿¦ seoÂкö CIA
teacup. ] [ ÌµÎÁ·Ç¼¨ÈÄ ] [ ¥×¥ì¥ß¥¢¥à·Ç¼¨ÈÄ ] [ teacup.¥³¥ß¥å¥Ë¥Æ¥£ ] [ ¥Ö¥í¥° ] [ ¥Á¥ã¥Ã¥È ]

¿·Ãå½ç:6/87 µ­»ö°ìÍ÷ɽ¼¨ | ¡ÔÁ°¤Î¥Ú¡¼¥¸ | ¼¡¤Î¥Ú¡¼¥¸¡Õ

FJC¥Ë¥å¡Ý¥¹6·î¹æ

 Åê¹Æ¼Ô¡§yamahara  Åê¹ÆÆü¡§2009ǯ 5·î29Æü(¶â)13»þ50ʬ40ÉÃ
¡¡ ÄÌÊó
  FJC¥Ë¥å¡Ý¥¹6·î¹æ
º£·î¤Ï2Áê¥æ¥Ë¥Ý¡¼¥é¥Ñ¥ë¥¹¥â¡¼¥¿¡¼À©¸æ
¤Î¥µ¥ó¥×¥ë ¤ò £±£²£Ã£µ£°£¹£Á¤Î¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤Ç¤¹¡£
²óÏ©¿Þ¤Ï¥Û¡¼¥à¥Ú¡¼¥¸¤Î¥Ñ¥ë¥¹¥â¡¼¥¿¤Î¥Ú¡¼¥¸¤ò¤´Í÷¤¯¤À¤µ¤¤Ž¡
;-------------------------------------------
include 12c5xx.h
.12c509
.osc intrc ;ÆâÉô¥¯¥í¥Ã¥¯¡¡4MHz
.mclre disable ;MCLR ¤ò¡¡ÆþÎϥݡݥȡ¡£Ç£Ð£³¡¡¤Ç»È¤¦
.wdt off
id 1208h
; 1ÁêÎå¼§¥Ñ¥ë¥¹¥â¡¼¥¿¥³¥ó¥È¥í¡¼¥é  t.yamahara
;
;

;
;                GND     s1    s2    s3
;         ¨£¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¤
; ¨¢­¨    ­§    ­¦    ­¥    ¨¢
; ¨¢VSS  GP0    GP1   GP2   ¨¢
; ¨¢   PIC12C509            ¨¢
; ¨¢VDD   GP5   GP4   GP3   ¨¢
; ¨¢­¡    ­¢    ­£    ­¤    ¨¢
; ¨¦¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¥
; DC5V   ccw    s4     £ã£÷
;                       IN            IN
s1 equ gpio.0 ;¥Ñ¥ë¥¹¥â¥¿¡¼¦Õ£±½ÐÎÏ
s2 equ gpio.1 ;¥Ñ¥ë¥¹¥â¥¿¡¼¦Õ£²½ÐÎÏ
s3 equ gpio.2 ;¥Ñ¥ë¥¹¥â¥¿¡¼¦Õ£³½ÐÎÏ
s4 equ gpio.4 ;¥Ñ¥ë¥¹¥â¥¿¡¼¦Õ£´½ÐÎÏ
org 08h
stc ds 1 ;¥â¡¼¥¿¡¼°ÌÃÖ¥«¥¦¥ó¥¿¡¼
tmdt ds 1 ;¥¿¥¤¥Þ¡¼¥Ç¡¼¥¿¡¼
cu1 ds 1 ;ÈÆÍÑ
cu2 ds 1
bf ds 1
gpbf ds 1 ;£Ç£Ð£É£Ï£î£ï¥Ð¥Ã¥Õ¥¡
ccwin equ gpbf.5 ;£Ã£Ã£×²óž»ÊÎáÉé¥Ñ¥ë¥¹ÆþÎÏ
cwin equ gpbf.3 ;£Ã£Ã£×²óž»ÊÎáÉé¥Ñ¥ë¥¹ÆþÎÏ
     org 0
goto start
; £Ç£Ð£É£Ï¤ÎÆÉ¤ß¹þ¤ß
; £±£²£Ã£µ£°£¹£Á¤òÆâÉô£Ò£Ãȯ¿¶¤Ç»ÈÍѤ·¤Þ¤¹¤Î¤Ç1¥µ¥¤¥¯¥ë£´£Í£È£ú¡¿4
;  £±u£ó¤ÇÌó£±£°u£ó¤Î´Ö¤Ë£ç£ði£ï¤ÎÃͤ¬ÊѲ½¤¹¤ë¤ÈÆÉ¤ßľ¤·¤È¤Ê¤ê
;  £Ã£Ã£×¡¤£Ã£×À©¸æ¥Ñ¥ë¥¹¤ËÆþ¤ë£±£°u£ó°Ê²¼¤Î¥Î¥¤¥º¤ò¥«¥Ã¥È¤Ç¤­¤Þ¤¹¡£
;   £Î£Ï£Ð¤ò£±¤ÄÁý¤ä¤¹»ö¤Ç£±u£ó¥Õ¥¤¥ë¥¿¡¼¤ò¿­¤Ð¤»¤Þ¤¹Ž¡
ingp mov gpbf,gpio ;gpbf ¤Ë gpio ¤Î Ãͤò Æþ¤ì¤ë¡£
nop ; £±u£ó
nop
nop
cjne gpbf,gpio,ingp ;gpio¤ÎÃͤ¬ÊѤï¤Ã¤Æ¤¤¤ì¤Ðingp¤Ø¥¸¥ã¥ó¥×
ret
;   ÅŸ»Î©¤Á¾å¤¬¤ê»þ¤Î¸íưºîËɻߥ¿¥¤¥Þ¡¼
start           clr     cu1
                clr     cu2

                mov     bf,#2
start1          nop
                djnz    cu1,start1
                djnz    cu2,start1
djnz bf,start1
                mov     !gpio,#101000b     ; gpio i/o set
                clr     gpio
mov w,#000111b    ; trm0 i/o Pul up
option
loop0 clr gpio ;motor  off
setb s1 ;¥â¥¿¡¼¤ò£°¥Ý¥¸¥·¥ç¥ó¤Ë ¥»¥Ã¥È
clr stc
loop1           call    ingp ;£±£°u£ó¥½¥Õ¥È¥Õ¥¤¥ë¥¿¡¼¤ò¤È¤¦¤·¤ÆÆþÎÏ´Æ»ë
jnb cwin,incs ;£Ã£×¥Ñ¥ë¥¹£É£Î
jnb ccwin,decs ;£Ã£Ã£×¥Ñ¥ë¥¹£É£Î
goto loop1
;£Ã£×¥Ñ¥ë¥¹£É£Î
incs inc stc ;°ÌÃÖ¥«¥¦¥ó¥¿¡¼¡Ü£±(£±¥¹¥Æ¥Ã¥×»þ·×²ó¤ê°ÌÃÖ¡Ë
cjne stc,#4,tmset
clr stc
goto tmset
;   £Ã£Ã£×¥Ñ¥ë¥¹£É£Î
decs sub stc,#1 ;°ÌÃÖ¥«¥¦¥ó¥¿¡¼¡Ü£±(£±¥¹¥Æ¥Ã¥×È¿»þ·×²ó¤ê°ÌÃÖ¡Ë
jc      tmset
mov stc,#3
;             °ÌÃÖ¥«¥¦¥ó¥¿¡¼¤Ë¹ç¤ï¤»¤ÆÎå¼§
tmset cje stc,#1,p1
cje stc,#2,p2
cje stc,#3,p3
setb s1 ;¥â¡¼¥¿°ÌÃÖ 0 Îå¼§
clrb s2
clrb s3
clrb s4
jmp tmon
p1 clrb s1 ;¥â¡¼¥¿°ÌÃÖ £± Îå¼§
setb s2
clrb s3
clrb s4
jmp tmon
p2 clrb s1 ;¥â¡¼¥¿°ÌÃÖ £² Îå¼§
clrb s2
setb s3
clrb s4
jmp tmon
p3 clrb s1 ;¥â¡¼¥¿°ÌÃÖ £³ Îå¼§
clrb s2
clrb s3
setb s4
jmp tmon
;    ÉéÆþÎϤΥѥ륹¤¬£Ï£Æ£Æ¡ÊÅ۵£È¡Ë¤Ë¤Ê¤ë¤Þ¤ÇÂԤġ£
tmon call    ingp
jnb cwin,tmon
jnb ccwin,tmon
goto loop1
 
¡Õµ­»ö°ìÍ÷ɽ¼¨

¿·Ãå½ç:6/87 ¡ÔÁ°¤Î¥Ú¡¼¥¸ | ¼¡¤Î¥Ú¡¼¥¸¡Õ
¡¿87