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
第1章 單片機系統概述1.1 AVR系列單片機的特點1.2 AT90系列單片機簡介第2章 AT90LS8535單片機的基礎知識2.1 AT90LS8535單片機的總體結構2.1.1 AT90LS8535單片機的中央處理器2.1.2 AT90LS8535單片機的存儲器組織2.1.3 AT90LS8535單片機的I/O接口2.1.4 AT90LS8535單片機的內部資源2.1.5 AT90LS8535單片機的時鐘電路2.1.6 AT90LS8535單片機的系統復位2.1.7 AT90LS8535單片機的節電方式2.1.8 AT90LS8535單片機的芯片引腳2.2 AT90LS8535單片機的指令系統2.2.1 匯編指令格式2.2.2 尋址方式2.2.3 偽指令2.2.4 指令類型及數據操作方式2.3 應用程序設計2.3.1 程序設計方法2.3.2 應用程序舉例第3章 AT90LS8535單片機的C編程3.1 支持高級語言編程的AVR系列單片機3.2 AVR的C編譯器3.3 ICC AVR介紹3.3.1 安裝ICC AVR3.3.2 設置ICC AVR3.4 用ICC AVR編寫應用程序3.5 下載程序文件第4章 數據類型、運算符和表達式4.1 ICC AVR支持的數據類型4.2 常量與變量4.2.1 常量4.2.2 變量4.3 AT90LS8535的存儲空間4.4 算術和賦值運算4.4.1 算術運算符和算術表達式4.4.2 賦值運算符和賦值表達式4.5 邏輯運算4.6 關系運算4.7 位操作4.7.1 位邏輯運算4.7.2 移位運算4.8 逗號運算第5章 控制流5.1 C語言的結構化程序設計5.1.1 順序結構5.1.2 選擇結構5.1.3 循環結構5.2 選擇語句5.2.1 if語句5.2.2 switch分支5.2.3 選擇語句的嵌套5.3 循環語句5.3.1 while語句5.3.2 do…while語句5.3.3 for語句5.3.4 循環語句嵌套5.3.5 break語句和continue語句第6章 函數6.1 函數的定義6.1.1 函數的定義的一般形式6.1.2 函數的參數6.1.3 函數的值6.2 函數的調用6.2.1 函數的一般調用6.2.2 函數的遞歸調用6.2.3 函數的嵌套使用6.3 變量的類型及其存儲方式6.3.1 局部變量6.3.2 局部變量的存儲方式6.3.3 全局變量6.3.4 全局變量的存儲方式6.4 內部函數和外部函數6.4.1 內部函數6.4.2 外部函數第7章 指針第8章 結構體和共用體第9章 AT90LS8535的內部資源第10章 AT90LS8535的人機接口編程第11章 AT90LS8535的外圍擴展第12章 AT90LS8535的通信編程第13章 系統設計中的程序處理方法
上傳時間: 2013-10-31
上傳用戶:smthxt
Verilog_HDL的基本語法詳解(夏宇聞版):Verilog HDL是一種用于數字邏輯電路設計的語言。用Verilog HDL描述的電路設計就是該電路的Verilog HDL模型。Verilog HDL既是一種行為描述的語言也是一種結構描述的語言。這也就是說,既可以用電路的功能描述也可以用元器件和它們之間的連接來建立所設計電路的Verilog HDL模型。Verilog模型可以是實際電路的不同級別的抽象。這些抽象的級別和它們對應的模型類型共有以下五種: 系統級(system):用高級語言結構實現設計模塊的外部性能的模型。 算法級(algorithm):用高級語言結構實現設計算法的模型。 RTL級(Register Transfer Level):描述數據在寄存器之間流動和如何處理這些數據的模型。 門級(gate-level):描述邏輯門以及邏輯門之間的連接的模型。 開關級(switch-level):描述器件中三極管和儲存節點以及它們之間連接的模型。 一個復雜電路系統的完整Verilog HDL模型是由若干個Verilog HDL模塊構成的,每一個模塊又可以由若干個子模塊構成。其中有些模塊需要綜合成具體電路,而有些模塊只是與用戶所設計的模塊交互的現存電路或激勵信號源。利用Verilog HDL語言結構所提供的這種功能就可以構造一個模塊間的清晰層次結構來描述極其復雜的大型設計,并對所作設計的邏輯電路進行嚴格的驗證。 Verilog HDL行為描述語言作為一種結構化和過程性的語言,其語法結構非常適合于算法級和RTL級的模型設計。這種行為描述語言具有以下功能: · 可描述順序執行或并行執行的程序結構。 · 用延遲表達式或事件表達式來明確地控制過程的啟動時間。 · 通過命名的事件來觸發其它過程里的激活行為或停止行為。 · 提供了條件、if-else、case、循環程序結構。 · 提供了可帶參數且非零延續時間的任務(task)程序結構。 · 提供了可定義新的操作符的函數結構(function)。 · 提供了用于建立表達式的算術運算符、邏輯運算符、位運算符。 · Verilog HDL語言作為一種結構化的語言也非常適合于門級和開關級的模型設計。因其結構化的特點又使它具有以下功能: - 提供了完整的一套組合型原語(primitive); - 提供了雙向通路和電阻器件的原語; - 可建立MOS器件的電荷分享和電荷衰減動態模型。 Verilog HDL的構造性語句可以精確地建立信號的模型。這是因為在Verilog HDL中,提供了延遲和輸出強度的原語來建立精確程度很高的信號模型。信號值可以有不同的的強度,可以通過設定寬范圍的模糊值來降低不確定條件的影響。 Verilog HDL作為一種高級的硬件描述編程語言,有著類似C語言的風格。其中有許多語句如:if語句、case語句等和C語言中的對應語句十分相似。如果讀者已經掌握C語言編程的基礎,那么學習Verilog HDL并不困難,我們只要對Verilog HDL某些語句的特殊方面著重理解,并加強上機練習就能很好地掌握它,利用它的強大功能來設計復雜的數字邏輯電路。下面我們將對Verilog HDL中的基本語法逐一加以介紹。
標簽: Verilog_HDL
上傳時間: 2013-11-23
上傳用戶:青春給了作業95
Express Mode uses an 8-bit wide bus path for fast configuration of Xilinx FPGAs. Thisapplication note provides information on how to perform Express configuration specifically forthe Spartan™-XL family. The Express mode signals and their associated timing are defined.The steps of Express configuration are described in detail, followed by detailed instructions thatshow how to implement the configuration circui
標簽: Spartan-XL Express XAPP FPGA
上傳時間: 2014-12-28
上傳用戶:hewenzhi
為了在CDMA系統中更好地應用QDPSK數字調制方式,在分析四相相對移相(QDPSK)信號調制解調原理的基礎上,設計了一種QDPSK調制解調電路,它包括串并轉換、差分編碼、四相載波產生和選相、相干解調、差分譯碼和并串轉換電路。在MAX+PLUSⅡ軟件平臺上,進行了編譯和波形仿真。綜合后下載到復雜可編程邏輯器件EPM7128SLC84-15中,測試結果表明,調制電路能正確選相,解調電路輸出數據與QDPSK調制輸入數據完全一致,達到了預期的設計要求。 Abstract: In order to realize the better application of digital modulation mode QDPSK in the CDMA system, a sort of QDPSK modulation-demodulation circuit was designed based on the analysis of QDPSK signal modulation-demodulation principles. It included serial/parallel conversion circuit, differential encoding circuit, four-phase carrier wave produced and phase chosen circuit, coherent demodulation circuit, difference decoding circuit and parallel/serial conversion circuit. And it was compiled and simulated on the MAX+PLUSⅡ software platform,and downloaded into the CPLD of EPM7128SLC84-15.The test result shows that the modulation circuit can exactly choose the phase,and the output data of the demodulator circuit is the same as the input data of the QDPSK modulate. The circuit achieves the prospective requirement of the design.
上傳時間: 2014-01-13
上傳用戶:qoovoop
a8259 可編程中斷控制 altera提供 The a8259 is designed to simplify the implementation of the interrupt interface in 8088 and 8086 based microcomputer systems. The device is known as a programmable interrupt controller. The a8259 receives and prioritizes up to 8 interrupts, and in the cascade mode, this can be expanded up to 64 interrupts. An asynchronous reset and a clock input have been added to improve operation and reliability.
上傳時間: 2014-11-29
上傳用戶:zhyiroy