======= MIGHT ======= {{template>:project:infobox| image=gpib1.JPG?200| name=MIGHT| founder=[[user:nephirus]]| interested=| status=finished}} ~~META: status = finished &relation firstimage = :project:gpib1.JPG ~~ MIGHT stands for Multi-Interface GPIB Handling Tool. Its purpose is to provide a way to control [[https://secure.wikimedia.org/wikipedia/en/wiki/IEEE-488|GPIB]] enabled devices using more common interfaces (i.e. Ethernet, USB, I2C, SPI, etc.). GPIB interface can be found on many lab tools - power supply units, signal generators, multi-meters, oscilloscopes, etc. Unfortunately, commercially available controllers cost from %%$%%150+ (low-end) to several thousand dollars (hi-end). Thus not many hobbyists can afford those. MIGHT aims to be low-cost device, so you can spend your money on some more important stuff :-). ===== Hardware ===== Current version (mk3) uses [[http://www.ti.com/product/LM3S9U96|LM3S9U96]], which is sold in reasonable quantities, and has USB host support, CAN interface and Ethernet. PCBs are from Seeed Studio Fusion PCB service ($25 for 10 boards). **FIXME** add photos ==== Programming the MCU ==== Stellaris microcontrollers are either factory-programmed with serial flash bootloader or have bootloader in ROM. ROM bootloader is loaded if the flash memory is empty or when conditions specified in BOOTCFG register are met. TI provides a [[http://www.ti.com/tool/lmflashprogrammer|flash programming utility]] (Windows-only though). If you want to implement your own loader, there is an [[http://www.ti.com/general/docs/lit/getliterature.tsp?literatureNumber=spma029&fileType=pdf|application note]] describing the protocol used for communication with bootloader. If you somehow screwed up the bootloader (or you are just uncomfortable with using serial port), you can use JTAG interface. There are plenty of JTAG adapters to be found on the Internet, you'll probably want one with [[http://openocd.sourceforge.net/doc/html/Debug-Adapter-Hardware.html|OpenOCD support]]. === JTAG flash programming example === Launch OpenOCD with proper arguments (substitute flossjtag-noeeprom.cfg with config for your programmer). nephirus@anachronos:~> openocd -f /usr/share/openocd/scripts/interface/flossjtag-noeeprom.cfg -f /usr/share/openocd/scripts/target/stellaris.cfg Connect to OpenOCD daemon. nephirus@anachronos:~> telnet localhost 4444 Flash the image. halt flash write_image /path/to/image.bin ==== Known issues ==== === LDO and VDDC pins are not connected on board === Due to confusing description of pin function in [[http://www.ti.com/mcu/docs/litabsmultiplefilelist.tsp?sectionId=96&tabId=1502&literatureNumber=spma036&docCategoryId=1&familyId=2940|System Design Guidelines for Stellaris Microcontrollers]], VDDC power rail is not connected to internal LDO output. == Solution == Connect pins 7, 38, 88. ===== Repository ===== Sources can be found at [[https://github.com/Nephirus/might|my Github repo]]. ===== Gallery ===== [[https://github.com/Nephirus/might/raw/master/eagle/might/might_mk3_board.png|PCB]] [[https://picasaweb.google.com/113807245296602021487/MIGHT]] ===== Previous versions ===== ==== mk1 ==== Proof-of-concept version. [[http://mbed.org|mbed]]-based board. mbed was chosen for its on-board Ethernet PHY chip. First prototype was able to communicate with oscilloscope Tektronix TDS 2002, using serial port or Ethernet on PC side. However, mbed environment is not quite user-friendly (one has to choose between GCC-based toolchain with only basic libraries and awful online IDE with many libraries), so this approach was abandoned for [[http://ti.com/stellaris|TI Stellaris]]-based board. **FIXME** add photos ==== mk2 ==== Second version was built around [[http://www.ti.com/product/lm3s8938|LM3S8938]]. Unfortunately, there were some issues with vias on homemade dual-sided PCB which led to development of third version. **FIXME** add photos ===== Links ===== * [[http://www.ti.com/lsds/ti/microcontroller/arm_stellaris/code_examples.page|TI StellarisWare]] * [[http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?arnumber=1405845|60488-1-2004 IEC/IEEE Standard - Part 1: General (Adoption of IEEE Std 488.1-2003)]] * [[http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?arnumber=1352831|60488-2-2004 IEC/IEEE Standard - Part 2: Codes, Formats, Protocols and Common Commands (Adoption of (IEEE Std 488.2-1992)]] * [[http://www.sics.se/~adam/lwip/index.html|lwIP - lightweight TCP/IP stack]] * [[http://coocox.com/CoOS.htm|CoOS - realtime OS for ARM Cortex M series]] * [[https://github.com/hugovincent/mbed-freertos|mbed-freertos]] * [[http://www.physics.fsu.edu/users/Wahl/labmanuals/instruments/osc/Tek071107500.pdf|Tektronix TDS 2002 Programmer's Manual]] * [[http://digital.ni.com/public.nsf/allkb/044FA220F32774ED86256DB3005850CA|NI Knowledge Base - USB Test & Measurement Class]] * [[http://zone.ni.com/devzone/cda/tut/p/id/3509|NI Developer Zone - Instrument Bus Performance]] * [[http://www.usb.org/developers/devclass_docs|USB Class Specifications]]