新穎實(shí)用的單片機(jī)雙積分A/D轉(zhuǎn)換電路和軟件:摘 要: 通過(guò)對(duì)雙積分A/ D 轉(zhuǎn)換過(guò)程及其原理的分析,結(jié)合8031 單片機(jī)定時(shí)計(jì)數(shù)器的特點(diǎn),設(shè)計(jì)出一種新的A/ D 轉(zhuǎn)換電路. 詳細(xì)介紹了這種轉(zhuǎn)換電路的硬件原理及工作過(guò)程,給出了實(shí)用的硬件電路與軟件設(shè)計(jì)框圖. 通過(guò)比較分析,可以看出這種A/ D 轉(zhuǎn)換電路性能價(jià)格比較高,軟件編程簡(jiǎn)單,并且轉(zhuǎn)換速度和精度優(yōu)于一般的A/ D 轉(zhuǎn)換電路. 這種設(shè)計(jì)思路為數(shù)模轉(zhuǎn)換器(A/ D) 的升級(jí)提高指出一個(gè)明確的方向.關(guān)鍵詞:單片機(jī); 定時(shí)/ 計(jì)數(shù)器; A/ D 轉(zhuǎn)換; 雙積分
雙積分A/ D 及定時(shí)計(jì)數(shù)器原理:我們先分析雙積分A/ D 轉(zhuǎn)換的工作原理. 如圖1 所示,積分器先以固定時(shí)間T 對(duì)待測(cè)的輸入模擬電壓Vi 進(jìn)行正向積分,積分電容C 積累的電荷為
The C500 microcontroller family usually provides only one on-chip synchronous serialchannel (SSC). If a second SSC is required, an emulation of the missing interface mayhelp to avoid an external hardware solution with additional electronic components.The solution presented in this paper and in the attached source files emulates the mostimportant SSC functions by using optimized SW routines with a performance up to 25KBaud in Slave Mode with half duplex transmission and an overhead less than 60% atSAB C513 with 12 MHz. Due to the implementation in C this performance is not the limitof the chip. A pure implementation in assembler will result in a strong reduction of theCPU load and therefore increase the maximum speed of the interface. In addition,microcontrollers like the SAB C505 will speed up the interface by a factor of two becauseof an optimized architecture compared with the SAB C513.Moreover, this solution lays stress on using as few on-chip hardware resources aspossible. A more excessive consumption of those resources will result in a highermaximum speed of the emulated interface.Due to the restricted performance of an 8 bit microcontroller a pin compatible solution isprovided only; the internal register based programming interface is replaced by a set ofsubroutine calls.The attached source files also contain a test shell, which demonstrates how to exchangeinformation between an on-chip HW-SSC and the emulated SW-SSC via 5 external wiresin different operation modes. It is based on the SAB C513 (Siemens 8 bit microcontroller).A table with load measurements is presented to give an indication for the fraction of CPUperformance required by software for emulating the SSC.
The MC68HC05K0 is a low cost, low pin countsingle chip microcomputer with 504 bytes of userROM and 32 bytes of RAM. The MC68HC05K0 isa member of the 68HC05K series of devices whichare available in 16-pin DIL or SOIC packages.It uses the same CPU as the other devices in the68HC05 family and has the same instructions andregisters. Additionally, the device has a 15-stagemulti-function timer and 10 general purposebi-directional I/0 lines. A mask option is availablefor software programmable pull-downs on all ofthe I/O pins and four of the pins are capable ofgenerating interrupts.The device is ideally suited for remote-controlkeyboard applications because the pull-downs andthe interrupt drivers on the port pins allowkeyboards to be built without any externalcomponents except the keys themselves. There isno need for external pull-up or pull-down resistors,or diodes for wired-OR interrupts, as these featuresare already designed into the device.
The STWD100 watchdog timer circuits are self-contained devices which prevent systemfailures that are caused by certain types of hardware errors (non-responding peripherals,bus contention, etc.) or software errors (bad code jump, code stuck in loop, etc.).The STWD100 watchdog timer has an input, WDI, and an output, WDO (see Figure 2). Theinput is used to clear the internal watchdog timer periodically within the specified timeoutperiod, twd (see Section 3: Watchdog timing). While the system is operating correctly, itperiodically toggles the watchdog input, WDI. If the system fails, the watchdog timer is notreset, a system alert is generated and the watchdog output, WDO, is asserted (seeSection 3: Watchdog timing).The STWD100 circuit also has an enable pin, EN (see Figure 2), which can enable ordisable the watchdog functionality. The EN pin is connected to the internal pull-downresistor. The device is enabled if the EN pin is left floating.