The PCA9673 provides general purpose remote I/O expansion for most microcontrollerfamilies via the two-line bidirectional bus (I2C-bus) and is a part of the Fast-mode Plusfamily.The PCA9673 is a drop in upgrade for the PCF8575 providing higher Fast-mode Plus(Fm+) I2C-bus speeds (1 MHz versus 400 kHz) so that the output can support PWMdimming of LEDs, higher I2C-bus drive (30 mA versus 3 mA) so that many more devicescan be on the bus without the need for bus buffers, higher total package sink capacity(400 mA versus 100 mA) that supports having all 25 mA LEDs on at the same time andmore device addresses (16 versus 8) are available to allow many more devices on the buswithout address conflicts.
上傳時間: 2013-10-29
上傳用戶:wkchong
The PCA9548A is an octal bidirectional translating switch controlled via the I2C-bus. TheSCL/SDA upstream pair fans out to eight downstream pairs, or channels. Any individualSCx/SDx channel or combination of channels can be selected, determined by thecontents of the programmable control register.An active LOW reset input allows the PCA9548A to recover from a situation where one ofthe downstream I2C-buses is stuck in a LOW state. Pulling the RESET pin LOW resets theI2C-bus state machine and causes all the channels to be deselected as does the internalPower-on reset function.
上傳時間: 2013-10-13
上傳用戶:bakdesec
The PCA9674/74A is a drop-in upgrade for the PCF8574/74A providing higher Fast-modePlus I2C-bus speeds (1 MHz versus 400 kHz) so that the output can support PWMdimming of LEDs, higher I2C-bus drive (30 mA versus 3 mA) so that many more devicescan be on the bus without the need for bus buffers, higher total package sink capacity(200 mA versus 100 mA) that supports having all LEDs on at the same time and moredevice addresses (64 versus 8) are available to allow many more devices on the buswithout address conflicts.
上傳時間: 2013-10-22
上傳用戶:wwwwwen5
單片開關電源最新應用技術:突出實用性,全面系統深入地闡述了單片開關電源的最新應用技術。全書共十二章。第一章為單片開關電源綜述。第二章至第十一章分別介紹了當今國際上最流行的TOPSwitch-Ⅱ系列、TOPSwitch-FX系列、TOPSwitch-GX系列、Tiny Switch-II、LinkSwitch、LinkSwitch-TN、LinkSwitch-HF、DPA-Switch、TEA1520、NCP1050、NCP1000、VIPer12A/22A等系列幾百種單片開關電源的原理與應用。第十二章專門介紹了單片開關電源的設計要點及關鍵元器件選擇。本書充分反映了近年來國內外在該領域的最新科研及應用成果。 第2版前言第一章 單片開關電源綜述第一節 單片開關電源的發展概況及主要特點第二節 單片開關電源的產品分類第三節 單片開關電源的性能指標第二章 TOPSwitch-Ⅱ系列第二代單片開關電源的應用第一節 TOPSwitch-Ⅱ系列單片開關電源的性能特點第二節 TOPSwitch-Ⅱ系列單片開關電源的工作原理第三節 TOPSwitch-Ⅱ系列單片開關電源的快速設計法第四節 TOPSwitch-Ⅱ系列單片開關電源的典型應用第五節 TOPSwitch-Ⅱ系列產品在開關電源模塊中的應用第六節 由TOPSwitch-Ⅱ系列產品構成的特種開關電源第七節 TOPSwitch-Ⅱ系列單片開關電源的設計要點第八節 TOPSwitch-Ⅱ系列單片開關電源的測試技術第三章 TOPSwitch-FX系列第三代單片開關電源的應用第一節 TOPSwitch-FX系列單片開關電源的性能特點第二節 TOPSwitch-FX系列單片開關電源的工作原理第三節 TOPSwitch-FX系列單片開關電源控制電路的設計第四節 TOPSwitch-FX系列單片開關電源的快速設計法第五節 TOPSwitch-FX系列單片開關電源的應用第六節 TOPSwitch-FX系列單片開關電源的設計要點第七節 TOPSwitch-FX系列單片開關電源的測試技術第四章 TOPSwitch-GX系列第四代單片開關電源的應用第一節 TOPSwitch-GX系列單片開關電源的性能特點第二節 TOPSwitch-GX系列單片開關電源的工作原理第三節 TOPSwitch-GX系列單片開關電源的快速設計法第四節 TOPSwitch-GX系列單片開關電源的應用第五節 TOPSwitch-GX系列單片開關電源的設計要點第六節 TOPSwitch-GX系列單片開關電源測試技術第五章 Tiny Switch-II系列第二代微型單片開關電源的應用第一節 Tiny Switch-II系列微型單片開關電源的性能特點第二節 Tiny Switch-II系列微型單片開關電源的工作原理第三節 Tiny Switch-II系列單片開關電源的應用第四節 Tiny Switch-II系列單片開關電源的設計要點及測試技術第六章 LinkSwitch系列單片開關電源的應用第一節 LinkSwitch系列單片開關電源的工作原理第二節 LinkSwitch系列單片開關電源的典型應用第三節 LinkSwitch系列單片開關電源的設計要點第四節 LinkSwitch系列單片開關電源模塊中的應用第七章 LinkSwitch-TN系列單片開關電源的應用第八章 LinkSwitch-HF系列單片開關電源的應用第九章 DPA-Switch系列單片DC/DC電源變換器的應用第十章 TEA1520系列單片開關電源的應用第十一章 NCP1050系列單片開關電源的應用第十二章 單片開關電源的設計要點
上傳時間: 2013-11-23
上傳用戶:liuxinyu2016
C51基本結構程序設計1. 掌握if語句來實現選擇結構,能利用if語句編寫相應的分枝結構的程序。在嵌套if語句中,一定要搞清楚else與哪個if結合的問題。2.掌握switch語句來實現多向分枝選擇結構,能利用switch語句編寫相應的分枝結構的程序。 3. 掌握循環語句的即初始化、循環體、循環控制及結束四個部分,并能進行循環語句的程序設計。分別掌握for 語句、while語句以及do-while語句的使用語法及方法,能利用這三種循環結構進行循環程序設計,理解這三種語句的異同。4.理解并掌握continue、break語句在循環結構和選擇結構中的作用。對于goto語句,理解該語句優缺點。C51語言是結構化編程語言。結構化語言的基本元素是模塊,它是程序的一部分.只有一個出口和一個入口.不允許有偶然的中途插入或以模塊的其它路徑退出。結構化編程語言在沒有妥善保護或恢復堆棧和其它相關的寄存器之前,不應隨便跳入或跳出一個模塊。因此使用這種結構化語言進行編程,當要退出中斷時,堆棧不會因為程序使用了任何可以接受的命令而崩潰。 結構化程序由若干模塊組成,每個模塊中包含著若干個基本結構,而每個基本結構中可以有若干條語句。歸納起來,C51程序有順序結構、選擇結構、循環結構共三種結構。
上傳時間: 2013-11-01
上傳用戶:四只眼
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.
標簽: synchronous Emulating serial
上傳時間: 2014-01-31
上傳用戶:z1191176801
Internal Interrupts are used to respond to asynchronous requests from a certain part of themicrocontroller that needs to be serviced. Each peripheral in the TriCore as well as theBus Control Unit, the Debug Unit, the Peripheral Control Processor (PCP) and the CPUitself can generate an Interrupt Request.So what is an external Interrupt?An external Interrupt is something alike as the internal Interrupt. The difference is that anexternal Interrupt request is caused by an external event. Normally this would be a pulseon Port0 or Port1, but it can be even a signal from the input buffer of the SSC, indicatingthat a service is requested.The User’s Manual does not explain this aspect in detail so this ApNote will explain themost common form of an external Interrupt request. This ApNote will show that there is aneasy way to react on a pulse on Port0 or Port1 and to create with this impulse an InterruptService Request. Later in the second part of the document, you can find hints on how todebounce impulses to enable the use of a simple switch as the input device.Note: You will find additional information on how to setup the Interrupt System in theApNote “First steps through the TriCore Interrupt System” (AP3222xx)1. It would gobeyond the scope of this document to explain this here, but you will find selfexplanatoryexamples later on.
上傳時間: 2013-10-27
上傳用戶:zhangyigenius
The Infineon TriCore provides an Interrupt System with a high safety standard. Thisdocument contains some instructions on how to initiate an Interrupt from an externaldevice. First it will show you how to trigger an Interrupt Service Request by an impulseon Port 0 or Port 1. Then in the second part of the document you can find hints how todebounce impulses to enable the use of a simple switch as input device.Authors: Thomas Bliem, CQ Nguyen / Infineon SMI MD Apps
上傳時間: 2013-11-05
上傳用戶:uuuuuuu
Presents short and simple I2C software routines that support onlyslave (rather than master or master & slave) operation and an ASMdemonstration program. The slave-only software in this app notecomplements the master mode software presented in AN464, Usingthe 87LPC76X microcontroller as an I2C bus master.
上傳時間: 2013-11-22
上傳用戶:1039312764
有兩種方式可以讓設備和應用程序之間聯系:1. 通過為設備創建的一個符號鏈;2. 通過輸出到一個接口WDM驅動程序建議使用輸出到一個接口而不推薦使用創建符號鏈的方法。這個接口保證PDO的安全,也保證安全地創建一個惟一的、獨立于語言的訪問設備的方法。一個應用程序使用Win32APIs來調用設備。在某個Win32 APIs和設備對象的分發函數之間存在一個映射關系。獲得對設備對象訪問的第一步就是打開一個設備對象的句柄。 用符號鏈打開一個設備的句柄為了打開一個設備,應用程序需要使用CreateFile。如果該設備有一個符號鏈出口,應用程序可以用下面這個例子的形式打開句柄:hDevice = CreateFile("\\\\.\\OMNIPORT3", GENERIC_READ | GENERIC_WRITE,FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL ,NULL);文件路徑名的前綴“\\.\”告訴系統本調用希望打開一個設備。這個設備必須有一個符號鏈,以便應用程序能夠打開它。有關細節查看有關Kdevice和CreateLink的內容。在上述調用中第一個參數中前綴后的部分就是這個符號鏈的名字。注意:CreatFile中的第一個參數不是Windows 98/2000中驅動程序(.sys文件)的路徑。是到設備對象的符號鏈。如果使用DriverWizard產生驅動程序,它通常使用類KunitizedName來構成設備的符號鏈。這意味著符號鏈名有一個附加的數字,通常是0。例如:如果鏈接名稱的主干是L“TestDevice”那么在CreateFile中的串就該是“\\\\.\\TestDevice0”。如果應用程序需要被覆蓋的I/O,第六個參數(Flags)必須或上FILE_FLAG_OVERLAPPED。 使用一個輸出接口打開句柄用這種方式打開一個句柄會稍微麻煩一些。DriverWorks庫提供兩個助手類來使獲得對該接口的訪問容易一些,這兩個類是CDeviceInterface, 和 CdeviceInterfaceClass。CdeviceInterfaceClass類封裝了一個設備信息集,該信息集包含了特殊類中的所有設備接口信息。應用程序能有用CdeviceInterfaceClass類的一個實例來獲得一個或更多的CdeviceInterface類的實例。CdeviceInterface類是一個單一設備接口的抽象。它的成員函數DevicePath()返回一個路徑名的指針,該指針可以在CreateFile中使用來打開設備。下面用一個小例子來顯示這些類最基本的使用方法:extern GUID TestGuid;HANDLE OpenByInterface( GUID* pClassGuid, DWORD instance, PDWORD pError){ CDeviceInterfaceClass DevClass(pClassGuid, pError); if (*pError != ERROR_SUCCESS) return INVALID_HANDLE_VALUE; CDeviceInterface DevInterface(&DevClass, instance, pError); if (*pError != ERROR_SUCCESS) return INVALID_HANDLE_VALUE; cout << "The device path is " << DevInterface.DevicePath() << endl; HANDLE hDev; hDev = CreateFile( DevInterface.DevicePath(), GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL ); if (hDev == INVALID_HANDLE_VALUE) *pError = GetLastError(); return hDev;} 在設備中執行I/O操作一旦應用程序獲得一個有效的設備句柄,它就能使用Win32 APIs來產生到設備對象的IRPs。下面的表顯示了這種對應關系。Win32 API DRIVER_FUNCTION_xxxIRP_MJ_xxx KDevice subclass member function CreateFile CREATE Create ReadFile READ Read WriteFile WRITE Write DeviceIoControl DEVICE_CONTROL DeviceControl CloseHandle CLOSECLEANUP CloseCleanUp 需要解釋一下設備類成員的Close和CleanUp:CreateFile使內核為設備創建一個新的文件對象。這使得多個句柄可以映射同一個文件對象。當這個文件對象的最后一個用戶級句柄被撤銷后,I/O管理器調用CleanUp。當沒有任何用戶級和核心級的對文件對象的訪問的時候,I/O管理器調用Close。如果被打開的設備不支持指定的功能,則調用相應的Win32將引起錯誤(無效功能)。以前為Windows95編寫的VxD的應用程序代碼中可能會在打開設備的時候使用FILE_FLAG_DELETE_ON_CLOSE屬性。在Windows NT/2000中,建議不要使用這個屬性,因為它將導致沒有特權的用戶企圖打開這個設備,這是不可能成功的。I/O管理器將ReadFile和WriteFile的buff參數轉換成IRP域的方法依賴于設備對象的屬性。當設備設置DO_DIRECT_IO標志,I/O管理器將buff鎖住在存儲器中,并且創建了一個存儲在IRP中的MDL域。一個設備可以通過調用Kirp::Mdl來存取MDL。當設備設置DO_BUFFERED_IO標志,設備對象分別通過KIrp::BufferedReadDest或 KIrp::BufferedWriteSource為讀或寫操作獲得buff地址。當設備不設置DO_BUFFERED_IO標志也不設置DO_DIRECT_IO,內核設置IRP 的UserBuffer域來對應ReadFile或WriteFile中的buff參數。然而,存儲區并沒有被鎖住而且地址只對調用進程有效。驅動程序可以使用KIrp::UserBuffer來存取IRP域。對于DeviceIoControl調用,buffer參數的轉換依賴于特殊的I/O控制代碼,它不在設備對象的特性中。宏CTL_CODE(在winioctl.h中定義)用來構造控制代碼。這個宏的其中一個參數指明緩沖方法是METHOD_BUFFERED, METHOD_IN_DIRECT, METHOD_OUT_DIRECT, 或METHOD_NEITHER。下面的表顯示了這些方法和與之對應的能獲得輸入緩沖與輸出緩沖的KIrp中的成員函數:Method Input Buffer Parameter Output Buffer Parameter METHOD_BUFFERED KIrp::IoctlBuffer KIrp::IoctlBuffer METHOD_IN_DIRECT KIrp::IoctlBuffer KIrp::Mdl METHOD_OUT_DIRECT KIrp::IoctlBuffer KIrp::Mdl METHOD_NEITHER KIrp::IoctlType3InputBuffer KIrp::UserBuffer 如果控制代碼指明METHOD_BUFFERED,系統分配一個單一的緩沖來作為輸入與輸出。驅動程序必須在向輸出緩沖放數據之前拷貝輸入數據。驅動程序通過調用KIrp::IoctlBuffer獲得緩沖地址。在完成時,I/O管理器從系統緩沖拷貝數據到提供給Ring 3級調用者使用的緩沖中。驅動程序必須在結束前存儲拷貝到IRP的Information成員中的數據個數。如果控制代碼不指明METHOD_IN_DIRECT或METHOD_OUT_DIRECT,則DeviceIoControl的參數呈現不同的含義。參數InputBuffer被拷貝到一個系統緩沖,這個緩沖驅動程序可以通過調用KIrp::IoctlBuffer。參數OutputBuffer被映射到KMemory對象,驅動程序對這個對象的訪問通過調用KIrp::Mdl來實現。對于METHOD_OUT_DIRECT,調用者必須有對緩沖的寫訪問權限。注意,對METHOD_NEITHER,內核只提供虛擬地址;它不會做映射來配置緩沖。虛擬地址只對調用進程有效。這里是一個用METHOD_BUFFERED的例子:首先,使用宏CTL_CODE來定義一個IOCTL代碼:#define IOCTL_MYDEV_GET_FIRMWARE_REV \CTL_CODE (FILE_DEVICE_UNKNOWN,0,METHOD_BUFFERED,FILE_ANY_ACCESS)現在使用一個DeviceIoControl調用:BOOLEAN b;CHAR FirmwareRev[60];ULONG FirmwareRevSize;b = DeviceIoControl(hDevice, IOCTL_MYDEV_GET_VERSION_STRING, NULL, // no input 注意,這里放的是包含有執行操作命令的字符串指針 0, FirmwareRev, //這里是output串指針,存放從驅動程序中返回的字符串。sizeof(FirmwareRev),& FirmwareRevSize, NULL // not overlapped I/O );如果輸出緩沖足夠大,設備拷貝串到里面并將拷貝的資結束設置到FirmwareRevSize中。在驅動程序中,代碼看起來如下所示:const char* FIRMWARE_REV = "FW 16.33 v5";NTSTATUS MyDevice::DeviceControl( KIrp I ){ ULONG fwLength=0; switch ( I.IoctlCode() ) { case IOCTL_MYDEV_GET_FIRMWARE_REV: fwLength = strlen(FIRMWARE_REV)+1; if (I.IoctlOutputBufferSize() >= fwLength) { strcpy((PCHAR)I.IoctlBuffer(),FIRMWARE_REV); I.Information() = fwLength; return I.Complete(STATUS_SUCCESS); } else { } case . . . } }
上傳時間: 2013-10-17
上傳用戶:gai928943