3 ϵͳӲ
ΪʹƾиӷԣǶϵͳӲ˾ơ·ϵͳӲ·ҪΪ¶ȵ·̵·ADת··ʾ·֡
3.1 ƬСϵͳ·
3.1.1 Ƭ
AT89S52һֵġCMOS8λ8KϵͳɱFlash洢ڵоƬϣӵɵ8λCPUϵͳɱFlashʹAT89S52ΪڶǶʽӦϵͳṩЧĽ ±ܣ8kֽFlash256ֽRAM 32λIOߣŹʱ2ָ룬16λʱһ62жϽṹȫ˫пڣƬھʱӵ·AT89S52ɽ0Ⱦ̬֧2ѡڵģʽģʽ£CPUֹͣRAMʱڡжϼ籣ʽ£RAMݱ棬ᣬƬһйֱֹͣһжϻӲλΪֹAtmel˾ĸܶȷʧԴ洢ָ빤ҵ80C51ָݡƬڳ洢ظ̣߱洢ϵͳͨSPIпڸдͬõķʧԴ洢дͨͨõ8λCPUصFlashһоƬϣAT89S52ΪһЧͼӦ÷Χ㣬ڽӵĿ⣬ҳɱϵ[10]
3.1.2 Ƭܽ˵
VCCѹ GNDӵء
P0ڣP0Ϊһ8λ©·˫IOڣÿſ8TTLP1ڵĹܽŵһд1ʱΪ롣P0ܹⲿݴ洢ԱΪݵַĵڰλFIASHʱP0 ΪԭڣFIASHУʱP0ԭ룬ʱP0ⲿ뱻ߡ
P1ڣP1һڲṩ8λ˫IOڣP1ڻܽ4TTLŵP1ڹܽд1ڲΪߣ룬P1ڱⲿΪ͵ƽʱڲԵʡFLASH̺УʱP1Ϊڰλַա
P2ڣP2Ϊһڲ8λ˫IOڣP2ڵջʽ4TTL롣P2ڱд1ʱܽűڲߣʱڡP2ʹʱΪڲ裬Щⲿź͵Żһڷⲿ洢16λⲿݴ洢ʱP2ͳ8λַڷ8λַⲿݴ洢ʱP2ϵݣרüĴSFRP2Ĵݣڼ䲻ı䡣ڶFlash̺ͳУڼ䣬P2ҲոλַһЩźš
P3ڣP3ڹܽ8ڲ˫IOڣɽ4TTLŵP3д롰1DZڲΪߵƽ롣P3ʹʱΪڲ裬Щⲿź͵ŻһP3ڻһЩùܣڶFlash̺ͳУڼ䣬P3ͬʱΪ˸̺ͱУһЩźš
RSTλ롣λʱҪRSTڵĸߵƽʱ䡣ŹʱWatchdogŻᱣ98ڵĸߵƽSFR AUXRַ8EHĴеDISRTOλֹܡDISRTOλĬ״̬Ǹλߵƽʹܡ
ALEPROGַźšⲿ洢ʱַƽַĵλֽڡFLASHڼ䣬塣һ£ALEƵʵ6ƵźţⲿʱʱӡⲿڶʱĿġȻҪעǣÿⲿ
ݴ洢ʱһALE塣Ҫʱѵַ8EHеSFRĴ0λΪ1 ӶALEĹʱALEִֻMOVXMOVCָALEá⣬űߡⲿִ״̬ALEֹλЧ
PSEN洢źšⲿ洢ȡָڼ䣬ÿPSENЧڶⲿ洢ڶⲿݴ洢ÿδȡУPSEN2μᱻ
EAVPPⲿȡźšEAֵ͵ƽʱڴڼⲿ洢0000H-FFFFHǷڲ洢עܷʽ1ʱEAڲΪRESETEA˱ָߵƽʱ˼ڲ洢FLASHڼ䣬Ҳʩ12V̵ԴVPP
XTAL1Ŵ뼰ڲʱӹ·롣 XTAL2ķŴ[11]
3.1.3 ƬСϵͳ
AT89S52ƬΪ40˫ֱоƬMCS-51Ƭ48λIOڣP0P1P2P3ÿһIO߶ܶ[12]
ƬСϵͳͼ3-1ʾ,18ź19Žʱӵ·XTAL1ⲿݵһˣƬŴ룬XTAL2ⲿݵһˣƬŴ
9Ϊλˣϵݣ輰غϵ縴λ·20Ϊӵضˣ40ΪԴˡ12MHZڵƬֻƬFlash ROMִڲ洢еָ˵Ƭ31ŽӸߵƽVCCƬСϵͳͼ3-1ʾ
CR310KS1S2R1200VCCU11234567891011P3.212P3.313P3.414P3.515P3.616P3.7171819Y12012MHZP1.0P1.1P1.2P1.3P1.4P1.5P1.6P1.7RETP1.0P1.1P1.2P1.3P1.4P1.5P1.6P1.7RSTP3.0P3.1P3.2P3.3P3.4P3.5P3.6P3.7XTAL2XTAL1GNDAT89C51VCCP0.0P0.1P0.2P0.3P0.4P0.5P0.6P0.7EAALEPEENP2.7P2.6P2.5P2.4P2.3P2.2P2.1P2.0VCCP0.04039383736353433323130292827262524232221P0.0P0.2P0.4P0.6R8220S3+C322ufS4Q1901S5R21KC130PP2.7P2.6P2.5P2.4P2.3P2.2P2.1P2.0P2.0P2.1P2.2C251051051030P VCCͼ3-1 ƬСϵͳ VCCR75.6kLS3.2 DS18B20µ· JP11234adc08328765P3.4P3.5P3.63.2.1 DS18B20 Q59013.7P2.7P2.6P2.5P2.4P2.3510510510510510ƲDS18B20¶ȴôDALLAS뵼幫˾ƳһָĽ¶ȴ봫ͳȲԪȣֱGNDDQCVCDS2DS1820Ӷ¶ȣҿɸʵҪͨıʵ9~12λֵʽ VCC123R233.2.2 DS18B20ܽżĴ˵ (1) DS18B20 GNDź P3.34.7KDQš©߽ӿšڼԴ£Ҳ2ṩԴ 34VDDѡVDDšڼԴʱűӵء (2) DS18B20ص