1. gzyueqian
      13352868059
      首頁 > 新聞中心 > > 正文

      使用MCLR管腳作為PIC微處理器的輸出

      更新時間: 2008-01-21 08:57:48來源: 粵嵌教育瀏覽量:1354

        為6管腳微處理器增加一個MOSFET,將復(fù)位/編程引腳轉(zhuǎn)變?yōu)檩敵龉苣_。

        雖然微處理器制造商設(shè)法提供給設(shè)計人員精確合適的產(chǎn)品,但多一個輸出管腳通常是必要的。這種情況在使用8管腳或更少管腳的小型設(shè)計時更加有效。本設(shè)計方案采用Microchip公司PIC10F222。PIC10F222有SOT23-6封裝,提供三個I/O引腳,一個輸入管腳,RAM、flash、和一個ADC模塊。必須規(guī)劃好這些微型處理器,就像那些大型微處理器一樣。為給這些微處理器編程,需要MCLR、兩個I/O管腳(數(shù)據(jù)和時鐘)和供電管腳(VCC和GND)。為進入編程模式,需要MCLR和電源。因為微處理器必須區(qū)分正常和編程模式,而MCLR管腳通常達到約12V電壓才進入編程模式。然后,在正常工作中,可以配置MCLR引腳為外部復(fù)位或僅作為輸入引腳。

        本設(shè)計使用一個模擬輸入和三個輸出引腳。因此,本設(shè)計需要一個額外的輸出引腳。出于這個原因,電路使用MCLR引腳作為輸出。簡單的說,圖1只顯示了GP3/MCLR輸出電路。為允許GP3/MCLR管腳作為輸出使用,電路使用微處理器提供可配置的弱上拉功能。GP3/MCLR管腳的可選功能為輸入,在微處理器配置命令中,必須使能全局弱上拉位。雖然不能分別配置弱上拉,但是這不是問題,因為可以配置其余引腳作為模擬輸入或數(shù)字輸出。
                 


        根據(jù)供電電壓,弱上拉使用20到150 kΩ的電阻,所以這個電路使用晶體管Q1驅(qū)動更高的負載,例如所述的LED。當禁止上拉功能時,R1驅(qū)動晶體管關(guān)閉。因為晶體管門極為電阻驅(qū)動,鎖存頻率由所選的晶體管決定。壞的情形發(fā)生在需要關(guān)閉Q1的時候。R1和Q1的門源極電容決定了晶體管的關(guān)閉時間。

        MCLR管腳的編程電壓大約為12V。因此,Q1必須經(jīng)受門源極電壓高于這個值。本設(shè)計使用能經(jīng)受±18V電壓的MOSFET。出于這個原因,不應(yīng)該使用數(shù)字MOSFET。可以將這個電路用于其它PIC微處理器,對大多數(shù)Freescale公司的RS08KA系列微處理器都適用。

        英文原文:

        Use the MCLR pin as an output with PIC microcontrollers

        Adding a MOSFET to a 6-pin microcontroller transforms its reset/programming pin into an output pin.

        Antonio Muñoz, Laboratorios Avanzados de Investigación, Huesca, Spain, and Pilar Molina, Universidad de Zaragoza, Zaragoza, Spain; Edited by Charles H Small and Fran Granville -- EDN, 1/10/2008

        Although microcontroller manufacturers try to offer designers products that almost exactly fit the needs of their designs, another output pin is often necessary. This situation is particularly true in small designs using microcontrollers with eight pins or fewer. This Design Idea employs the Microchip PIC10F222. The PIC10F222 comes in an SOT23-6 package and offers three I/O pins, one input pin, RAM, flash, and an ADC module. You must program these tiny microcontrollers, just as you do with their big brothers. To program these microcontrollers, you need the MCLR, two I/O pins (data and clock), and supply pins (VCC and GND). To enter programming mode, you need MCLR and supply. Because the microcontroller must differentiate between normal and programming mode, the MCLR pin usually reaches a voltage of approximately 12V to enter programming mode. Thereafter, in normal operation, you can configure the MCLR pin either as an external reset or as an input-only pin.

        This design uses one pin for analog input and the other three as outputs. The design thus requires an additional output. For that reason, this circuit uses the MCLR pin as an output. For simplicity, Figure 1 shows only the GP3/MCLR output circuit. To allow the GP3/MCLR pin to act as an o

        utput, the circuit uses the configurable weak pullups that this microcontroller offers. The selected function for the GP3/MCLR pin is input, and you must enable the global weak-pullup bit in the microcontroller’s configuration word. Although you cannot individually configure weak pullups, this inability is not a problem because you configure all other pins as analog inputs or digital outputs.

        The weak pullups have a resistance of 20 to 150 kΩ, depending on supply voltages, so this circuit uses transistor Q1 to drive higher loads, such as the depicted LED. R1 drives the transistor off when you deactivate the pullups. Because the transistor’s gate is resistance-driven, the maximum toggle frequency depends on the chosen transistor. The worst-case scenario occurs when you need to switch off Q1. R1 and Q1’s gate-to-source capacitance determine the transistor’s switch-off time.

        Programming voltages for the MCLR pin are about 12V. Therefore, Q1 must withstand a gate-to-source voltage higher than this value. This design uses a MOSFET having a ±18V withstand voltage. For this reason, you should not use digital MOSFETs. You can use this circuit with other PIC microcontrollers and with most RS08KA family microcontrollers from Freescale.

      免費預(yù)約試聽課

      亚洲另类欧美综合久久图片区_亚洲中文字幕日产无码2020_欧美日本一区二区三区桃色视频_亚洲AⅤ天堂一区二区三区

      
      

      1. 五月丁香六月婷婷视频播放器 | 在线精品亚洲精品 | 日本精品免费在线视频 | 亚洲精品国产精品乱码无卡 | 思思久久国产精品丝袜 | 中文字幕日韩欧美 |