20200131

ope体育用户app作者:ope体育用户app 发布时间:2020-02-19 已浏览: 118次

嫻風繑寰數瀛愮鎶€鏈夐檺鍏徃涓烘偍鍏嶈垂鎻愪緵婀栧寳嫻峰皵鍗曠墖鏈/a>,婀栧寳鏉劇堪鍗曠墖鏈婀栧寳涓滆蔣鍗曠墖鏈灝煎厠媯甅OS綆$瓑鐩稿叧淇℃伅鍙戝竷鍜岃祫璁睍紺猴紝鏁鍏蟲敞錛/p>MCU(鍗曠墖鏈鐨勫熀鏈绱/p>閽堝緇濆ぇ閮ㄥ垎MCU錛屼互涓嬩綔鐢ㄦ槸騫挎硾閮芥槸鍩虹鐨勶紝瀵逛簬涓嶄竴鏍風殑MCU錛屽叾鍙欒堪鐨勬柟娉曞皢浼氫細鏈夊樊鍒紝浣嗗疄璐ㄤ笂鏄熀鏈竴鑷寸殑錛/p>TImer(璁℃椂鍣錛歍Imer鐨勭被鍨嬪敖綆¤緝涓哄錛屼絾鍙⒊鐞嗕負涓ょ被錛氫竴綾繪槸鍥哄畾涓嶅姩闂撮殧鏃墮棿鐨凾Imer錛屽嵆鍏跺畾鏃舵墽琛岀殑鏃墮棿鐢辯郴緇熻蔣浠惰緗殑錛岀敤鎴風▼搴忎笉鑳芥搷綰碉紝緋葷粺杞歡鍙嚭紺哄嚑綾誨浐瀹氫笉鍔ㄧ殑闂撮殧鏃墮棿緇欑敤鎴風▼搴忓紑灞曟寫閫夛紝濡2Hz錛6Hz錛Hz絳夛紝璇ョ被TImer鍦浣峂CU涓緝涓烘櫘閬嶏紝鍥犺€岃兘澶鐢ㄤ簬淇濇寔閽熻〃銆佸€掕鏃剁瓑鏈夊叧鐨勪綔鐢鍙︿竴綾誨垯鏄疨rogrammableTimer(紼嬪簭鎺у埗鍣ㄨ鏃跺櫒)錛岃鐧戒簡錛屾綾籘imer鐨勫畾鏃舵墽琛屾椂闂磋兘澶鐢卞鎴風殑紼嬪簭嫻佺▼鏉ユ搷綰電殑錛屾搷綰電殑鏂規硶鍖呭惈錛氶挓琛ㄦ簮鐨勬寫閫夈€佸垎棰戞暟(Prescale)鎸戦€夊強棰勫埗鏋勪歡鏁扮殑璁劇疆絳夛紝鏈夌殑MCU涓夎€呴兘鍙﹀鍏鋒湁錛岀劧鑰屾湁鐨勫垯灝嗕細鏄湪鍏朵腑鐨勪竴縐嶆垨浜岀銆br>璇ョ被Timer榪愮敤鏇村姞鐏墊椿錛屽叿浣撶殑搴旂敤涔熷崈濮跨櫨鎬侊紝鍦ㄥ叾涓櫘閬嶇殑涓€縐嶈繍鐢ㄥ氨鏄鐢ㄥ叾淇濇寔PWM杓稿嚭(瀹為檯鐨勮繍鐢紝浜嬪悗浼氭湁闈炲父鐨勮緇嗕粙緇銆傚洜涓洪挓琛ㄦ簮鑳藉闅忔剰閫夋嫨錛屽洜鑰岋紝璇ョ被Timer涓€鑸潎涓嶦ventCounter(鎭舵€т簨浠剁數瀛愯鏁板櫒)鍚堝湪涓€璧IO鍙o細涓€鍒嘙CU閮藉叿澶囦竴瀹氭€繪暟鐨処O鍙o紝娌掓湁IO鍙o紝MCU灝卞け鍘諱笌澶栫晫娌熼€氫氦嫻佺殑鏂瑰紡銆備緷鎹甀O鍙g殑鍙厤澶囩姸鍐碉紝鑳藉鍒嗘垚浠ヤ笅鍑犵被縐嶇被錛p>

TImer(璁℃椂鍣錛歍Imer鐨勭被鍨嬪敖綆¤緝涓哄錛屼絾鍙⒊鐞嗕負涓ょ被錛氫竴綾繪槸鍥哄畾涓嶅姩闂撮殧鏃墮棿鐨凾Imer錛屽嵆鍏跺畾鏃舵墽琛岀殑鏃墮棿鐢辯郴緇熻蔣浠惰緗殑錛岀敤鎴風▼搴忎笉鑳芥搷綰碉紝緋葷粺杞歡鍙嚭紺哄嚑綾誨浐瀹氫笉鍔ㄧ殑闂撮殧鏃墮棿緇欑敤鎴風▼搴忓紑灞曟寫閫夛紝濡2Hz錛6Hz錛Hz絳夛紝璇ョ被TImer鍦浣峂CU涓緝涓烘櫘閬嶏紝鍥犺€岃兘澶鐢ㄤ簬淇濇寔閽熻〃銆佸€掕鏃剁瓑鏈夊叧鐨勪綔鐢鍙︿竴綾誨垯鏄疨rogrammableTimer(紼嬪簭鎺у埗鍣ㄨ鏃跺櫒)錛岃鐧戒簡錛屾綾籘imer鐨勫畾鏃舵墽琛屾椂闂磋兘澶鐢卞鎴風殑紼嬪簭嫻佺▼鏉ユ搷綰電殑錛屾搷綰電殑鏂規硶鍖呭惈錛氶挓琛ㄦ簮鐨勬寫閫夈€佸垎棰戞暟(Prescale)鎸戦€夊強棰勫埗鏋勪歡鏁扮殑璁劇疆絳夛紝鏈夌殑MCU涓夎€呴兘鍙﹀鍏鋒湁錛岀劧鑰屾湁鐨勫垯灝嗕細鏄湪鍏朵腑鐨勪竴縐嶆垨浜岀銆br>璇ョ被Timer榪愮敤鏇村姞鐏墊椿錛屽叿浣撶殑搴旂敤涔熷崈濮跨櫨鎬侊紝鍦ㄥ叾涓櫘閬嶇殑涓€縐嶈繍鐢ㄥ氨鏄鐢ㄥ叾淇濇寔PWM杓稿嚭(瀹為檯鐨勮繍鐢紝浜嬪悗浼氭湁闈炲父鐨勮緇嗕粙緇銆傚洜涓洪挓琛ㄦ簮鑳藉闅忔剰閫夋嫨錛屽洜鑰岋紝璇ョ被Timer涓€鑸潎涓嶦ventCounter(鎭舵€т簨浠剁數瀛愯鏁板櫒)鍚堝湪涓€璧

浠g爜緙栫▼璁劇疆I/O鏂逛綅鐨勶細璇ョ被IO鍙g殑閿叆鎴栬幾鍑虹敱紼嬪簭嫻佺▼渚濇嵁鍏蜂綋鐨勫繀欏繪潵寮€灞曡緗紝榪愮敤杈冧負鐏典究錛岃兘澶淇濇寔涓€浜涚郴緇熸€葷嚎綰х殑榪愮敤錛屽I2C緋葷粺鎬葷嚎錛屽悇縐嶅悇鏍稬CD銆丩EDDriver鐨勬搷綰電郴緇熸€葷嚎絳

閽堝IO鍙g殑搴旂敤錛屽叧閿殑涓€鐐瑰姟蹇呴摥璁扮殑鏄細閽堝閿叆鍙o紝鍔″繀鏈夌‘绔嬬殑鐢靛鉤鏁版嵁淇″彿錛屼繚璇佷笉鍙互鎮┖(鑳藉鏍規嵁鎻愬崌涓婃媺鎴栦笅鎷夎彍鍗曠數闃誨櫒鏉ヤ繚鎸;鑰岄拡瀵硅幾鍑哄彛錛屽叾杓稿嚭鐨勬儏鍐電數騫沖姟蹇呰€冭檻鍒板叾澶栫晫鐨勮仈鎺ョ姸鍐碉紝搴旂‘淇濆湪Standby鎴栭潤鎬佹暟鎹儏鍐典笅鎵句笉鍒版媺鐢墊祦閲忔垨鐏岀數嫻侀噺銆/p>

嫻風繑寰數瀛愮鎶€鏈夐檺鍏徃涓撲笟鎻愪緵婀栧寳嫻峰皵鍗曠墖鏈婀栧寳鏉劇堪鍗曠墖鏈婀栧寳涓滆蔣鍗曠墖鏈MOS綆鍙帶紜呯瓑浜у搧錛屾搗緲斿井鐢靛瓙浜у搧綰塊兘澶囨湁澶ч噺搴撳瓨鐜拌揣錛屾墍鏈変駭鍝佷繚璇佸潎鏄師瑁呮鍝佺幆淇濓紝騫舵彁渚涜澶氬崟鐗囨満搴旂敤鏂規錛屾榪庢潵鐢靛挩璇紒