51µ¥Æ¬»ú Keil C ÑÓʱ³ÌÐòµÄ¼òµ¥Ñо¿
51µ¥Æ¬»ú Keil C ÑÓʱ³ÌÐòµÄ¼òµ¥Ñо¿
by: InfiniteSpace Studio/isjfk, 1.21.2004
ÈκÎÈ˶¼¿ÉÒÔÔÚ×¢Ã÷Ô×÷Õߺͳö´¦µÄÇ°ÌáÏÂËæÒâתÔØÕâƪÎÄÕ£¬µ«²»µÃÓÃÓÚÉÌҵĿµÄ¡£
Ó¦Óõ¥Æ¬»úµÄʱºò£¬¾³£»áÓöµ½ÐèÒª¶Ìʱ¼äÑÓʱµÄÇé¿ö¡£ÐèÒªµÄÑÓʱʱ¼äºÜ¶Ì£¬Ò»°ã¶¼ÊǼ¸Ê®µ½¼¸°Ù΢Ãî(us)¡£ÓÐʱºò»¹ÐèÒªºÜ¸ßµÄ¾«¶È£¬±ÈÈçÓõ¥Æ¬»úÇý¶¯DS18B20µÄʱºò£¬Îó²îÈÝÐíµÄ·¶Î§ÔÚÊ®¼¸usÒÔÄÚ£¬²»È»ºÜÈÝÒ׳ö´í¡£ÕâÖÖÇé¿öÏ£¬ÓüÆʱÆ÷ÍùÍùÓеãСÌâ´ó×ö¡£¶øÔÚ¼«¶ËµÄÇé¿öÏ£¬¼ÆʱÆ÷ÉõÖÁÒѾȫ²¿ÅÉÉÏÁ˱ðµÄÓÃ;¡£Õâʱ¾ÍÐèÒªÎÒÃÇÁíÏë±ðµÄ°ì·¨ÁË¡£
ÒÔÇ°Óûã±àÓïÑÔдµ¥Æ¬»ú³ÌÐòµÄʱºò£¬Õâ¸öÎÊÌ⻹ÊÇÏà¶ÔÈÝÒ×½â¾öµÄ¡£±ÈÈçÓõÄÊÇ12MHz¾§ÕñµÄ51£¬´òËãÑÓʱ20us£¬Ö»ÒªÓÃÏÂÃæµÄ´úÂ룬¾Í¿ÉÒÔÂú×ãÒ»°ãµÄÐèÒª£º
mov r0, #09h
loop: djnz r0, loop
51µ¥Æ¬»úµÄÖ¸ÁîÖÜÆÚÊǾ§ÕñƵÂʵÄ1/12£¬Ò²¾ÍÊÇ1usÒ»¸öÖÜÆÚ¡£mov r0, #09hÐèÒª2¸ö¼«ÆäÖÜÆÚ£¬djnzÒ²ÐèÒª2¸ö¼«ÆäÖÜÆÚ¡£ÄÇô´æÔÚr0ÀïµÄÊý¾ÍÊÇ(20-2)/2¡£ÓÃÕâÖÖ·½·¨£¬¿ÉÒԷdz£·½±ãµÄʵÏÖ256usÒÔÏÂʱ¼äµÄÑÓʱ¡£Èç¹ûÐèÒª¸ü³¤Ê±¼ä£¬¿ÉÒÔʹÓÃÁ½²ãǶÌס£¶øÇÒ¾«¶È¿ÉÒÔ´ïµ½2us£¬Ò»°ãÀ´Ëµ£¬ÕâÒѾ×ã¹»ÁË¡£
ÏÖÔÚ£¬Ó¦Óøü¹ã·ºµÄºÁÎÞÒÉÎÊÊÇKeilµÄC±àÒëÆ÷¡£Ïà¶Ô»ã±àÀ´Ëµ£¬C¹ÌÈ»ÓкܶàÓŵ㣬±ÈÈç³ÌÐòÒ×ά»¤£¬±ãÓÚÀí½â£¬ÊʺϴóµÄÏîÄ¿¡£µ«È±µã£¨ÎÒ¾õµÃÕâÊÇCµÄΨһһ¸öȱµãÁË£©¾ÍÊÇʵʱÐÔûÓб£Ö¤£¬ÎÞ·¨Ô¤²â´úÂëÖ´ÐеÄÖ¸ÁîÖÜÆÚ¡£Òò¶øÔÚʵʱÐÔÒªÇó¸ßµÄ³¡ºÏ£¬»¹ÐèÒª»ã±àºÍCµÄÁªºÏÓ¦Óᣵ«ÊÇÊDz»ÊÇÕâÑùÒ»¸öÑÓʱ³ÌÐò£¬Ò²ÐèÒªÓûã±àÀ´ÊµÏÖÄØ£¿ÎªÁËÕÒµ½Õâ¸ö´ð°¸£¬ÎÒ×öÁËÒ»¸öʵÑé¡£
ÓÃCÓïÑÔʵÏÖÑÓʱ³ÌÐò£¬Ê×ÏÈÏëµ½µÄ¾ÍÊÇC³£ÓõÄÑ»·Óï¾ä¡£ÏÂÃæÕâ¶Î´úÂëÊÇÎÒ¾³£ÔÚÍøÉÏ¿´µ½µÄ£º
void delay2(unsigned char i)
{
for
Ïà¹ØÎĵµ£º
¾µÍ·×ÜÊDZ»¹Ì¶¨ÔÚ±ê×¼µÄ¾µ×ùÉÏ£¬¾µ×ù°üΧ×Å´«¸ÐÆ÷CCD£¬¾µÍ·ÓëCCDÊܹâÃæ±£³Ö×ÅÒ»¶¨µÄ¾àÀ룬ʹµÃ¾µÍ·µÄÏñÃæÓëÆäÒ»Ö£¬ÒÔʹ¾µÍ·¶Ô½¹Î¢µ÷ºó³ÉÏñ×îÇåÎú¡£Óм¸ÖÖ±ê×¼µÄ°²×°½Ó¿Ú£ºC½Ó¿Ú¡¢CS½Ó¿ÚºÍS½Ó¿Ú¡£
ËùÓеÄÉãÏó»ú¾µÍ·¾ùÊÇÂÝÎƽӿڵģ¬CCDÉãÏó»úµÄ¾µÍ·°²×°ÓÐÁ½ÖÖ¹¤Òµ±ê×¼£¬¼´C°²×°×ùºÍCS°²×°×ù¡£Á½ÕßÂÝÎƲ¿·ÖÏàͬ£¬µ«Á½Õß´Ó¾µ ......
1 Ç°ÑÔ
¡¡³¤ÆÚÒÔÀ´£¬¹ã´ó³ÌÐòԱΪµ½µ×ÊÇʹÓÃClient/Server£¬»¹ÊÇʹÓÃBrowser/Server½á¹¹ÕùÂÛ²»ÐÝ£¬ÔÚÕâЩÕùÂÛµ±ÖÐ,C/S½á¹¹µÄ³ÌÐò¿Éά»¤ÐԲ²¼ÖÃÀ§ÄÑ£¬Éý¼¶²»·½±ã£¬Î¬»¤³É±¾¸ß¾ÍÊÇÒ»¸öÏ൱ÖØÒªµÄÒòËØ¡£ÓкܶàÆóÒµÓû§¾ÍÊÇÒòΪÕâ¸öÔÒò¶ø·ÅÆúʹÓÃC/S¡£È»¶øµ±Ò»¸öÓ¦ÓñØÐëҪʹÓÃC/S½á¹¹²ÅÄܺܺõÄʵÏÖÆ书ÄܵÄʱ ......
2010Äê05ÔÂ1ºÅ |
23:15·ÖÀࣺ¹ÜÀíά»¤
, Õï¶Ï°¸Àý
| ±à¼
| ±êÇ©£º11g
¡¢dbca
¡¢netca
| 13
views
±¾Îijö×Ô “inthirties£¨ÄÐ
ÈËÈýÊ®£©
”²©¿Í£¬×ªÔØÇëÎñ±Ø×¢Ã÷×÷Õߺͱ£Áô³ö´¦¡£
¿Í»§×°ºÃÁËOracle£¬°²×°³É¹¦ÁË£ ......
1.ʱ¼ä±íʾ
ÔÚ³ÌÐòµ±ÖÐ,ÎÒÃǾ³£ÒªÊä³öϵͳµ±Ç°µÄʱ¼ä,±ÈÈçÎÒÃÇʹÓÃdateÃüÁîµÄÊä³ö½á¹û.Õâ¸öʱºòÎÒÃÇ¿ÉÒÔʹÓÃÏÂÃæÁ½¸öº¯Êý:
#include <sys/time.h>
time_t time(time_t *tloc);
char *ctime(const time_t *clock);
timeº¯Êý·µ»Ø´Ó1970Äê1ÔÂ1ÈÕ0 ......