基于MSP430的U盘设计
- 格式:doc
- 大小:2.88 MB
- 文档页数:27
分类号: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。
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.。
电子测量技术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串行通信实现在数据采集和测量仪器尤其是便携式设备中,数据存储和传输是不行避开的问题,近年来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盘开发的设计引言随着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为主控单元的穿戴式健康监护设备功能不断发展,促使在该平台下的数据实时存储和功能评测的需求日益增强。
在此介绍基于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盘设计摘要随着科学技术的快速发展,人们生活水平的提高,信息化程度的提高,信息的传输交换需求也就越来越多。
在科学技术迅猛发展的今天,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 课题研究背景随着科学技术的快速发展,人们生活水平的提高。
湖南文理学院芙蓉学院课程设计陈述课程名称:嵌入式体系课程设计专业班级:通讯工程1301班学生姓名:王海波指点教师:邵湘怡完成时光:2016年 6月 22日陈述成绩:二.设计内容及请求1三.设计感化与目标2四.体系设计计划2五.体系硬件设计3B 装备端的固件分以下几个层次:45.2.2.在调试的时刻,从现象上来看,分成以下几个阶段性的步调55.2.3.检讨USB 器件工作与否6六.体系软件设计76.2 BULK_ONLY和UFI协定86.3 FAT3211七.仿真调试剖析14八.嵌入式体系进修心得14九.参考文献15基于嵌入式体系u盘开辟的设计一.设计标题基于嵌入式体系u盘开辟的设计二.设计内容及请求跟着USB技巧和闪存技巧的飞速成长,移动存储装备的速度和容量日新月异,但在工业掌握的上位机和下位机之间,数据传输依旧采取传统的串并口技巧,特别对一些前端的便携式收集体系,须要收集后暂时存储,再拿回来传给作为上位机的PC机进行数据处理,给人们带来许多不变,为此,本文提出了一种办法--应用U盘的便捷特征开辟一种基于嵌入式的USB读写器,便利地将收集数据以文件方法写入U盘,PC机不须要任何特别驱动即可以完成对数据的处理回放.应用本办法可以完整解决下位机与PC机之间的数据传输难的问题.据U盘构造特色,设计了一种基于嵌入式体系U盘的体系构造,可以将U盘集成到无线数据卡上,或者手机上,以实现数据存储的功效.在进行USB 开辟进程中,比较难的是对装备端的程序(称为固件,Firmware )进行调试.因为USB 协定有严厉的时光请求,这就使得程序必须在有用时光内对某些请求或状况进行处理,不然,USB 将无法正常工作.是以,在调试进程中,较多借助LED1,LED2显示输出的一些信息来帮助调试,定位问题地点.比方,在某个函数中参加LED1,LED2显示语句,程序运行时看有否响应的LED1,LED2显示输出,借此来断定此函数是否得到了履行.调试工作基本分二步进行:起首对外部装备(单片机部分)借助PC 调试软件(从网高低载Bus Hound)将装备端的USB 协定(重要有描写符请求.端口设置装备摆设.地址设置以及根本数据交流)调通.然后,用调试好的USB 装备接口来嵌入文件体系功效.三.设计感化与目标依据U 盘构造特色,设计了一种基于嵌入式体系U 盘的体系构造,可以将U 盘集成到无线数据卡上,或者手机上,以实现数据存储的功效四.体系设计计划体系总体设计图1 USB读写器构造图扼要阐述体系工作道理SB读写器构造框图如图1所示,重要由MSP430F149和SL811HS构成,MSP430支撑串口输入和14位的并口输入,P2.7用作中止叫醒位,P2.6用作尺度位区分数据和敕令,经由过程P4口向SL811发送掌握旌旗灯号,P6用作通俗的双向总线接口与SL811进行数据交流,P1.1支撑中止叫醒吸收SL811的中止请求.五.体系硬件设计下图分离为PDIUSBD12的引脚界说,个中,下列几个方面在制造电路板时应当留意.图2PDIUSBD12引脚图a)GND 接地,VDD 接正(3.3V 或5V ),假如芯片工作在3.3V ,则Vout3.3 与VDD 都接3.3V ;假如芯片工作在5V ,则这时Vout3.3 会输出3.3V 的电压,用于供给应D +作参考电压,因为此参考电压必须为3.3V .对于U 盘来说,因为USB 接供的是5V 电压,是以应当按后一种接法接.即GND 接USB 接口中的GND ,VDD 接USB 接口中的VDD ,D +D-分离接USB 接口中的对应位.b)XTAL1 和XTAL2 按传统接法.c)PDIUSBD12与MCU AT-89C55WD的衔接办法见下表表1 PDIUSBD12与MCU AT-89C55WD的衔接办法PDIUSBD12引脚MCU AT-89C55WD引脚DATA<0>~ DATA<7> ~P0.7(AD0~AD7)B 装备端的固件分以下几个层次:表2固件层次5.2.2.在调试的时刻,从现象上来看,分成以下几个阶段性的步调B 芯片正常工作,可以实现软衔接,此时PC 机上会消失“未知装备类型”的USB 装备;2.向主机供给通俗USB 装备供给描写符,供给准确的VID 和PID 后,PC 可以或许辨认装备,但请求供给装备的驱动程序;3.装配驱动程序后,应用周建功单片机公司供给的UsbDebug.exe简略调试端点1和2,确保其均可传输数据,验证硬件及固件的准确性;4.按Mass Storage不得Bulk-Only 模式供给描写符,PC 机上装备类型变成Mass Storage Device;5.响应了Bulk-Only 的Inquiry 敕令,可以消失盘符了,但尚无法拜访磁盘;6.供给了其他所有的UFI敕令(SCSI 子集),开端读取磁盘0 扇区(BPB 区)的内容按照FAT12 的格局7.在AT-89C55WD EEPROM虚拟一张软盘,可以准确读守信息,可以拜访盘符,列目次为空;8.,软盘中放一个可履行的文件,可以正常运行这个可履行文件;8.创建文件,向装备发出Write 敕令,等等.下面从具体现实操纵方面来描写调试各阶段的步调5.2.3.检讨USB 器件工作与否肯定USB 芯片是否已经正常工作,是所有调试的基本,得到电路板之后,这是一个起首要解决的问题.断定USB 芯片是否已经工作,可以应用SoftConnect ,则在主程序中进行软衔接后,假如PC 机上消失未知装备,则解释USB 进行软衔接正常,也解释芯片已经工作了.别的就是应用Bus Hound ,不雅察USB 总线上的数据,从而断定主机与装备之间的通讯已经进行到哪一步了.在主程序中,对USB 初始化进程为:①初始化MCU 的各类端口;②进行中止初始化,设置中止办事程序进口地址,将MCU 的中止方法设置为低电平触发,因为D12 只要进入中止后INT_N 就一向为低.③断开SoftConnect ,延时1 秒后再次衔接④进入主程序轮回,等待中止的到来⑤由中止办事程序处理所有与USB有关的操纵.USB 装备的调试进程其实就是依据主机的请求,不竭地向主机供给各类信息的进程.是以,懂得主机按照什么样的次序向装备发出请求,即Windows 对USB 装备的列举次序是平常有须要的:GetDeviceDescriptor .主机重要对Length 域感兴致,发送内容必定要准确,特别是第 2 字节type 必定为0x01 ,即Device ;不然,主机将不响应,或这时因为主机对Device 的描写符将有多长现实上都不知道,所以这个步调只是试探性的,目标是得到真正长度,第三步中才正而巴经地读取DeviceDescriptor .体系采取TI公司的MSP430F149作为MCU,Cypress公司的SL811HS作为USB装备掌握器,充分施展各自优势知足低功耗请求.MSP430TI公司的MSP430系列单片机是一种超低功耗的混杂旌旗灯号掌握器,针对不合的应用而由各类不合的模块构成,这些微掌握器可用电池工作,且应用的时光很长,MSP430单片机具有16位RISC构造,CPU中的16个存放器和常数产生器使其能达到最高的代码效力,灵巧的时钟源可以使器件的功率消费最低,数字掌握的振荡器(DCO)可使器件从低功耗模式敏捷叫醒,在短于6μs的时光内激活到活泼的工作方法,平常的内/外设和I/O端口资本,端口P1和P2支撑中止叫醒.SL811HSCypress公司的SL811HS是一款超低功耗的USB主/从装备掌握器,主装备或从装备模式由软件掌握,USB主/从装备掌握器支撑全高速和低速数据传输,内部256字节的SRAM缓存,拜访时地址主动加1,可大大缩短读写指令周期,具有尺度的8位双向微处理器总线接口,个中从装备模式下支撑DMA.六.体系软件设计为了使上位PC机可以或许直接读取该读写器写入U盘的数据,数据存储按照FAT32文件治理方法存储,个中涉及USB和UFI协定以及FAT32文件存储格局.USB(通用串行总线)用于将USB接口的外围装备(device)衔接到主机(host),实现二者之间数据传输的外部总线构造,是一种快速.灵巧的总线接口,USB的传输类型有掌握(control).批量(bulk).中止(interrupt)和同步(synchronous)传输4种,它最大的特色是易于应用,即插即用,主如果用在中速和低速的外设.掌握数据用于在USB接入总线时对其进行设置装备摆设,其他的驱动软件可以依据具体的应用来选择应用掌握传输,这种数据传输不会丧掉数据.典范的批量数据包含象应用打印机或扫描仪时所消失的大数据量的数据,这种批量数据是持续的,经由过程在硬件中实现错误检测功效,并且有选择地进行必定的应进重试操纵,可以在硬件层次上包管数据的靠得住交流.由装备自觉产生的数据传输是中止数据传输,这类数据传输可以由USB装备在随意率性时刻提议,并且USB总线以不低于装备解释的速度进行传输.同步数据在产生.传送和处理进程中是持续的和及时的,在稳固的同步数据发送和吸收速度中包含了响应的时钟信息,为了保持准时关系,同步数据必须按照吸收的速度进行传输.6.2 BULK_ONLY和UFI协定USB装备分为5大类,即显示器.通讯装备.音频装备.人机输入和海量存储.平日所用的U盘.移动硬盘均属于海量存储类.海量存储类的规范中包含4个自力的子规范,即CBI传输.Bulk-Only传输.ATA敕令块.UFI敕令规范.前两个协定界说了数据/敕令/状况在USB总线上的传输办法,Bulk-Only传输协定仅仅应用Bulk端点传送数据/敕令/状况,CBI传输协定则应用Control/bulk/interrupt三种类型的端点进行数据/敕令/状况的传送.后两个协定界说了存储介质的操纵敕令,ATA协定用于硬盘,UFI协定则针对USB移动存储,U盘读写器的设计遵守Bulk-Only传输协定和UFI敕令规范.UFI敕令块规范是针对USB移动存储而制订的,它总共界说了19个12字节长度的操纵敕令.Bulk-Only事务以主机向装备发送CBW(Command Block Warp)包,并以树立响应的数据传输开端的,装备吸收到CBW包,检讨并解释它,试图知足主机的请求,并经由过程CSW(Command State Wrap)包向主机返回状况信息.CBW是主机经由过程Bulk-Out端点向装备发送的敕令块包,在CBW中应用偏向位和数据传输长度域指明等待的传输,CBW必须肇端于包鸿沟,并且必须以31字节的短包传输停止,接踵的数据包和CSW包必须开端于一个新的包鸿沟,所有的CBW包必须按低字节在前的次序传输.CBW包构造如图2所示,各域寄义如下:表3 CBW包构造1)敕令块包标识.CBW包标识表记标帜,标明这是一个CBW包,这个域的值为43425355H.2)敕令块标识表记标帜.当装备返回响应的CSW包时,必须使敕令状况标识表记标帜域的值与此值雷同.3)数据传输长度.指明敕令履行时代在Bulk端点上传数据的字节长度,假如这个域的值是0,则在CBW和CSW之间装备和主机不传输任何数据,并且装备将疏忽在敕令块标旗域中的偏向位的值.4)敕令块标旗.偏向位划定了Bulk端点数据传输的偏向,其他位预留.5)逻辑单元号.指天敕令块被发送到的逻辑单元号,假如装备不支撑多个逻辑单元号,则主机将这个域设置为0.6)CBWCB长度,界说了CBWCB的有用长度,正当值为1-16.7)CBWCB.由装备履行的敕令,由装备解释.CSW向主机标明来自于CBW包的敕令块的履行状况.装备收到CBW包解析处理后将经由过程Bulk-In端点发送一个CSW包.CSW开端于包鸿沟,并以13字节的短包停止,构造如图3所示,各域寄义如下:表4 敕令状况包构造1)敕令状况包标识.CSW包的标识表记标帜,标明这是一个CSW包,这个域的值为53425355H.2)敕令状况标识表记标帜.次域的值域CBW包的敕令块标识表记标帜雷同.3)数据残存.现实数据传输量与CBW包中划定的数据传输长度的差值.4)敕令履行状况,标明敕令成功或掉败信息,假如敕令履行成功,则装备将设置此域的值为0,非0值;则标明掉败或错误.UFI是针对USB移动存储而制订的敕令块协定,它划定了主机和装备进行信息交流所应用的敕令块.数据和状况信息,Bulk-Only传输协定界说了传输这些信息的办法,个中UFI 敕令块是封装在CBW包中的CBWCB,装备经由过程读取CBWCB肯定具体要履行何种操纵敕令(如读敕令),若何完成这个敕令(如从闪存的哪个地址读,须要读取的长度),装备将敕令的履行状况封装成CSW返回给主机.UFI用于大多半敕令的12字节敕令块的描写,构造如图4所示,个中各参数意义如下:1)操纵敕令代码.指明所须要履行的操纵敕令;2)逻辑单元号.指明敕令将发送到哪个逻辑单元,假如装备只有一个逻辑单元,则此域的值为0.3)逻辑块地址.敕令操纵的肇端地址.4)传输长度,指明请求传输的数据量,平日以"扇区"作单位,但是有几个敕令是以"字节"作单位的,对于这些敕令,传输长度域可以以不合的名字标识,若此域的值为0,则概况没稀有据须要传输.5)参数列表长度,用于指定发送到装备的字节数,这个域典范的应用于发送到装备的参数敕令块(如模式参数.诊断参数等),若此域的值为0,则概况没稀有据须要传输.6)分派长度,指明主机已经分派的用于返回数据的最大字节长度,若此值为0,则标明没稀有据须要传输.表5 UFI构造6.3 FAT32FAT是Microsoft较早推出的文件体系,具有高度的兼容性,今朝仍然普遍应用于小我电脑尤其是移动存储装备中,FAT由引诱扇区.FAT1表.FAT2表.目次和文件区构成(个中FAT2表是FAT1表的备份).磁盘的治理是以扇区为单位的,而移动存储装备则是以块为单位的,FAT将块映射成扇区,道理雷同,FAT将磁盘空间以必定命目标扇区为单位进行划分,如许的单位成为"簇".平日情形下,每扇区512字节的原则是不变的,簇的大小一般是2n(n 为整数)个扇区的大小.所以以簇为单位而不以扇区为单位进行磁盘的分派,是因为当区分容量较大时,采取512字节的扇区治理,会增长FAT表的项数和大文件存取的消费,使文件体系效力不高.引诱扇区DBR(DOS Boot Record)平日占用分区的第0扇区,共512字节,FAT表紧随厥后.DBR的第一部分是一个x86跳转指令.厂商标记和操纵体系版本号,接下来的从偏移0x0B开端的是一段描写可以或许使可履行引诱代码找到相干参数的新闻,平日称之为BPB.最后是引诱程序代码以及扇区停止标记.BPB中记载了扇区大小.簇的扇区数.保存扇区数.FAT表大小和文件体系类型等重要参数,用于文件的索引和定位盘算.USB读写器软件由主模块.USB模块.BULK模块.FAT模块和中止处理模块构成.各模块之间互相调和挪用,配合完成对U盘文件的读写创建.USB模块负责检测USB装备的移入/移出,对拔出的装备进行列举,分派装备地址端点号,设置装备摆设装备接口端点描写符,树立BULK_ONLY输入/输出通道,BULK模块则在已树立的BULK_ONLY输入/输出通道发送CBW数据包,并吸收CSW数据包,经由过程CBW中嵌入的CBWCB信息肯定对U盘读/写操纵的扇区地位和大小,FAT模块重要完成簇和扇区间的索引定位,即在U盘内寻址,应用BPB中的参数盘算给定扇区的地点簇以及进入休眠状况,等待外部中止叫醒.中止处理模块是在中止叫醒后依据中止类型进入不合功效子模块的,也是全部软件体系的焦点部分.中止模块吸收到串口或并口数据后,依据内部敕令字请求进行解析,敕令字请求如图5所示,串口或并口数据吸收流程如图6所示.表6 敕令和数据字构造七.仿真调试剖析在人造金刚石压力机压力锤头裂纹检测中,采取声发射技巧进行及时监控,一旦消失平常立刻停机报警,为了对消失平常时的数据进一步剖析,须要将现场数据带回研讨室.应用基于嵌入式的U盘读写器可以免除现场布线的麻烦,还可以省去PC机端驱动软件的开辟,直接将现场数据写入U盘,便利地应用PC机中装配的MATLAB进行数据的具体剖析处理.八.嵌入式体系进修心得起首,我要感激先生赐与了我此次课程设计的机遇.在此次嵌入式体系课程设计中,固然有些难题和迷惑之处,但在同窗和先生的帮忙下,最终也是完成了最后的课程设计.经由过程此次的课程设计,我对ARM嵌入式有了深刻的懂得,同时,对硬件MSP430F149和SL811HS也有所熟习.在软件上,经由过程对USB协定.BULK_ONLY.UFI 协定.FAT32和软件体系模块的应用也让我受益匪浅.在操纵上,经由重复的进修和斟酌,也由不熟习变成闇练.理论常识方面也是经由过程与同窗和先生们的评论辩论,最终也达成了试验的目标,得到了响应的成果.对于本次试验的课题——嵌入式体系U盘开辟的设计,基于嵌入式U盘读写器的设计实现我以为可以便利地将下位机数据存储到通俗U盘,完整解决了工业掌握中高低位机之间数据传输难的问题,也为今后其他范畴的应用创造了前提前提.如长途客车中的黑匣子.家庭白叟健康监测等等.在人们今后的生涯中,跟着USB技巧和闪存技巧的进一步成长,这种嵌入式U盘装备应用范畴将会慢慢扩大,在今后的市场大将有着优越的远景,同时也会对人们的生涯供给不小的帮忙.九.参考文献[ 1 ] 潘松,王国栋.VHDL适用教程[M].西安:电子科技大学出版社,2001.[ 2 ] 王坤,侯国屏,赵伟.可编程仪器掌握规范和症结技巧(一)。
文章编号: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的超低功耗技术在众多单片机中独树一帜,同时它具有集成高度等特点,因此,选用该控制器作为系统的主控制器,实现数据采集和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盘设计摘要随着科学技术的快速发展,人们生活水平的提高,信息化程度的提高,信息的传输交换需求也就越来越多。
在科学技术迅猛发展的今天,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的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 课题研究背景随着科学技术的快速发展,人们生活水平的提高。
五、结语中国互联网络的发展方向从技术层面讲,新一代互联网将会发展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互感器检测仪的主要用途是对现场应用的或者在实验室应用的电压互感器相电流互感器进行技术性能的检定。
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 接口的支持模块才真正日趋成熟。
分类号: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, 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 课题研究背景随着科学技术的快速发展,人们生活水平的提高。
如今,电脑已经成为了我们生活的一部分,那么拷贝数据则成了家常便饭,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 电源选择电源模块是单片机应用系统或数据采集系统中不可缺少的部分,也是保证系统稳定、安全工作的前提。
单片机USB模块PC电源模块SD 卡模块本设计用到的电源为 3.3V,属于小功率稳压电源,采用三端稳压芯片AMS1117。
用其设计的是线性稳压电路,具有结构简单、输出电压稳定性强、精度高等优点,因此给本系统供电完全满足要求。
3 系统电路设计与分析3.1 单片机最小系统3.1.1 MSP430F5529单片机简介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-1 MSP430F5529单片机的内部框图3.1.2 电路分析单片机最小系统由MCU、时钟电路、复位电路和电源模块组成时钟电路:MSP430F5529使用4MHz的晶体振荡器作为振荡源,电容容量为30P。