單片機作為一種微型計算機,其內(nèi)部具有一定的存儲單元(8031除外),但由于其內(nèi)部存儲單元及端口有限,很多情況下難以滿足實際需求。為此介紹一種新的擴展方法,將數(shù)據(jù)線與地址線合并使用,通過軟件控制的方法實現(xiàn)數(shù)據(jù)線與地址線功能的分時轉(zhuǎn)換,數(shù)據(jù)線不僅用于傳送數(shù)據(jù)信號,還可作為地址線、控制線,用于傳送地址信號和控制信號,從而實現(xiàn)單片機與存儲器件的有效連接。以單片機片外256KB數(shù)據(jù)存儲空間的擴展為例,通過該擴展方法,僅用10個I/O端口便可實現(xiàn),與傳統(tǒng)的擴展方法相比,可節(jié)約8個I/O端口。
Abstract:
As a micro-computer,the SCM internal memory has a certain units(except8031),but because of its internal storage units and the ports are limited,in many cases it can not meet the actual demand.So we introduced a new extension method,the data line and address lines combined through software-controlled approach to realize the time-conversion functions of data lines and address lines,so the data lines not only transmited data signals,but also served as address lines and control lines to transmit address signals and control signals,in order to achieve an effective connection of microcontroller and memory chips.Take microcontroller chip with256KB of data storage space expansion as example,through this extension method,with only10I/O ports it was achieved,compared with the traditional extension methods,this method saves8I/O ports.
最近幾年新出的一些MCU,有很多都具有ISP(In System Programming:在系統(tǒng)編程)特性,利用這一特性可以在無需通用編程器的情況下,方便地對芯片執(zhí)行各種操作(擦除,讀取,編程等操作);如果進(jìn)一步配上一些軟件(如Keil的ISD51),即可實現(xiàn)一些簡單的在線調(diào)試功能(當(dāng)然要損失一個串口)。一些開發(fā)者,也經(jīng)常在自己的系統(tǒng)上預(yù)留ISP接口,以供日后升級之用。可以說ISP的廣泛應(yīng)用,標(biāo)志著單片機開發(fā)技術(shù)的進(jìn)步。
但是ISP功能的實現(xiàn)也有一定的限制,如需要一個串口,需要一定的駐留代碼空間,或者需要一定外部電路。于是有一些經(jīng)驗不足的朋友,在實現(xiàn)ISP功能的時候便經(jīng)常出問題,要么是外部電路的問題,要么是串口的問題。比如:為什么軟件老是報“通信出錯”;為什么我的系統(tǒng),第一次可以進(jìn)ISP,第二次就不行了;為什么我在Win98下無法進(jìn)入ISP,換了WinXP就可以了。這些問題總是出現(xiàn)于一些細(xì)微的地方,一些被人忽略的地方,如果你沒有充足的時間,充足的精力,充足的耐心去尋找這些根源;如果你有一臺CP900編程器(當(dāng)然其他的某些編程器也可以);如果你不想在那塊可憐的小電路板上,再擠進(jìn)一堆器件;如果你不想在購料單上再增加一批Max232,或者一批xx型電容,yy型電阻,那么請使用ICP吧(InCircuit Programming:在電路編程)。