基于MSP430的U盘设计
基于MSP430的U盘设计
分类号:TPxx U D C:D10621-408-xxxxx 1600-0密级:公开编号:2009xxxxxx基于MSP430地U盘设计论文作者姓名:x x申请学位专业:自动化申请学位类别:工学学士指导教师姓名(职称):xxx(讲师)论文提交日期:2013年x月x日分类号:TPxx U D C:D10621-408-xxxx 1600-0密级:公开编号:2009xxxx成都信息工程学院学位论文基于MSP430地U盘设计x x论文作者姓名:自动化申请学位专业:工学学士申请学位类别:xxx(讲师)指导教师姓名(职称):论文提交日期:2013年xx月xx日基于MSP430地U盘设计摘要随着科学技术地快速发展,人们生活水平地提高,信息化程度地提高,信息地传输交换需求也就越来越多.在科学技术迅猛发展地今天,U盘已经成为了主流地数据储存产品,它满足了我们对数据储存地需求,实现了便携式移动存储、大大提高了办公效率,使人们生活更便捷.而且此装置小巧,方便携带,适用于各种场合,其应用前景和经济效益都很看好.因此,设计稳定、低功耗地数据储存器件就显得非常重要了.本次研究设计地U盘是基于高速低功耗地MSP430单片机,采用串行外设协议总线结构对SD卡中地数据进行读写操作并通过USB接口与PC端进行数据传输,U盘内存2G,系统地功耗低,供电电压 3.3V.整个系统地功能实现了U盘与电脑之间地通讯.这种方法简单、便于操作、综合成本较低,具有较大地推广应用价值.其中,因SD卡具有体积小、功耗低地优势,所以在本设计中采用SD卡作为储存器件.关键词:MSP430;U盘;SD卡;读卡器The U disk design of a MSP430-basedAbstractWith the rapid development of science and technology, people living standard rise, the informatization degree rise, information exchange of transport demand is also more and more. In the rapid development of science and technology today, U disk has become the mainstream of data storage products, it satisfies our demand for data storage, implements the portable mobile storage, greatly improve the office efficiency, make life more convenient. And the device is small and portable, suitable for various occasions, the application prospect and economic benefit are look good. Design, therefore, stable, low power consumption of data storage devices is very important.The study in the design of the USB flash drive is based on the high-speed low-power MSP430 MCU, using serial peripheral agreement bus structure on the data in the SD card read and write operations and through the USB interface with PC for data transmission, 2 g USB memory, system of low power consumption, power supply voltage of 3.3 V. The function of the whole system has realized the communication between usb and computer. This method is simple, easy to operate, low comprehensive cost, has great popularization and application value. Among them, because the SD card with the advantages of small volume, low power consumption, soin this design using SD card as storage devices.Key words: MSP430。
MSP430与USB的连接
Application ReportSLAA276 –November 2005MSP430 USB Connectivity using TUSB3410 Andreas Dannenberg MSP430ABSTRACTThis application report presents a ready-to-use USB connectivity reference design forMSP430 microcontrollers using the Texas Instruments TUSB3410 USB-to-serial bridgecontroller. The provided solution enables high-speed data transfers with speeds of up to921,600 bit/s as well as MSP430 Flash code download through the USB port. Thereference design includes MSP430 and PC software, drivers, schematics, layout, andBOM information.Contents1Introduction (3)2Design Decisions And USB Configuration (4)3Reference Design Hardware (5)4Reference Design Software (7)4.1Overview (7)4.2MSP430 Demo Firmware (7)4.3PC Demo Application (10)4.4Customized Bootstrap Loader Tool (12)5Reference Design USB Drivers (14)5.1Overview (14)5.2Manual Driver Installation (14)5.3Standard TUSB3410 Driver (15)5.4Custom MSP430-TUSB3410 Reference Design Driver (16)5.5Automated Driver Installer (16)6Lower-Cost Options (16)6.1No External EEPROM (16)6.2No External MSP430 Crystal (17)7Summary (17)8References (18)Appendix A. Schematics (19)Appendix B. Board Layout (21)Appendix C. Bill Of Material (23)1SLAA276FiguresFigure 1.MSP430-TUSB Reference Design Overview (3)Figure 2.MSP430 Demo Firmware main() Flow (8)Figure 3.MSP430 Demo Firmware Interrupt Handler Flow (9)Figure 4.PC Demo Application Flow (11)Figure 5.Found New Hardware Wizard (14)Figure 6.Device Manager After Driver Install (15)Figure 7.PCB Layout Component Side (21)Figure 8.PCB Layout Solder Side (21)Figure 9.PCB Component Placement (22)TablesTable 1.Reference Design USB Setup (4)Table 2.MSP430-TUSB3410 Signal Connections (6)Table 3.ZIP Archive Contents Overview (7)2MSP430 USB Connectivity using TUSB3410SLAA276MSP430 USB Connectivity using TUSB3410 31 IntroductionTo enable USB connectivity for MSP430 devices, the Texas Instruments TUSB3410 USB-to-serial bridge controller can be used. The TUSB3410 is USB 2.0 full speed compliant and supports baud rates from 50 Baud up to 921.6 kBaud. It has a built-in 8052 CPU that can execute custom firmware. Both self and USB-powered applications are supported. UART, handshake, and GPIO pins provide a variety of interface options.Figure 1. MSP430-TUSB Reference Design OverviewFigure 1 shows the block diagram of the USB connectivity solution presented in this application report. Note that this is a proposal only, and it is not in the scope of this document to cover every aspect of a possible implementation.The connection between host PC and MSP430 is established through a full-duplex UART link. On the PC side, a virtual COM port (VCP) provided by the TUSB3410 driver suite is used to exchange data with the MSP430 hardware USART module. This process is straightforward by using standard Windows API calls on the PC side and MSP430 USART accesses. All underlying USB transfers are transparent for both PC and MSP430 applications.The MSP430-TUSB3410 reference design is a bus-powered USB device, and is capable of programming a blank MSP430 through the USB via the bootstrap loader (BSL). Furthermore, the TUSB3410 configuration EEPROM can be programmed in-system through the MSP430 via I 2C.SLAA276Both PC and MSP430 demonstration software is provided along with this application report to offer a complete end-to-end turnkey solution. Bi-directional data transfer is demonstrated byhaving the PC and the MSP430 displaying each others’ key and push-button status.Note: The software and drivers provided with this application note are for use with PCs running Windows XP™ or Windows 2000™. Older versions of Windows are not supported by thisapplication note.2Design Decisions And USB ConfigurationThe TUSB3410 supports a variety of different application setups such as:•Use as UART-type device•Use as standard Windows class-type device•Use as custom device•Firmware storage on host PC•Firmware storage on external EEPROM•Device serializationA detailed overview of the different TUSB3410 operating scenarios can be found in [6]. For theMSP430-TUSB3410 reference design, the following configuration setup is used:Table 1.Reference Design USB SetupItem ValueTUSB3410 usage UART-type deviceTUSB3410 firmware location Host PCDevice serialization Not usedVendor ID 0x0451Product ID 0xbeefManufacturer descriptor string “Texas Instruments”Product descriptor string "MSP430-TUSB3410 Reference Design"More information on using the TUSB3410 as a UART-type device can be found in [9].For USB compliance, any USB product must have a unique vendor ID and product ID. The OS uses the VID/PID combination to determine what driver to load. The VID and PID are reported to the USB host in the USB device descriptor when this descriptor is requested by the host. Aunique VID can be obtained from the USB Implementers Forum (). A product ID can be whatever a vendor chooses, but since the VID/PID pair determines what driver is loaded, the same PID should not be given to two different products. Also, these values must match to host values stored in the driver INF-files. See chapter 5 for more information.Using the TUSB3410, an external EEPROM must be used for parameter storage. The I2Cmodule of MSP430F16xx-type devices is not able to emulate this external EEPROM due tolimitations of the TUSB3410 I2C implementation.4MSP430 USB Connectivity using TUSB3410SLAA276 To generate a vendor specific EEPROM image for use with the TUSB3410, TI provides aheader generator utility for download [10]. This tool expects a configuration file (*.cfg) as input which defines the EEPROM image contents and contains vendor specific details, such asVID/PID reported by the USB device to the host. Example configuration files are provided along with the tool and can be modified using a text editor. The output of the header generator utility isa binary EEPROM image file (*.bin). The configuration file and the associated binary image usedwith the MSP430-TUSB3410 reference design is provided with this application report (see Table3). Here, the binary output file was converted into a C-compiler constant and directly includedinto the MSP430 firmware. This enables EEPROM programming at MSP430 application runtime, eliminating the need for an external EEPROM programmer. See section 4.2 for moreinformation. Note that TI also provides a tool that allows programming of a blank EEPROMdirectly over the USB through the TUSB3410 [7].3Reference Design HardwareThe schematics of the MSP430-TUSB3410 reference design can be found in Appendix A. Also, PCB layout and BOM information can be found in Appendix B and Appendix C. The two maincomponents which can be identified are the TUSB3410 USB-to-serial bridge controller (U1), and the MSP430F1612 (U2). The MSP430 choice is somewhat arbitrary as almost any MSP430 can be used to interface with the TUSB3410. However, the use of a hardware USART module isrecommended. This particular higher-end MSP430 device was selected to allow more flexibility during evaluation and code development.The TUSB3410 USB data lines are connected to a standard USB B-type PCB mount connector.TI’s transient voltage suppressor SN75240 (U3) is used on the USB lines to provide anincreased level of ESD protection.The reference design hardware is designed as a bus-powered USB application. The USBsupplies 5-V on each port and devices can generally draw up to 100-mA from the bus withoutany special considerations. However, up to 500-mA can be made available by the host uponrequest. Here, a TI TPS377301 LDO is used (U4) to generate 3.6-V with a maximum outputcurrent of 250-mA. This supply voltage is used to power the entire circuit. LED5 is illuminatedwhen power is supplied by the USB.For this reference design, the MSP430 is operated at 8-MHz. This clock is provided by Q1 which is connected to the LFXT1 oscillator. All MSP430 port pins of ports 1 through 6 are brought out on 8-pin headers. This allows easy access to the signals used to communicate with theTUSB3410 as well as for attaching any custom circuitry. Furthermore, four push-buttonsSW1…SW4 and four LEDs LED1…LED4 are connected to I/O port 4 for demonstrationpurposes. An MSP430-standard 14-pin JTAG header is provided for in-system debugging and programming. Note that the board’s VCC is routed to pin 4 of the JTAG connector to allow the JTAG debugger to adjust its voltage levels.MSP430 USB Connectivity using TUSB34105SLAA276The circuitry externally to the TUSB3410 has been designed according to [3], [4], and [8]. This reference design uses an external EEPROM (U5) with I2C interface for USB configurationparameter storage. The EEPROM size can be selected according the amount of data that needs to be stored. More information on EEPROM selection can be found in [9]. Note that there is a jumper (JP1) in the EEPROM SCL line that allows disconnecting the EEPROM. In this case, the TUSB3410 would report its standard VID/PID values to the host upon USB connection. The 12-MHz crystal Q2 provides the required clock for device operation. Table 2 shows the signalconnections made between TUSB3410 and MSP430.Table 2.MSP430-TUSB3410 Signal ConnectionsMSP430 Signal TUSB3410 Signal DescriptionP3.5/URXD0 SOUT Data received from the USB.P3.4/UTXD0 SIN Data send to the USBP2.2/TA0† SOUT Receive data connection for BSL.P1.1/TA0† SIN Transmit data connection for BSL.P3.1/SIMO0/SDA† SDA I2C data line. Also connected to EEPROM (U5).P3.3/UCLK0/SCL† SCL I2C clock line. Also connected to EEPROM (U5).P3.0/STE0† RESET Signal allows controlling the TUSB3410 operation.XT2IN CLKOUT‡ Allows TUSB3410 clock output to be used for the MSP430.RST/NMI† DTR Reset connection used for BSL entry.TCK† RTS JTAG TCK connected used for BSL entry.P1.6/TA1 DSR‡ UART hardware handshake signal.P1.7/TA2 CTS‡ UART hardware handshake signal.†The MSP430 can be disconnected from this signal by not populating a 0R resistor. See application schematic for details.‡This signal is not used by the software provided with this application report.For the actual data transmission, the MSP430 USART0 module is used in UART mode. It can handle all baud rates supported by the TUSB3410. This module is also used as an I2C mode for communication with the EEPROM. This enables in-system programming of the externalEEPROM through the MSP430 and eliminates the need of using an external EEPROMprogrammer. This method is used by the software provided here. Note that these connections are optional, and that an I2C master can easily be implemented with GPIO pins on any MSP430.As a design idea, available EEPROM space could also be used as additional MSP430 storage.In addition to the serial connections to USART0, the same signals are also connected to theMSP430 BSL pins. This way, a blank MSP430 can be programmed through the USB UART link.Refer to section 4.4 for more information.The connection from the MSP430 P3.0/STE0 pin to the TUSB3410 RESET pin allows keeping the TUSB3410 in reset state while the MSP430 is accessing the EEPROM. Also, by cycling this signal, a USB unplug-replug event can be generated without actually disconnecting theapplication PCB.6MSP430 USB Connectivity using TUSB3410SLAA276 4Reference Design Software4.1OverviewThe ZIP archive associated with this application report contains a variety of different files. Table3 provides an overview.Table 3.ZIP Archive Contents OverviewFolder / File(s) DescriptionEXE\TUSB3410Demo.exe PC demo applicationEXE\BSLDEMO.exe BSL software, modified for code download through USBEXE\DemoFirmware.txt MSP430 demo firmware image in MSP430-TXT formatEXE\FET1.txt MSP430 flashing LED demo software image in MSP430-TXT formatGERBERS\*.* Board layout files in Gerber formatMSP430_SW_CCE\*.* Code Composer Essentials V1.0 MSP430 source codeMSP430_SW_IAR\*.* IAR Embedded Workbench V3.30B MSP430 source codeMSP430_TUSB3410_2KXP_V103\*.* Windows VCP driver for MSP430-TUSB3410 reference designORIG_TUSB3410_2KXP_V103\*.* Windows standard TUSB3410 driverPC_BSL\*.* Microsoft Visual C++ source code of BSL softwarePC_DEMO\*.* Microsoft Visual C++ source code of PC demo softwareTUSB3410_EEPROM\*.* EEPROM image used for MSP430-TUSB3410 reference design4.2MSP430 Demo FirmwareThe MSP430 software provided with this application report is contained in the single C file“MSP430-TUSB3410_Demo.c”. Versions for use with IAR Embedded Workbench and TI’s Code Composer Essentials are included. The software demonstrates in-system EEPROMprogramming (U5) and serial communication with 460,800 Baud. The lower nibble of a received character is output to the LEDs on the demo board, and on press or release of any push-button,a byte is transmitted to the PC containing the updated button state. The software is intended tobe used together with the PC software as presented in section 4.3, but can also be used tocommunicate with any terminal software such as HyperTerm. Figure 2 and Figure 3 give anoverview about the software flow.Upon MSP430 reset, the function InitSystem() is called to configure used peripherals and theapplication board. Watchdog timer and I/O ports are set up for proper use, and the clock system is set up to operate from the external crystal with a frequency of 8-MHz. Furthermore, USART0 is set up for I2C operation which will be used for communication with the EEPROM. Refer to [1] for more information on MSP430 module operation.MSP430 USB Connectivity using TUSB34107SLAA2768MSP430 USB Connectivity using TUSB3410SLAA276MSP430 USB Connectivity using TUSB34109SLAA276After the system initialization, the main() function will then configure the Timer_B7 module of the MSP430F1612 to be used to query the status of the push-buttons SW1…SW4. The capture/compare (CC) blocks which are connected to the push-button signal lines are set up to capture the rising edge and generate an interrupt. The TIMERB0_ISR() and TIMERB1_ISR() functions will get executed upon button press and switch the CC block in question to compare mode, thus effectively polling the button state with a defined interval. This way, an effective button-queryand de-bounce is implemented. The three flag variables ButtonState, ButtonSet, andButtonReleased are used to indicate to the main() program context any push-button statuschange. Furthermore, the CPU is woken-up on any push-button events. This is used toimplement event-driven program flow.After Timer_B7 setup, the USART0 module receive interrupt is activated and the main eventhandling loop is entered. The program resides in low-power mode 0 (all clocks are on, CPU is off) until an event occurs. On any button event, the updated button state is transmitted byloading the variable ButtonState into the USART0 transmit buffer. Note that data is onlytransmitted if there is an actual change in the state of any push-button. If a UART character is received, LED1…LED4 are set according to the lower nibble of the received byte.In a custom application where more data is moved over the USB, the MSP430 DMA controller could be used to enable fast and low CPU overhead movement of large data blocks.Furthermore, USB devices usually buffer bytes before actually transmitting them; thereforetransferring data in blocks rather than byte-by-byte will be faster.4.3PC Demo ApplicationThe PC demo application provided with this application report is designed to work together with the MSP430 firmware described in section 4.2. It is written as a Windows 32-Bit consoleapplication and runs under Windows XP and 2000. The application’s source code is contained ina single file, also included. It was successfully built under both Microsoft Visual C++ and BorlandC++.The purpose of this program is to demonstrate how the MSP430-TUSB3410 reference design hardware can be automatically detected and used. The auto-detection feature makes thissolution more user friendly as the need for manual inspection of the Windows device manager for the board’s associated VCP number is removed. The keys <1>…<4> are used to light the corresponding LEDs on the reference design board, and push-button presses on the demoboard are output to the console. Figure 4 gives an overview about the program operation.10MSP430 USB Connectivity using TUSB3410Figure 4.PC Demo Application FlowThe program is started by executing “TUSB3410Demo.exe”. After outputting a welcome message, the demo program calls the function EnumComPorts(). This function is used to identify which COMnn port[s] are attached to the Texas Instruments TUSB3410 Universal Multiport (UMP) controller. On the initial function call with the parameter dwIndex set to 0, it enumerates all currently connected serial communication devices (GUID_CLASS_COMPORT). Then, it checks the hardware ID (HWID) of the virtual COM port (stored in the TUSB3410 driver INF-files) and returns the COMnn port which Windows embeds in the "Friendly Name". The TUSB3410 drivers include the ability to customize the "Friendly Name" before the "(COMnn)", and the HWID after the "umpport\".The HWID search string is contained in the local constant szHardwareIDUmp[] within theEnumComPorts() function. For this reference design, it is set to"umpport\VID_0451_BEEF_com", as this corresponds with the entries made in the TUSB3410 driver INF-file (see section 5.4). This constant needs to be customized for different USB devices.EnumComPorts() returns a result code that indicates if the device referred to with the list index dwIndex matches the HWID. Subsequent calls to EnumComPorts() can be used to identify all connected devices. A return value of ERROR_SUCCESS indicates a match and the parameter lpszName contains the associated COM port. The code ERROR_NO_MORE_ITEMS indicates that the end of the enumeration list has been reached. EnumComPorts() uses the WindowsSetupAPI for reading out low-level device interface data. Note that this requires the library“setupapi.lib” to be linked to the project for a successful build. More information on SetupAPI can be found in the Windows Driver Kit section on [13].If the MSP430-TUSB3410 Reference Design is found, a message is output, displaying theassociated the VCP port number. This number should match to what is shown in the Windows device manager. After this, the VCP is opened like any other COM port in Windows using the Windows API call CreateFile(). Note that the COM port is opened with the attributeOVERLAPPED to allow for an event-driven program flow. Also, port configuration and the actual data transfer don’t differ as if a real hardware serial port is used. Extensive information on serial port programming can be found on [13].The VCP is configured by filling a Windows DCB structure with all the parameters. Note that a baud rate of 460,800 with 8 data bits, 1 stop bit, and no parity is used and that any flow control mechanisms are disabled. These settings must match the MSP430 USART settings forsuccessful communication.After this, the main event processing loop is entered. At the beginning of this loop, the program enters an alterable wait mode using the function WaitForSingleObjectEx(). When any console keyboard event is detected, the wait mode is exited and the program checks the keyboard input buffer for a press or release of any of the keys <1>…<4>. If the status of these keys changes, the variable PCButtonState is updated and the new keyboard state is transmitted over the VCP to the MSP430-TUSB3410 reference design board using WriteFile(). In analogy to the MSP430 firmware, the lower nibble of the transmitted byte contains the current state of the keys<1>…<4>. Note that data is only transmitted if there is an actual change in the state of thesekeys. Also, if <ESC> is pressed, a flag gets set, the event processing loop is left, the VCP isclosed by calling CloseHandle(), and the program is exited.For any character that is received from the demo board through the VCP connection, thefunction FileIOCompletionRoutine() is automatically executed by Windows. This is possible as the COM port is used in OVERLAPPED mode. This function serves as an event handler, reads out the received byte from COMBuffer[] and displays the updated MSP430 button state to the console.4.4Customized Bootstrap Loader ToolWith the MSP430-TUSB3410 reference design presented here, it is possible to use the MSP430 built-in bootstrap loader (BSL) firmware to program a blank MSP430 through the USB interface.Details on the operation of the BSL can be found in [11]. TI also provides an application notethat presents a BSL programming solution consisting of serial-port hardware and PC software[12].All the connections needed for BSL programming as required by [12] are made (see Table 2). When comparing TI’s BSL programmer hardware with the reference design, it can be seen that the two serial handshake lines DTR and RTS, which are used to invoke the BSL, are inverted. To accommodate this, minor modifications were made to the BSL software which was available on the web at the time of writing this application note to invert these two signals in software. The modified source code and a new PC application are provided as part of this application note.To program a blank MSP430-TUSB3410 reference design board, the following flow can be used:1.)Generate an MSP430-TXT output file of the program you want to download2.)Connect the application board to a PC USB port3.)Install the standard TI TUSB3410 VCP drivers for the “TUSB3410 Boot Device”. This is thedevice the TUSB3410 reports as with its default configuration (either with blank EEPROM, or with disconnected EEPROM by removing JP1). These drivers are supplied with thisapplication report. For the most up-to-date drivers, always refer to [5].4.)Open the Windows device manager to identify the VCP the TUSB3410 is connected to (seeFigure 6)5.)From the command line, start the provided BSL tool BSLDEMO.exe with the COM port andthe MSP430-TXT file to program as parameters. For example, to download the blinking LED demo code supplied with this application note to an MSP430 connected on COM5, thefollowing command line would need to get executed:C:\>BSLDEMO –cCOM5 FET1.TXTAfter starting, the tool will connect to the MSP430 internal BSL via USB and download the code file. After this is finished, the MSP430 RESET signal will be released and the code execution will start. All four LEDs on the demo board should now be blinking.Note that when re-flashing an MSP430 which is running the firmware presented in section 4.2, one additional step has to be performed. While the firmware is running, it deactivates theMSP430 RESET pin to prevent unintended device resets due to DTR serial handshake line operation, but this also disables the ability for the BSL to gain control over the device. In order to maintain reset functionality and BSL download capability, hold down any of the push-buttons SW1...SW4 from the moment the board is connected until the BSL download is completed. Doing so will trap the firmware in an endless loop and switch on all LEDs. During the connection process, the boards LEDs will blink several times as the TUSB3410 operates the DTR handshake signal.5Reference Design USB Drivers5.1OverviewTogether with this application note, two sets of drivers are provided (see Table 3). The drivers are based on the current TI TUSB3410 driver suite at the time of writing of this application note.It is recommended to check the TUSB3410 product folder on the TI web page for possible driver updates [5]. The driver is available under the order number TUSBWINVCP. Note that per driver installation, two actual drivers get installed: one universal multi-port serial adapter (UMP), and one virtual serial COM port which makes use of the services provided by the UMP. The dual-driver setup is due to the chosen TUSB3410 Windows driver architecture.TI’s current TUSB3410 solution has successfully passed WHQL certification. Therefore, oneshould also be able to achieve WHQL certification with a customized solution using different VID and PID values.5.2Manual Driver InstallationAll drivers supplied with this application note need to get manually installed upon USB hardware connection. When Windows detects the new device, the Found New Hardware Wizard will pop up (Figure 5). A different device name will be shown depending on if an EEPROM is used for USB parameter storage, and the descriptor strings are stored there. The screenshot shows the wizard when the standard TUSB3410 descriptor string is used.Figure 5.Found New Hardware WizardOn the first dialog page, “Install from a list or specific location” must be selected. Then, one has to point the wizard to the actual directory where the driver files reside. The directory choicedepends on if the reference design EEPROM is blank (or JP1 is removed), or the EEPROM was already programmed by the MSP430 firmware. Refer to Table 3 for folder names. For theremainder of the driver installation simply push “Next >” until everything is done. After the first driver is installed (Multi-port serial adapter, UMP), the Found New Hardware Wizard will popup again and ask for drivers for the actual VCP. Again, direct the wizard to the same directory, and push “Next >” until the second driver is installed. After installation, the Windows device manager should look like shown in Figure 6. Behind the VCP port name, the associated COMnn number of the VCP is displayed. This number can immediately be used to communicate with the demo board. The PC software provided with this application report shows a way how this VCP portnumber detection process can be automated. See section 4.3 for details.Figure 6.Device Manager After Driver Install5.3Standard TUSB3410 DriverThis driver suite is used in the case the EEPROM on the reference design hardware is blank or jumper JP1 is removed at the time the board is connected. In this case, the board will report as “TUSB3410 Boot Device”. The “Found New Hardware” wizard needs to get directed to the“ORIG_TUSB3410_2KXP_V103” folder. After driver installation, the TUSB3410 VCP is listed in the Windows device manager and can be used e.g., to download code to a blank MSP430 using the BSL tool as described in 4.4.5.4Custom MSP430-TUSB3410 Reference Design DriverThe other driver supplied with this application report is a customized TUSB3410 driver for use with the VID/PID values used with the reference design demo board (Table 1). Also, thedescriptor strings were modified to show the board as “MSP430-TUSB3410 Reference Design”in the Windows device manager. The driver suite basically is the standard TUSB3410 set ofdriver files, with the two modified INF-files umpusbXP.inf (for the UMP) and UmpComXP.inf (for the VCP). Inspect these files to exactly see whic h changes were made.The process for creating a custom application specific driver set is to take the standardTUSB3410 driver suite, and then modify these two INF-files using a text editor. Throughoutthese files there are instructions and hints placed as comments that indicate places to fill incustom VID, PID, and descriptor string values. Make sure that the UMP hardware ID used inboth driver INF-files matches and is unique to your company and product. Note that for a custom application, it is recommended to remove or uncomment all occurrences of TI’s VID/PIDsthroughout these files. Otherwise, conflicts with different USB devices using the TUSB3410drivers can occur.5.5Automated Driver InstallerThe TUSB3410 driver suite, which is available in the TUSB3410 product folder, also contains a driver installer. It is an InstallShield project that allows installing the Windows drivers prior toUSB device connection. Using this installer results in an easier driver installation, as Windows is already aware of the device drivers by the time the actual device gets connected, and the need for manually pointing the “Found New Hardware” wizard to the driver directory is removed. Inthis case, the user only needs to push “Next >” in the dialog boxes until everything is done.The driver installer can be customized for VID / PID values without rebuilding the actualInstallShield project. The automated driver and instructions on how to customize are included in the TUSBWINVCP driver package available on [5].6Lower-Cost Options6.1No External EEPROMIt is possible to design a TUSB3410-based device that doesn't use an external EEPROM. This solution reports the default descriptors located in the TUSB3410 boot code, including TI’s default VID/PID, and the TUSB3410 firmware is downloaded from the host. However, doing so has two consequences:1.)The solution is not USB-compliant because it does not have the vendor’s unique VID2.)The host that sees two devices with the same VID/PID and same serial number may notallow both of them to function.For these reasons, TI strongly discourages this configuration, unless the system is known to be an isolated bus that will not encounter any unknown devices that may conflict with your device.。
基于msp430的wdf设计与完成[整理版]
电子测量技术ELECTRoNICMEASI爪EMENTTECHNOI.0GY第31卷第3期2008年3月基于MSP430的WDF设计与实现贺卫东1段哲民1南新阳2(1.西北工业大学电子信息学院西安710072;2.中国科学院国家授时中心西安710600)摘要:DTMF信号被广泛的应用在交互式控制中,如语言菜单、语言邮件、电话银行和ATM终端等。
对于DTMF信号的产生、识别,普通的设计方案一般都采用专用的数字编解码芯片,成本高,体积大。
本文论述在FLASH型超低功耗16位单片机MSP430中实现一类FIR滤波器WDF(wavedigitalfilters),借助WDF滤波器良好的动态特性,使得MSP430的用户可以良好的解决DTMF编解码一类的应用问题。
关键词:唧,MSP430;数字滤波中图分类号:TP3文献标识码:AWDFforTI’SsensorprocessorMSP430HeWeidongaDuanZheminlNanXinyangz(1.ElectronicInformationInstitute,Northw笛temPolytechnicalUniversity,Xi’an710072I2.NationalTimeServiceCenter,ChineseAcademyofScience,Xi’an710600)Ah渤耐:TheMSP430isanultra-low-power16_bitRISCmixed-signalprocessorfromTLitcanprovidetheultimatesolutionforbattery-poweredmeasurementapplications.ErrMFiswidelyt18edincommunication。
remote-controlforitswell-doneproperties,anditisalsobeenusedinmutual-contr01suchtele-bankandATMterminalstheseyears.Inthispaper,aFⅡtfilter_硎DF(wavedigitalfilters)isimplemented,whichenableMSP430userstosolvespecialmeasurementproblemslikeDTMFproblemsbymeansofrobustdigiitalfilteralgorithms.Keywonis:WDF;MSP430}digitalfilteringo引言主篓器嚣拦黼群撼嚣羹IIR滤波器和FIR比起来需要较少的乘法器,故被有的诸多优点,从而较好的解决在实时单片机系统中的稳定的实时系统所采用,但是由于它们的递归特性,特别是在滤波问题。
基于MSP430F449的数据存储和USB串行通信实现
基于MSP430F449的数据存储和USB串行通信实现在数据采集和测量仪器尤其是便携式设备中,数据存储和传输是不行避开的问题,近年来TI公司推出的低功耗微控制器,在仪器设计和创造领域引起巨大变革,新型控制器和大容量串行存储器的应用大大提高产品了的性能。
本文主要解决两个问题1 解决经过MSP430采集后的数据与EEPROM24C256的数据接口问题,也就是数据存储问题;2 解决EEPROM与上位机(一般微机)的数据通信问题,也就是存储后的数据上传问题。
首先对主要的做容易介绍MSP430F449简介MSP430F449是MSP430系列中的一种,MSP430系列是一种具有集成度高,功能丰盛、功耗低等特点的16位。
它的集成调试环境EmbeddedWorkbench 提供了良好的开发平台。
设计中基于程序的复杂性和程序容量大的要求挑选了MSP430F449,这款芯片具有64K程序存储器,可以满足大部分复杂控制的需要;它的封装100-PIN QFP具有良好的互换性,与MSP430F437 、MSP430F435等芯片具有彻低全都的管脚可以在程序量上举行合理挑选。
24C256简介24C256是支持I2C协议的串行EEPROM,容量32768字节。
以上是24C256的管脚图,其中A0,A1,A2构成存储器的物理地址,作为I2C上区别不同存储器的控制地址,可以在I2C总线上同时衔接8个设备。
WP是写庇护,高电平将禁止对器件的写操作;SCL和SDA 是数据传输的控制线,其中SCL是时钟,SDA是双向数据线,用来完成数据的写入和读出,数据的传输根据I2C协议的要求由时钟端SCL 协作共同完成。
CP2102简介第1页共9页。
基于嵌入式系统的U盘的开发与设计
嵌入式系统课程设计一、设计题目二、设计要求与目的三、系统硬件设计、系统软件设计四、系统仿真与调试五、心得体会基于嵌入式系统U盘开发的设计引言随着USB技术和闪存技术的飞速发展,移动存储设备的速度和容量日新月异,但在工业控制的上位机和下位机之间,数据传输依然采用传统的串并口技术,特别对一些前端的便携式采集系统,需要采集后临时存储,再拿回来传给作为上位机的PC机进行数据处理,给人们带来很多不变,为此,本文提出了一种方法--利用U盘的便捷特性开发一种基于嵌入式的USB读写器,方便地将采集数据以文件方式写入U盘,PC机不需要任何特殊驱动便可以完成对数据的处理回放。
利用本方法可以彻底解决下位机与PC机之间的数据传输难的问题。
一、设计题目基于嵌入式系统u盘开发的设计二、设计要求与目的根据U盘结构特点,设计了一种基于嵌入式系统U盘的系统结构,可以将U盘集成到无线数据卡上,或者手机上,以实现数据存储的功能。
三、系统硬件设计、系统软件设计项目开发调试过程在进行USB 开发过程中,比较难的是对设备端的程序(称为固件,Firmware )进行调试。
由于USB 协议有严格的时间要求,这就使得程序必须在有效时间内对某些请求或状态进行处理,否则,USB 将无法正常工作。
因此,在调试过程中,较多借助LED1,LED2显示输出的一些信息来辅助调试,定位问题所在。
比如,在某个函数中加入LED1,LED2显示语句,程序运行时看有否相应的LED1,LED2显示输出,借此来判断此函数是否得到了执行。
调试工作基本分二步进行:首先对外部设备(单片机部分)借助PC 调试软件(从网上下载Bus Hound)将设备端的USB 协议(主要有描述符请求、端口配置、地址设置以及基本数据交换)调通。
然后,用调试好的USB 设备接口来嵌入文件系统功能。
1、硬件电路下图分别为PDIUSBD12的引脚定义,其中,下列几个方面在制作电路板时应该注意。
a)GND 接地,VDD 接正(3.3V 或5V ),如果芯片工作在3.3V ,则Vout3.3 与VDD 都接3.3V ;如果芯片工作在5V ,则这时Vout3.3 会输出3.3V 的电压,用于提供给D +作参考电压,因为此参考电压必须为3.3V 。
[功能]基于MSP430的Micro SD卡存储功能实现与评测
基于MSP430的Micro SD卡存储功能实现与评测摘要:广泛使用MSP430为主控单元的穿戴式健康监护设备功能不断发展,促使在该平台下的数据实时存储和功能评测的需求日益增强。
在此介绍基于MSP430的FatFs文件系统的移植以及Micro SD卡读/写功能的实现方法,提出了Micro SD卡读/写功能的评测方案,并测试了不同条件下的读/写速率。
结果表明,FatFs文件系统能被灵活地移植到MSP430系统中,并能适应不同内存环境的应用需求,Micro SD卡的读/写速率与缓冲区大小直接相关。
关键词: FatFs; MSP430; Micro SD; 数据存储0 引言近年来,出现了腕表型的血氧监测仪、睡眠生理监护仪等各式各样的可穿戴健康监护设备[1]。
使用者通过这类穿戴式设备可方便有效地对自身日常健康、亚健康状态进行监护,从而达到预防疾病、治未病的目的。
为了便于长时间观测记录,对健康状态变化趋势进行定期的分析,需要对日常监护数据进行长期、快速、低功耗的存储,这已成为此类医疗设备的必备功能。
以低功耗为主要特点的MSP430微处理器是此类穿戴式设备应用较为广泛的开发平台。
由于已有的其他平台上集成的工具包通常针对大数据量,高数据存储率的数据存储[2?3],设计过程中对功耗的考虑较少,往往难以满足低功耗的要求。
因此针对MSP430开发平台,对日常监护过程中长期的、存储量相对较小的数据存储,实现功耗与速度的平衡,是目前穿戴式设备开发过程中亟待解决的问题。
本文以具有超低功耗的MSP430单片机为主控制单元,讨论在MSP430控制下如何实现Micro SD卡的读/写功能,并提出了在MSP430平台下Micro SD卡读/写功能的测试方案,对不同条件下的读/写速率进行了评估,本文结果为基于MSP430的数据存储方案的设计提供了实际参考。
1 硬件设计主控芯片选用MSP430系列中MSP430F5438,因其RAM容量达16 KB,具有处理数据量较大任务的能力。
基于MSP430的U盘设计设计
基于MSP430的U盘设计设计成都信息工程学院学位论文基于MSP430的U盘设计论文作者姓名:申请学位专业:自动化申请学位类别:工学学士指导教师姓名(职称):论文提交日期:基于MSP430的U盘设计摘要随着科学技术的快速发展,人们生活水平的提高,信息化程度的提高,信息的传输交换需求也就越来越多。
在科学技术迅猛发展的今天,U盘已经成为了主流的数据储存产品,它满足了我们对数据储存的需求,实现了便携式移动存储、大大提高了办公效率,使人们生活更便捷。
而且此装置小巧,方便携带,适用于各种场合,其应用前景和经济效益都很看好。
因此,设计稳定、低功耗的数据储存器件就显得非常重要了。
本次研究设计的U盘是基于高速低功耗的MSP430单片机,采用串行外设协议总线结构对SD卡中的数据进行读写操作并通过USB接口与PC端进行数据传输,U盘内存2G,系统的功耗低,供电电压3.3V。
整个系统的功能实现了U盘与电脑之间的通讯。
这种方法简单、便于操作、综合成本较低,具有较大的推广应用价值。
其中,因SD卡具有体积小、功耗低的优势,所以在本设计中采用SD卡作为储存器件。
关键词:MSP430;U盘;SD卡;读卡器The U disk design of a MSP430-basedAbstractWith the rapid development of science and technology, people living standard rise, the informatization degree rise, information exchange of transport demand is also more and more. In the rapid development of science and technology today, U disk has become the mainstream of data storage products, it satisfies our demand for data storage, implements the portable mobile storage, greatly improve the office efficiency, make life more convenient. And the device is small and portable, suitable for various occasions, the application prospect and economic benefit are look good. Design, therefore, stable, low power consumption of data storage devices is very important.The study in the design of the USB flash drive is based on the high-speed low-power MSP430 MCU, using serial peripheral agreement bus structure on the data in the SD card read and write operations and through the USB interface with PC for data transmission, 2 g USB memory, system of low power consumption, power supply voltage of 3.3 V. The function of the whole system has realized the communication between usb and computer. This method is simple, easy to operate, low comprehensive cost, has great popularization and application value. Among them, because the SD card with the advantages of small volume, low power consumption, so in this design using SD card as storage devices.Key words: MSP430; U disk; SD card; Card reader目录论文总页数:22页1 引言 (1)1.1 课题研究的背景与意义 (1)1.1.1 课题研究背景 (1)1.1.2 研究意义 (1)2 总体方案论证与设计 (1)2.1 设计要求 (1)2.2 系统设计总体方案 (2)2.2.1 系统框图 (2)2.2.2 单片机的选择 (2)2.2.3 电源选择 (2)3 系统电路设计与分析 (3)3.1 单片机最小系统 (3)3.1.1 MSP430F5529单片机简介 (3)3.1.2 电路分析 (4)3.2 USB接口模块 (5)3.3 SD卡接口模块 (7)3.4 JTAG仿真接口 (8)4 系统软件设计与分析 (9)4.1 主程序流程图 (9)4.2 各单元设计思路及实现功能 (10)4.2.1 USB通信 (10)4.2.2 SD卡通信 (13)5 系统调试 (16)5.1 电源模块调试 (16)5.2 JTAG仿真接口调试 (16)结论 (17)参考文献 (18)致谢 (19)声明 (20)附录 (21)1 引言1.1 课题研究的背景与意义1.1.1 课题研究背景随着科学技术的快速发展,人们生活水平的提高。
基于MSP430单片机的USB接口固件编程的研究_彭华
文章编号:1009-2552(2012)07-0115-06中图分类号:TP311文献标识码:A基于MSP430单片机的USB接口固件编程的研究彭华,郭建强,高晓蓉,王黎,王泽勇(西南交通大学光电工程研究所,成都610031)摘要:基于MSP430系列单片机的系统设计,已经遍布电子产品的每一个领域。
以MSP430单片机开发的系统与计算机的通信,可以使得信息数据更好更快的被处理。
基于PDIUSBD12芯片,在MSP430F169单片机系统中,设计了用于MSP430进行USB数据传输的固件程序。
通过实验结果及其分析,文中的设计能够满足MSP430F169系统USB传输的需求。
关键词:USB固件编程;MSP430;PDIUSBD12Firmware programming study on USB interface based on MSP430 PENG Hua,GUO Jian-qiang,GAO Xiao-rong,WANG Li,WANG Ze-yong(Photoelectric Engineering Institute,Southwest Jiaotong University,Chengdu610031,China)Abstract:The system design based on the MSP430series MCU,has been all over every area of electronic products.As a result of the communication between computer and system desgined by MSP430 MCU,the information data could be processed better and faster.This paper desgined the firmware program used for USB data transmission in the MSP430F169system based on PDIUSBD12chip.The experimental results and the analysis show that the design in this paper could be satisfied with the requirements for USB transmission in MSP430F169systems.Key words:USB firmware programming;MSP430;PDIUSBD120引言MSP430系列单片机是美国TI公司生产的是一款低功耗、高性能16位微处理器,已经遍布电子产品的每一个领域[1]。
低功耗MSP430数据采集系统的USB接口设计
低功耗MSP430数据采集系统的USB接口设计实现系统运行的最小功耗是现代电子系统的普通取向,也是绿色电子的基本要求。
采有最小功耗设计方法既能减少电子设备的使用功耗,又能减少备用状态下的功率消耗。
在节省能源的同时还有利于减少电磁污染,有利于电子系统向便携式方向发展,有助于提高系统的可靠性。
现代工业生产和科学研究对数据采集的要求日益提高。
在许多场合要求数据采集系统向便携化方向发展,要求系统具有体积小、功耗低、传输速率快、使用方便灵活等特点。
在数据采集系统中,如何节省电能以使系统工作时间更长,如何通信才能使系统数据传输速度更快,已经成为系统开发过程中必须加以考虑的主要内容。
微控制器MSP430的超低功耗技术在众多单片机中独树一帜,同时它具有集成高度等特点,因此,选用该控制器作为系统的主控制器,实现数据采集和Flash存储等功能。
此外,USB 端口与以往的普通端口(串口与并口)相比具有传输速度快、功耗低、支持即插即用、维护方便等优点;因此在通信设计时,结合UART转USB芯片CP2101以实现USB接口通信。
上述设计既利用了MSP430的超低功耗特性,又利用了CP2101设计USB接口的简便性,设计得到的数据采集系统可以实现便携化、低功耗、使用方便等目标。
1 MSP430数据采集系统的USB接口设计1.1 采信系统简介本系统实现多路数据的采集、Flash存储及USB通信等功能。
单片机系统主要完成信息采集、A/D转换、对信号进行放大滤波处理、数据通信、Flash存储等;实时时钟记录采集数据的时间;CP2101实现USB接口,并把单片机采集到的信号传给微机;微机完成数据接收、存入数据库、数据处理、计算、显示等功能。
1.2 超低功耗MSP430微控制器MSP430是TI公司近几年推出的16位系列单片机。
它采用最新的低功耗技术,工作在1.8~3.6V电压下,有正常工作模式(AM)和4种低功耗工作模式(LPM1、LPM2、LPM3、LPM4);在电流电压为3V时,各种模式的工作电流分别为AM:340μA、LPM1:70μA、。
推荐-MSP430的U盘设计 精品
成都信息工程学院学位基于MSP430的U盘设计作者姓名:申请学位专业:自动化申请学位类别:工学学士指导教师姓名(职称):提交日期:基于MSP430的U盘设计摘要随着科学技术的快速发展,人们生活水平的提高,信息化程度的提高,信息的传输交换需求也就越来越多。
在科学技术迅猛发展的今天,U盘已经成为了主流的数据储存产品,它满足了我们对数据储存的需求,实现了便携式移动存储、大大提高了办公效率,使人们生活更便捷。
而且此装置小巧,方便携带,适用于各种场合,其应用前景和经济效益都很看好。
因此,设计稳定、低功耗的数据储存器件就显得非常重要了。
本次研究设计的U盘是基于高速低功耗的MSP430单片机,采用串行外设协议总线结构对SD卡中的数据进行读写操作并通过USB接口与PC端进行数据传输,U盘内存2G,系统的功耗低,供电电压3.3V。
整个系统的功能实现了U盘与电脑之间的通讯。
这种方法简单、便于操作、综合成本较低,具有较大的推广应用价值。
其中,因SD卡具有体积小、功耗低的优势,所以在本设计中采用SD卡作为储存器件。
关键词:MSP430;U盘;SD卡;读卡器The U disk design of a MSP430-basedAbstractWith the rapid development of science and technology, people living standard rise, the informatization degree rise, information exchange of transport demand is also more and more. In the rapid development of science and technology today, U disk has bee the mainstream of data storage products, it satisfies our demand for data storage, implements the portable mobile storage, greatly improve the office efficiency, make life more convenient. And the device is small and portable, suitable for various occasions, the application prospect and economic benefit are look good. Design, therefore, stable, low power consumption of data storage devices is very important.The study in the design of the USB flash drive is based on the high-speed low-power MSP430 MCU, using serial peripheral agreement bus structure on the data in the SD card read and write operations and through the USB interface with PC for data transmission, 2 g USB memory, system of low power consumption, power supply voltage of 3.3 V. The function of the whole system has realized the munication between usb and puter. This method is simple, easy to operate, low prehensive cost, has great popularization and application value. Among them, because the SD card with the advantages of small volume, low power consumption, so in this design using SD card as storage devices.Key words:MSP430; U disk; SD card; Card reader目录总页数:22页1 引言1.1 课题研究的背景与意义1.1.1 课题研究背景随着科学技术的快速发展,人们生活水平的提高。
基于MSP430的数字存储示波器的设计与实现程序
/*******************************************方案1需要按复位键即每次只能采样128次方案2加一个软件触发,从固定位置触发各种中断形成一个循环!!上一个中断完成再触发下一个中断********************************************/#include <msp430x16x.h>#include "math.h"extern unsigned int N_point; //点数extern unsigned char M_grade; //阶数#define PI 3.14159265358979323#define uchar unsigned char#define uint unsigned int#define ulong unsigned long#define Num_of_Results 129#define CPU_F ((double)8000000)#define delay_us(x) __delay_cycles((long)(CPU_F*(double)x/1000000.0)) #define delay_ms(x) __delay_cycles((long)(CPU_F*(double)x/1000.0)) float data_R[128]; //实部float data_I[128]; //虚部uint N_point=128;uchar M_grade=7;uint results[32];uchar fre[4];uchar mami[7]={"-0000mv"};uchar h0[] = {"频率"};uchar h1[] = {"正在保存...."};uchar h2[] = {"欢迎使用本示波器"};uchar h3[] = {"保存等待"};uchar h4[] = {"不可保存"};uchar h5[] = {"****************"};uint count,ad,start,end,biger,longer;ulong sum,max=0,min=4095,zhi;uchar index =0,h=1,temp,flag=1,m=0,c=1;uchar tem=0,num=0;//中断函数中的计数变量,定义成全局uchar tempH,tempL,color=1;uint wavey[128];#define LCD_DataIn P4DIR=0x00 //数据口方向设置为输入#define LCD_DataOut P4DIR=0xff //数据口方向设置为输出#define LCD2MCU_Data P4IN#define MCU2LCD_Data P4OUT#define LCD_CMDOut P6DIR|=0xFF //P3口的低三位设置为输出#define LCD_RS_H P6OUT|=BIT3 //P3 .0#define LCD_RS_L P6OUT&=~BIT3 //P3.0#define LCD_RW_H P6OUT|=BIT4 //P3.1#define LCD_RW_L P6OUT&=~BIT4 //P3.1#define LCD_EN_H P6OUT|=BIT5 //P3.2#define LCD_EN_L P6OUT&=~BIT5 //P3.2/*******************************************函数名称:int_CAP()功能:初始化触发器!!只打开触发引脚P13参数:无返回值:无********************************************/void int_CAP(){P1SEL = 0x0C;//P12P13作为捕获输入端子P1DIR = 0x00;TACCTL1|=CM_2+SCS+CAP;//P12下升沿触发捕获,同步模式不开中断TACCTL2|=CM_1+SCS+CAP+CCIE;//P13上升沿触发捕获,同步模式TACTL|=TASSEL_2+MC_2;//SMCLK作为计数脉冲,不分频}/*******************************************函数名称:Clock_Init()功能:初始化时钟参数:无返回值:无********************************************/void Clock_Init() //时钟初始化{uchar i;BCSCTL1&=~XT2OFF; //打开XT振荡器BCSCTL2|=SELM1+SELS+DIVS_3; //MCLK为8MHZ,SMCLK为1MHZ do{IFG1&=~OFIFG; //清除震荡标志for(i=0;i<100;i++)_NOP(); //延时等待}while((IFG1&OFIFG)!=0); //如果标志为1,则继续循环等待IFG1&=~OFIFG;}/*******************************************函数名称:int_adc()功能:初始化ADC参数:无返回值:无********************************************/void int_adc(){P6SEL |= 0x07; // P6.0 P6.1P6.2ADC option selectP6DIR |=0XF8;ADC12CTL0 = SHT0_2 + ADC12ON+REF2_5V+REFON+MSH; // Set sampling time, turn on ADC12ADC12CTL1 = SHP+CONSEQ_3;// Use sampling timerADC12MCTL0 = 0X00;//参考电压AVCC AVSSADC12MCTL1 = INCH_1;ADC12MCTL2 = INCH_2+EOS;//选择通路,EOS停止第一轮转化ADC12IE = 0x04; //中断最后一个使能// Enable interruptADC12CTL0 |= ENC; // 转化enabled}/*******************************************函数名称:Delay_1ms功能:延时约1ms的时间参数:无返回值:无********************************************/void Delay_1ms(void){uchar i;for(i = 150;i > 0;i--) _NOP();}/*******************************************函数名称:fft_128()功能:fft变换参数:无返回值:无********************************************/void fft_128(){ float tab_sin_128[128]={ //正玄表旋转因子所在0.0000, 0.0491, 0.0980, 0.1467,0.1951,0.2430, 0.2903, 0.3369, 0.3827,0.4276, 0.4714, 0.5141, 0.5556, 0.5957,0.6344, 0.6716, 0.7071, 0.7410,0.7730, 0.8032, 0.8315, 0.8577, 0.8819,0.9040, 0.9239, 0.9415, 0.9569,0.9700, 0.9808, 0.9892, 0.9952, 0.9988,1.0000, 0.9988, 0.9952, 0.9892,0.9808, 0.9700, 0.9569, 0.9415, 0.9239,0.9040, 0.8819, 0.8577, 0.8315,0.8032, 0.7730, 0.7410, 0.7071, 0.6716,0.6344, 0.5957, 0.5556, 0.5141,0.4714, 0.4276, 0.3827, 0.3369, 0.2903,0.2430, 0.1951, 0.1467, 0.0980,0.0491, 0.0000,-0.0491,-0.0980,-0.1467,-0.1951,-0.2430,-0.2903,-0.3369,-0.3827,-0.4276,-0.4714,-0.5141,-0.5556,-0.5957,-0.6344,-0.6716,-0.7071,-0.7410,-0.7730,-0.8032,-0.8315,-0.8577,-0.8819,-0.9040,-0.9239,-0.9415,-0.9569,-0.9700,-0.9808,-0.9892,-0.9952,-0.9988,-1.0000,-0.9988,-0.9952,-0.9892,-0.9808,-0.9700,-0.9569,-0.9415,-0.9239,-0.9040,-0.8819,-0.8577,-0.8315,-0.8032,-0.7730,-0.7410,-0.7071,-0.6716,-0.6344,-0.5957,-0.5556,-0.5141,-0.4714,-0.4276,-0.3827,-0.3369,-0.2903,-0.2430,-0.1951,-0.1467,-0.0980,-0.0491};int i;int L;// the grade deal with nowint J;//the point deal with nowint B;//蝶形两左翅相距的距离int var;//临时变量int P,Q;//cos sin 在sintab中的位置旋转因子float data_R_J,data_I_J,data_R_JB,data_I_JB;//临时变量存放data_R。
基于单片级优盘存储系统
液晶模块LCD5110
• LCD5110液晶显示模块共有19引脚,1脚接VCC,8脚接 电源为液晶显示器提供工作电源,7脚接地。10-13脚接地, 提供背光电源,6脚接电源用于外部时钟输入,CLK脚与 单片机的P3.6相连,DIN端与单片机P3.5端相连,CS端与 单片机P3.3端相连,RST端与单片机P3.2端相连.
单片机最小系统
单片机最小系统
• 单片机的RST脚接复位输出电路,要保持RST脚处 于高电平时,必须经过两个机器周期;XYAL1:内部时钟 工作电路输入以及反向振荡放大器输入;XTAL2:反向振 荡器输出端。XYAL1和XYAL2两个引脚接12Mhz晶振与瓷 片电容组成时钟电路。VCC接电源,GND接地。 P0.O~P0.7口接CH375芯片的D0~D7端,P1.0口接热敏电 阻,P1.1口接光敏电阻进行数据的采集。P3.2~P3.6口接 液晶显示屏,P2.3接CH375芯片的INT端口,P2.4接AO 端口,P2.5接CS片选控制输入端口,P2.6接RD读数据端 口,P2.7接WD写数据端口。
设计模块
• 传感模块:
• 热敏电阻对温度的变化具有强烈的 感应,可以采集到温度的变换的模 拟信号。 光敏电阻对光的强弱有着感知,可 采集到光强的不断变化时的模拟信 号。
• 单片机最小系统
• 可以对采集到的信号进行控制将模 拟信号转换为数字信号并且将信号 存储到U盘存储系统中,将信号显 示在液晶屏上。
开始 初始化375,设置为从机模式
检测连接 正常?
Y
N
初始化USB存储器
初始化FAT32文件系统
文件读写操作
返回
传感模块工作的流程图
进行视频演示
总结
• • • • 本次课题为基于单片机控制的U盘存储系统的设计,具体内容是利用 单片机STC12C5A0S2和CH375芯片完成一个基于U盘的数据存储,本次课题 完成了一下工作: 1.完成了基于单片机控制的U盘存储系统的设计,包括对原理图的确定 和绘制,元器件的购买,硬件实物的主控模块和显示模块和存储模块的搭建 和焊接。 2.完成了基于单片机控制的U盘存储的软件部分的设计,包括熟练的使 用仿真软件,单片机STC12C5A0S2,LCD5110液晶显示屏,CH375U盘存 储等模块的学习和编写程序,对各个模块的调试,最后进行测试。 通过对这次课题的设计,使我充分的懂得了单片机控制设计的具体流程和方 法,从最初的选择课题到查找资料再到确定方案,元器件的选择和购买,进 行实物的焊接,最后进行的软件程序的编写和调试。在每一个阶段都需要付 出大量的新血和努力,脚踏实地,认真严谨的态度,更要注重在过程中理论 与实践的相互结合,通过准备课题到结束的过程中不仅需要付出辛勤的汗水 和大量的劳动于此同时提高了更自我的动手能力和分析问题并且解决问题的 能力,更加的让我明白真如何完成做好一套完整的课题。
基于MSP430单片机的互感器检测装置USB接口的开发
五、结语中国互联网络的发展方向从技术层面讲,新一代互联网将会发展IPv6和在网络上支持信息资源共享的一些技术,以虚拟现实技术、三维展示技术为核心的内容技术的发展,将会在未来几年内成为互联网络技术的主流。
运用高科技手段来发展旅游业是目前我国抓住机遇、刻不容缓的课题。
因此本文的研究对旅游业的科学发展具有现实意义。
相信通过这些高新技术的集成应用,旅游业会是永远的朝阳行业。
参考文献[1]刘南,刘仁义.Web GIS 原理及其应用[M].北京:科学出版社,2002.[2]邬伦,刘瑜,张晶,马修军,韦中亚,田原.地理信息系统———原理、方法和应用[M].北京:科学出版社,2001.[3]王峰,刘仁义,刘南.Web GIS 和虚拟现实技术在旅游业发展中的应用研究[J].浙江大学学报(理学版),2005,32(6).[4]中国虚拟现实产业第一门户./2009/6/38227261.html.基金项目:山西省科技攻关计划基金资助项目(项目编号:20090321023)。
作者简介:马斌(1964-),男,山西人,太原理工大学经济管理学院教授,硕士生导师,硕士,研究方向:管理信息系统、物流与供应链管理、项目管理;宫婕(1981-),女,山东人,太原理工大学经济管理学院硕士研究生,研究方向:管理信息系统。
摘要:文章介绍了一种基于MSP430单片机的数字式互感器检测装置USB 接口的设计方法,并给出了硬件电路和软件设计方法。
系统采用TI 公司超低功耗单片机MSP430芯片将所采集的模拟量信号使用内部ADC12模块进行A/D 转换,并通过连接FT245BM 芯片将数据通过USB 口发送到PC 机,利用上位机软件完成处理数据的处理。
关键词:互感器检测装置;MSP430;FT245BM ;USB ;标准接口中图分类号:TP334文献标识码:A 文章编号:1009-2374(2010)01-0033-03互感器检测仪的主要用途是对现场应用的或者在实验室应用的电压互感器相电流互感器进行技术性能的检定。
基于单片机MSP430F449的USB接口数据传输系统设计.
1绪论1.1 USB概述1.1.1 USB的起源和发展历史USB 是英文 Universal Serial Bus的缩写,中文含义是 " 通用串行总线 " 。
它是一种应用在 PC 领域的新型接口技术上面提到的外设接口没有统一的标准, USB 就将这些接口统一起来,使用一个 4针插头作为标准插头。
通过这个插头,采用菊花链形式可以把所有的外设连接起来,并且不会损失带宽。
USB0.9是由 7家主要电脑、电子科技厂商,包括了 Compaq、 Digital 、 IBM 、 Intel 、微软、 NEC 以及北方电讯 (加拿大在 1995年 11月研发出来的。
1998年后, 随着微软在 Windows 98中内置了对 USB 接口的支持模块, 加上 USB 设备的日渐增多, USB 接口才逐步走进了实用阶段。
这几年, 随着大量支持 USB 的个人电脑的普及, USB 成为 PC 的标准接口已是大势所趋。
在主机 (host端, 最新推出的 PC 机几乎 100%支持 USB ;而在外设(device端,使用 USB 接口的设备也与日俱增,例如数码相机、扫描仪、游戏杆、磁带和软驱、图像设备、打印机、键盘、鼠标等等。
1.1.2 USB的特点USB 之所以有着巨大的魅力主要是由于它的许多其他总线无法比拟的优点。
这里主要就目前国内应用的 USB1.1技术做一些研究和应用。
USB 的规范能针对不同的性能价格比要求提供不同的选择, 以满足不同的系统和部件及相应不同的功能,其主要优点可归结为以下几点:A 速度快。
B设备安装和配置容易。
C易于扩展。
D 能够采用总线供电。
E使用灵活。
F价廉物美。
1.1.3 目前 USB 的应用由于 USB 设备的诸多优点,自 97年,微软推出 WIN95\97后, USB 进入实战阶段, 但由于这个版本对 USB 的支持属于外挂式模块, 因此直到 Windows98推出后, USB 接口的支持模块才真正日趋成熟。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
密级:公开编号:2009xxxxxx基于MSP430的U盘设计论文作者姓名:x x申请学位专业:自动化申请学位类别:工学学士指导教师姓名(职称):xxx(讲师)论文提交日期:2013年x月x日密级:公开编号:2009xxxx成都信息工程学院学位论文基于MSP430的U盘设计论文作者姓名:x x申请学位专业:自动化申请学位类别:工学学士指导教师姓名(职称):xxx(讲师)论文提交日期:2013年xx月xx日基于MSP430的U盘设计摘要随着科学技术的快速发展,人们生活水平的提高,信息化程度的提高,信息的传输交换需求也就越来越多。
在科学技术迅猛发展的今天,U盘已经成为了主流的数据储存产品,它满足了我们对数据储存的需求,实现了便携式移动存储、大大提高了办公效率,使人们生活更便捷。
而且此装置小巧,方便携带,适用于各种场合,其应用前景和经济效益都很看好。
因此,设计稳定、低功耗的数据储存器件就显得非常重要了。
本次研究设计的U盘是基于高速低功耗的MSP430单片机,采用串行外设协议总线结构对SD卡中的数据进行读写操作并通过USB接口与PC端进行数据传输,U盘内存2G,系统的功耗低,供电电压3.3V。
整个系统的功能实现了U盘与电脑之间的通讯。
这种方法简单、便于操作、综合成本较低,具有较大的推广应用价值。
其中,因SD卡具有体积小、功耗低的优势,所以在本设计中采用SD卡作为储存器件。
关键词:MSP430;U盘;SD卡;读卡器The U disk design of a MSP430-basedAbstractWith the rapid development of science and technology,people living standard rise,the informatization degree rise,information exchange of transport demand is also more and more.In the rapid development of science and technology today,U disk has become the mainstream of data storage products,it satisfies our demand for data storage,implements the portable mobile storage,greatly improve the office efficiency, make life more convenient.And the device is small and portable,suitable for various occasions,the application prospect and economic benefit are look good.Design, therefore,stable,low power consumption of data storage devices is very important.The study in the design of the USB flash drive is based on the high-speed low-power MSP430MCU,using serial peripheral agreement bus structure on the data in the SD card read and write operations and through the USB interface with PC for data transmission,2g USB memory,system of low power consumption,power supply voltage of3.3V.The function of the whole system has realized the communication between usb and computer.This method is simple,easy to operate,low comprehensive cost,has great popularization and application value.Among them, because the SD card with the advantages of small volume,low power consumption,so in this design using SD card as storage devices.Key words:MSP430;U disk;SD card;Card reader目录论文总页数:22页1引言 (1)1.1课题研究的背景与意义 (1)1.1.1课题研究背景 (1)1.1.2研究意义 (1)2总体方案论证与设计 (1)2.1设计要求 (1)2.2系统设计总体方案 (2)2.2.1系统框图 (2)2.2.2单片机的选择 (2)2.2.3电源选择 (2)3系统电路设计与分析 (3)3.1单片机最小系统 (3)3.1.1MSP430F5529单片机简介 (3)3.1.2电路分析 (4)3.2USB接口模块 (5)3.3SD卡接口模块 (7)3.4JTAG仿真接口 (8)4系统软件设计与分析 (9)4.1主程序流程图 (9)4.2各单元设计思路及实现功能 (10)4.2.1USB通信 (10)4.2.2SD卡通信 (13)5系统调试 (16)5.1电源模块调试 (16)5.2JTAG仿真接口调试 (16)结论 (17)参考文献 (18)致谢 (19)声明 (20)附录 (21)1引言1.1课题研究的背景与意义1.1.1课题研究背景随着科学技术的快速发展,人们生活水平的提高。
如今,电脑已经成为了我们生活的一部分,那么拷贝数据则成了家常便饭,U盘正是帮助我们完成这项“伟大事业”的良好载体,可以说和我们的生活密不可分。
U盘,又称优盘,中文全称“USB闪存盘”,英文名“USB Flash Disk”,是一种小型的移动存储盘,用于存储照片、资料、影像,只有拇指大小,它实现了便携式移动存储,大大提高了办公效率,使人类的生活更便捷。
如今,USB技术已经越来越普及和成熟,低成本、高稳定性、较高的数据传输速率和即插即用的方便性,使其备受硬件厂商的青睐。
随着数据采集和单片机用户对移动存储的需求越来越大,具有USB接口的存储设备以其优异的性价比和灵活性常用来进行数据的存储和交换,所以在单片机系统中实现对移动存储器件的直接读写是非常有价值的。
近几年,随着FlashMemory非易失存储技术的发展,诞生了许多基于Flash 存储技术的非易失大容量闪烁存储卡。
其中的SD卡以其体积小、功耗低的优势,被广泛用于各种数码产品中,如数码相机、MP3等。
同时也为低功耗、便携式的U盘提供了理想的存储介质1.1.2研究意义随着科学技术的快速发展,人们生活水平的提高,信息化程度的提高,信息的传输交换需求也就越来越多。
U盘与磁盘相比信息存储量更大,更适合大规模数据传输的需要。
在科学技术迅猛发展的今天,U盘已经成为了主流的数据储存器件,满足了我们对数据储存的需求。
从某种程度上说它的实现具有很大的意义,而且此装置小巧,方便携带,适用于各种场合,其应用前景和经济效益都很看好。
因此,设计稳定、低功耗的U盘就显得非常重要了。
本设计就是基于低功耗的MSP430单片机制作U盘。
2总体方案论证与设计2.1设计要求基于MSP430单片机的U盘设计应用了单片机MSP430、SD卡接口电路、电压转换电路、USB接口电路等模块。
系统基于高速低功耗的MSP430单片机,利用串行外围接口总线与SD卡相连,实现对SD卡的数据读写。
整个系统由USB 接口5V 电压经过三端稳压电路AMS1117输出3.3V 稳定的直流电压供给单片机使用。
单片机通过USB 接口与计算机连接,进行数据传送并直接对SD 卡进行读写等操作。
2.2系统设计总体方案2.2.1系统框图图2-1系统方框图2.2.2单片机的选择单片机是一种集成电路芯片,是采用超大规模集成电路技术把具有数据处理能力的中央处理器CPU 、随机存储器RAM 、只读存储器ROM 、多种I/O 口和中断系统、定时器/计时器等功能(可能还包括显示驱动电路、脉宽调制电路、模拟多路转换器、A/D 转换器等电路)集成到一块硅片上构成的一个小而完善的计算机系统。
方案一:MSP430F5529采用MSP430F559单片机,该单片机集成度高,具有超低功耗的特性,并且内置USB 模块,通过它自带的USB 模块可以更方便的与PC 端进行通信,这给整个系统大大地降低了成本。
方案二:MSP430F449采用MSP430F449单片机,需要连接一块USB 通用接口芯片,在集成度上没有MSP430F5529方便,故此次设计选择MSP430F5529单片机。
2.2.3电源选择电源模块是单片机应用系统或数据采集系统中不可缺少的部分,也是保证系统稳定、安全工作的前提。
本设计用到的电源为3.3V,属于小功率稳压电源,采用三端稳压芯片AMS1117。
用其设计的是线性稳压电路,具有结构简单、输出电压稳定性强、精度高等优点,因此给本系统供电完全满足要求。
3系统电路设计与分析3.1单片机最小系统3.1.1MSP430F5529单片机简介MSP430F5529单片机是一种超低功耗、高性能16位微处理器,它具有以下功能:128KB闪存、8KB RAM、USB接口、采样和保持及自动扫描功能的12位ADC、2个USCI(1,USCI_A0和USCI_A1,每个支持:增强UART、IrDA、同步SPI;2,USCI_B0和USCI_B1,每个支持:I2C、同步SPI)、32位HW MPY、四个个16位定时器/计数器、三通道内部DMA、片内晶振及时钟电路[1]。
该系列单片机引脚与封装如下图所示。
图3-1MSP430F5529单片机的内部框图3.1.2电路分析单片机最小系统由MCU、时钟电路、复位电路和电源模块组成时钟电路:MSP430F5529使用4MHz的晶体振荡器作为振荡源,电容容量为30P。
单片机晶振提供的时钟频率越高,那么单片机运行速度就越快,单片机的一切指令的执行都是建立在单片机晶振提供的时钟频率。
图3-2时钟电路复位电路:复位电路由按键复位和上电复位两部分组成。
(1)上电复位:此单片机为低电平复位,在复位引脚RST上连接一个电阻R18到MSP_DVCC,再连接一个电容C16到GND,由此形成一个RC充放电回路保证单片机在上电时RST脚上有足够时间的低电平进行复位,随后回归到高电平进入正常工作状态,这个电阻和电容的值为100K和0.1uF。