ÕªÒª£º±¾ÎÄÉè¼ÆÁËÒ»ÖÖ»ùÓÚLabVIEWÓëSTC12C5410ADµ¥Æ¬»úµÄÊý¾Ý²É¼¯ÏµÍ³¡£µ¥Æ¬»ú²É¼¯µ½µÄÊý¾Ýͨ¹ýCH341TоƬµÄUSBת´®¿ÚµÄ¹¦ÄÜ£¬ÊµÏÖÁËÖ»ÓÃÒ»ÌõUSBÏ߾ͿÉÒÔ°ÑÊý¾Ý´«Êäµ½LabVIEWÖнøÐÐÏÔʾºÍ·ÖÎö¡£´ÓÏÂλ»úºÍÉÏλ»úÁ½¸ö²¿·Ö²ûÊöÁËϵͳµÄÉè¼Æ¡£ÊµÑéÖ¤Ã÷£¬ÏµÍ³ÄÜʵʱ¾«È·µÄÔÙÏÖµ¥Æ¬»ú²É¼¯µÄµÍƵÐźš£
¹Ø¼ü´Ê£ºLabVlEW£»Êý¾Ý²É¼¯£»STCµ¥Æ¬»ú£»USB
1 Êý¾Ý²É¼¯ÏµÍ³
¹¤³ÌÉÏʹÓþßÓÐPCI¡¢PXI¡¢USB¡¢²¢¿ÚÒÔ¼°´®¿ÚµÄ¼ÆËã»úÀ´»ñÈ¡²âÊÔÊý¾Ý£¬³ÆΪ»ùÓÚPCµÄÊý¾Ý²É¼¯ÏµÍ³¡£ÆäÖÐÒ»ÖÖÊÇͨ¹ý²åÈëʽµÄÊý¾Ý²É¼¯¿¨Ö±½Ó»ñÈ¡Êý¾Ý´«Êä¸ø¼ÆËã»ú¡£¼øÓÚÊý¾Ý²É¼¯¿¨µÄ¼Û¸ñ°º¹ó£¬ÇÒ°²×°²»·½±ãµÈȱµã£¬±¾ÎÄÌá³öʹÓÃSTCµ¥Æ¬»ú×÷Ϊǰ¶ËµÄÊý¾Ý²É¼¯ÏµÍ³£¬ÀûÓÃCH341TоƬµÄUSB×ÜÏßתÒì²½´®¿ÚµÄ¹¦ÄÜ£¬½«²É¼¯Êý¾Ýֻͨ¹ýÒ»ÌõUSBÏß´«Êä¸øPC»ú£¬×îºóÔÚLabVIEWƽ̨ϽøÐÐÊý¾ÝµÄÏÔʾ¡¢·ÖÎö¡¢´¦Àí¡£
1£®1 ϵͳ×é³ÉÓ빤×÷ÔÀí
±¾ÏµÍ³×ÜÌå½á¹¹¿òͼÈçͼ1Ëùʾ¡£Ö÷Òª°üÀ¨ÓÐSTC12C5410ADµ¥Æ¬»úºÍCH341Tת»»Ð¾Æ¬×é³ÉµÄÊý¾Ý²É¼¯¡¢×ª»»¡¢´«Ê䲿·Ö£¬ÒÔ¼°»ùÓÚPC»úµÄLabVlEWÈí¼þ¹¹³ÉµÄÊý¾Ý´¦Àí²¿·Ö¡£Ê×ÏÈ£¬±»²âµçѹģÄâÐźÅͨ¹ýµçƽ±ä»»µç·½øÈëSTCµ¥Æ¬»úµÄADת»»Í¨µÀ£¬´ýת»»Íê³ÉºóÀûÓÃCH341TоƬµÄUSBת´®¿ÚµÄ¹¦ÄÜ£¬Í¨¹ýUSB½Ó¿Ú´«Êä¸øPC»ú£¬×îºóÓÉLabVIEWÈí¼þ·ÖÎö´¦Àí¡£
2 ÏÂλ»úϵͳÉè¼Æ
2£®1 Ó²¼þÉè¼Æ²¿·Ö
ϵͳӲ¼þÔÀíͼÈçͼ2Ëùʾ¡£ÏµÍ³²ÉÓõÄMCUΪSTC12C5410AD£¬²ÉÓõÄUSB½Ó¿ÚоƬΪCH- 341T£¬ÀûÓøÃоƬµÄUSBת´®¿ÚµÄ¹¦Äܽ«Êý¾Ý´«Êäµ½ÉÏλ»ú£¬´Ó¶ø¹¹³ÉÊý¾Ý²É¼¯ÏµÍ³¡£
2£®1£®1 STC12C5410ADµ¥Æ¬»ú
STC12C5410ADϵÁе¥Æ¬»úÊǵ¥Ê±ÖÓ£¯»úÆ÷ÖÜÆÚ(1T)µÄ¼æÈÝ8051Äں˵¥Æ¬»ú£¬ÊǸßËÙ£¯µÍ¹¦ºÄµÄÐÂÒ»´úÔöÇ¿ÐÍ8051µ¥Æ¬»ú£¬ÄÚ²¿¼¯³ÉMAX810רÓø´Î»µç·¡£10KBFLASH³ÌÐò´æ´¢Æ÷£¬512×Ö½ÚSRAM£¬ÓÐ8·10λ¸ßËÙA£¯Dת»»Æ÷£¬Ëٶȿɴï100KHz¡£Êµ¼Ê¹¤×÷ƵÂÊ¿É´ï48MHz¡£ÔÚÓ¦ÓÃʱ£¬Ðè¸ù¾Ýʵ¼ÊÇé¿öÉ趨¾§ÕñƵÂÊ£¬±¾ÏµÍ³²ÉÓÃ11£®0592MHzµÄ¾§Õñ¡£±¾ÀýÖвÉÓÃP1£®0×÷ΪA£¯Dת»»Í¨µÀ¡£ÓÉÓÚ¸÷A£¯Dת»»Í¨µÀµÄÊäÈëµçѹ·¶Î§Îª0¡«5V£¬¶ÔÓÚË«¼«ÐÔÐźÅÀ´Ëµ£¬Ö±½ÓÊäÈë»á±»Ï÷µô¸º°ë²¨¡£ÎªÁ˽â¾öÉÏÊöÎÊÌ⣬²ÉÓÃÁ˸ßËÙµÍÔëÉùË«ÔËËã·Å´óÆ÷NE5532£¬¸ù¾ÝÔ˷ŵç·µÄÐé¶Ì¡¢Ðé¶ÏÔÔò£¬ÆäÊä³öOUT=2£®5-IN¡£¿ÉÒÔ½«-2£®5v¡«2£®5VµÄµçƽת»»µ½0¡«5v£¬ÕâÑùÂú×ãÁËÊäÈëÐźŵÄË«¼«ÐÔÒªÇó¡£
2£®1£®2 CH341TоƬ
Ëæ׿ÆËã»úͨѶ¼¼ÊõµÄ²»¶Ï·¢Õ¹£¬´®¿ÚµÄͨѶËÙ¶ÈÔ½À´Ô½²»ÄÜÂú×ãÏÖÔÚµÄͨÐÅÒªÇó¡£Òò´ËÔ½À´Ô½¶àµÄ¼ÆËã»ú£¬ÓÈÆäÊDZʼDZ¾µçÄÔ¶¼²»ÔÙ±£Áô´®Ðнӿڣ¬È¡¶ø´úÖ®µÄÊÇ·½±ã¡¢¸ßËÙ¡¢±ê×¼µÄUSB½Ó¿Ú¡£È»¶ø¶ÔÓÚÐèÒªÓô®¿ÚͨÐŵÄÉ豸À´Ëµ£¬ÊǸöÂé·³µÄÎÊÌ⡣ΪÁ˽â¾öÕâ¸öÎÊÌ⣬±¾ÏµÍ³²ÉÓÃCH341TоƬ½«µ¥Æ¬»úͨ¹ýUSB½Ó¿ÚÖ±½ÓÁ¬½Óµ½PC»úÉÏ£¬·½±ãÁËûÓд®¿ÚµÄÉÏλ»úÓëÏÂλ»úµÄͨÐÅ£¬½â¾öÁËÉÏλ»úûÓд®ÐнӿڵÄÎÊÌâ¡£CH341TоƬµÄÌصãÈçÏ£º
(1)·ÂÕæ±ê×¼´®¿Ú£¬ÓÃÓÚÉý¼¶Ô´®¿ÚÍâΧÉ豸£¬»òÕßͨ¹ýUSBÔö¼Ó¶îÍâ´®¿Ú¡£
(2)¼ÆËã»ú¶ËWindows²Ù×÷ϵͳϵĴ®¿ÚÓ¦ÓóÌÐòÍêÈ«¼æÈÝ£¬ÎÞÐèÐ޸ġ£
(3)Ó²¼þÈ«Ë«¹¤´®¿Ú£¬ÄÚÖÃÊÕ·¢»º³åÇø£¬Ö§³ÖͨѶ²¨ÌØÂÊ50b£¯s¡«2Mb£¯s¡£
(4)Ö§³Ö5¡¢6¡¢7»òÕß8¸öÊý¾Ýλ£¬Ö§³ÖÆæУÑ顢żУÑé¡¢¿Õ°×¡¢±êÖ¾ÒÔ¼°ÎÞУÑé¡£
2£®2 Èí¼þÉè¼Æ²¿·Ö
±¾ÏµÍ³½«STCl2C5410ADµÄP1£®0¿Ú×÷ΪA£¯Dת»»µÄͨµÀ£¬ÒªÊ¹ÓÃA£¯Dת»»¹¦ÄܾͱØÐë½øÐÐÏàÓ¦µÄ¼Ä´æÆ÷ÉèÖá£STCµ¥Æ¬»úµÄ¼Ä´æÆ÷¼û±í1Ëùʾ¡£
1)P1M0£¬P1M1£ºP1¿Ú¹¤×÷ģʽÉèÖÃPlM0=0x01£¬P1M1=0x01¡£½«P1¿ÚÉèÖÃΪ¿ªÂ©Ä£Ê½¡£
2)ADC CONTR£ºA£¯Dת»»¿ØÖÆÆ÷
ADC_POWER£ºADCµçÔ´¿ØÖÆλ¡£
ADC_ POWER=0£º¹Ø±ÕADCµçÔ´¡£ADC POWER=1£º´ò¿ªA£¯Dת»»Æ÷µçÔ´£¬³õ´Î´ò¿ªÄÚ²¿A£¯Dת»»Ä£ÄâµçÔ´£¬ÐèÊʵ±ÑÓʱ£¬µÈÄÚ²¿Ä£ÄâµçÔ´Îȶ¨ºó£¬ÔÙÆô¶¯A£¯Dת»»¡£
ADC_START£ºÄ£Êýת»»Æ÷(ADC)ת»»Æô¶¯¿ØÖÆ룬ÉèÖÃΪ1ʱ£¬¿ªÊ¼×ª»»£¬×ª»»½áÊøºóΪ0¡£
SPEED1£¬SPEED0£ºÄ£Êýת»»Æ÷ת»»ËٶȿØÖÆλ¡£
ADC_FLAG£ºÄ£Êýת»»Æ÷ת»»½áÊø±ê־룬µ±A£¯Dת»»Íê³Éºó£¬ADC_FLAG=1£¬Ò»¶¨ÒªÈí¼þÇå0¡£
CHS2£¯CHS1£¯CHS0£ºÄ£ÄâÊäÈëͨµÀÑ¡ÔñÈç±í2Ëùʾ¡£
×÷ÕߣºÖ£Ñã½×,»ÆΩ¹«,Õŵ¤ Î÷»ª´óѧ À´Ô´£ºµç×Ó¼¼Êõ