Home
USBprog User's Manual
Contents
1. Startet den Treibersoftwareupdate Assistenten fiir das ausgew hlte Ger t Wie m chten Sie nach Treibersoftware suchen Automatisch nach aktueller Treibersoftware suchen Auf dem Computer und im Internet wird nach aktueller Treibersoftware f r das Ger t gesucht sofern das Feature nicht in den Ger teinstallationseinstellungen deaktiviert wurde Auf dem Computer nach Treibersoftware suchen Treibersoftware manuell suchen und installieren x R Der Herausgeber der Treibersoftware konnte nicht berpr ft werden Diese Treibersoftware nicht installieren Sie sollten auf der Website des betreffenden Herstellers nach aktualisierter Treibersoftware f r das Ger t suchen gt Diese Treibersoftware trotzdem installieren Installieren Sie nur Treibersoftware die Sie von der Website oder einem Datentr ger des Herstellers erhalten haben Nicht signierte Software aus anderen Quellen kann Sch den auf dem Computer verursachen oder zum Verlust bzw Diebstahl von Informationen f hren Y Details einblenden Figure 3 3 Manual driver installation on Windows German only 17 3 Getting Started with the Software Dependencies When compiling software from source care must be taken to ensure that all dependencies are installed on the computer The USBprog software needs following other software components If you use dis tribution packages to install these dependencies ensure that the h
2. Detecting on USB AVRISP mkll with serial number 000040012825 found Getting isp parameter SD 0x03 OK Figure 5 3 Programming dialog of AVR Studio 37 Bibliography AVRDUDE Manual http www nongnu org avrdude user manual avrdude html Installing MacPorts http www macports org install php Creative Commons license Attribution Share Alike 3 0 Unported http creativecommons org licenses by sa 3 0 WinAVR User s Manual http winavr sourceforge net WinAVR user manual html 38
3. Nicht suchen sondern den zu installierenden Treiber selbst w hlen Verwenden Sie diese Option um einen Ger tetreiber aus einer Liste zu w hlen Es wird nicht garantiert dass der von Ihnen gew hlte Treiber der Hardware am besten entspricht lt Zur ck Abbrechen Figure 3 1 Installation workflow on Windows XP German only 15 3 Getting Started with the Software LL Ger tetreiberinstallation Sa Die Geratetreibersoftware wurde nicht installiert Nehmen Sie Kontakt zum Hersteller auf um Hilfe zur Ger teinstallation zu erhalten usbprogBase Mode x Es wurde kein Treiber gefunden Wie soll vorgegangen werden wenn das Ger t nicht korrekt installiert wurde SchlieBen Figure 3 2 No driver has been found German only 3 1 3 MacOS Porting Unix software to the Mac is easy but developing cross platform software that feels really MacOS like is hard especially if you are software developer and not designer Therefore we don t provide a software package for the Mac But nevertheless It s easy to install the USBprog software on the Mac You can compile USBprog directly from the source as described in section 3 1 4 However it s more easy if you use MacPorts Just install MacPorts on your computer as described in 2 After that open a Terminal and execute sudo port install usbprog After that you can start the command line tool with usbprog in a shell and the GUI with usbprog gui
4. that does not work on Microsoft Windows 29 4 USBprog Software Reference Starting a Firmware If you now disconnect the device leave the JP3 jumper connected and connect the device again the device again shows in update mode However we know that we flashed the blinkdemo firmware We could now remove the jumper and start it or flash the firmware again But we could also use the start command usbprog devices 0 Bus 006 Device 006 1781 c620 usbprog USBprog in update mode usbprog start Device successfully started The firmware starts we see the blink frequency changing 4 4 6 Managing the Cache Downloading Everything Of course it s also possible to download every firmware file with the command line interface Just use download all usbprog download all Downloading at89prog TARRO HA AA AAA SAA AAA AAA AAA A SARA AAA AAA AAA A AAA AAA A AAA TARA AAA Downloading AVRISP mk2 Clone JAA RIAIIOIIIIIIIRIIAAApA Cleanup A cache cleanup can be done with the cache OPERATION command It has two functions e If you just want to delete unused files execute cache clean That can be firmware files that are not referenced by the index file any more because they have been removed or the version has been increased e If you want to delete the full cache use cache delete This example shows the effect of the last command usbprog list JTAGICE2 JTAGICE2 XSVF Player XSVF Player at89prog
5. at89prog avrispmk2 AVRISP mk2 Clone blinkdemo x LEDBLINK 30 4 USBprog Software Reference openocd x OpenOCD Debugger simpleport SimplePort usbprogrs232 x usbprogRS232 usbprog cache delete usbprog list JTAGICE2 JTAGICE2 XSVF Player XSVF Player at89prog at89prog avrispmk2 AVRISP mk2 Clone blinkdemo LEDBLINK openocd OpenOCD Debugger simpleport SimplePort usbprogrs232 usbprogRS232 As you see after the cache delete operation no firmware is in the cache any more 4 4 7 Offline Mode While the GUI starts in offline mode automatically when it detects no working internet connection the command line client doesn t do that If you don t have an internet connection the program refuses to work usbprog Error CURL error Couldn t resolve host ww ixbat de However you can activate the offline mode with the o or offline flag usbprog o WARNING You re using usbprog in offline mode usbprog _ 4 4 8 Expert Options Debugging To get debugging output on standard error use D or debug You can redirect that debugging output to a file using the standard shell feature usbprog debug 2 gt debug log usbprog _ Alternative Data Directory Although section 4 1 2 on page 23 mentions that the cache is stored in a fixed directory location that location can be overwritten with d DATADIR or datadir DATADIR 31 4 USBprog Software Reference
6. 3 1 4 Compiling USBprog from Source Operating Systems This section describes how to build USBprog from source Sometimes there are valid reasons that even normal users and not developers wish to compile the program from the source code e a newer version is available that fixes a bug but the distribution package is too old e amore exotic Linux distribution is used for which no binary packages are available e even another operating system not Linux or MacOS is used Therefore that section describes how to compile USBprog on Unix which includes MacOS Compil ing it on Windows is completely different Since there is always a binary setup package is available on that platform the reasons mentioned above don t apply here If you want to compile USBprog on Windows refer to the file win32 README in the USBprog source distribution 16 3 Getting Started with the Software Datei Aktion Ansicht em LAA ES 4 a keppler gt gt Akkus 4 b Andere Ger te gt 17 Anschl sse CO Treibersoftware aktualisieren gt Audio Video ul Deaktivieren DAR Computer Deinstallieren gt 3 Diskettenlaufwerk gt le Diskettenlaufwerk Nach ge nderter Hardware suchen gt et DVD CD ROM La A Grafikkarte sin pri gt Eg IDE ATA ATAPI Controller gt Laufwerke gt M use und andere Zeigeger te gt Monitore gt Netzwerkadapter p gill Systemgerate b Tastaturen b 7 USB Controller
7. 4 4 9 Batch Mode As already mentioned you can use usbprog not only in interactive shell mode but also in batch mode Just specify the commands as arguments of usbprog like in that example o usbprog devices No devices found Since the number of arguments for a command is always fixed you can specify multiple commands without a separator usbprog device 0 download blinkdemo upload blinkdemo gt device 0 gt download blinkdemo Firmware blinkdemo has been downloaded successfully gt upload blinkdemo Switching to update mode Opening device Writing firmware Starting device Detecting new USB devices To be able to read the error messages correctly if specified multiple commands the usbprog program adds the command before showing the output prefixed with gt That s why help doesn t take a command as argument and you have to use either or helpcmd 32 5 Common Firmwares 5 1 Conventions When describing pinouts the we use always the pin numbering scheme in figure 5 1 13579 246 810 Figure 5 1 Pin numbering used in that document 5 2 Atmel AVR ISP mkll Clone 5 2 1 Purpose The AVR ISP mkII is a device from Atmel to program AVR microcontrollers You can view a picture online at following site im http www atmel com dyn products tools_card asp tool_id 3808 This firmware emulates that device The advantage of emulating this device rather than inventing an
8. For following systems are supported e Microsoft Windows 2000 XP Vista and 7 e Linux tested on openSUSE and Ubuntu MacOS X tested on 10 5 That can be a second already initialised USBprog or another ISP programmer 1 Overview 1 3 About this Document This documentation should be both A guide to get started for people that just bought the hardware and want to install the software and use the hardware and also a reference documentation for both the software and the most common firmwares If you have any suggestions how to improve the software and the documentation or if you just find problems please don t hesitate to contact the author via e mail at bernhard bwalle de However I probably cannot help with hardware or firmware problems See section 1 5 in that case This document is available under the terms of the Creative Commons license Attribution Share Alike 3 0 Unported 3 1 4 Terms and Definitions At first we introduce the term firmware and bootloader as we use it in the rest of the document Firmware The main advantage of the USBprog device is that the firmware can be exchanged The firmware is the program which is loaded into the flash memory of the USBprog device and which is used to perform a specific task Programming AVR microcontrollers emulating a JTAG debugger and so on Bootloader While the main firmware is exchanged with the computer program the flash contains also a part at the highest po
9. computer wait a few seconds to make sure that the operating system detected the device Back to the USBprog software the devices command should display a single USBprog device usbprog devices 01 Bus 003 Device 002 1781 c620 usbprog USBprog in update mode Since it s the only device and since the device is already in update mode the star after the num ber shows you that this device is already selected So you can proceed and upload the blinkdemo firmware That firmware does nothing but blinking the LED Blinking the LED you ask It s already blinking Well the sequence is different so it should be easily possible to distinguish the blinkdemo blinking from the update mode blinking Enough talking Let s now upload the firmware usbprog upload blinkdemo Opening device Writing firmware MAMAR RA AAA RA RRA A RARA AAA RARA AREA RARA ARA AAA REA REA AAA RARA AAA REA REA AAA REA AAA RARA AAA Starting device Detecting new USB devices Okay that s it The next chapters describe both the GUI and the command line in detail If you then want to do something real with your USBprog like programming an AVR microcontroller read chapter 5 on page 33 22 4 USBprog Software Reference 4 1 The Firmware Pool 4 1 1 Overview Both the GUI and the command line use the firmware pool available in the internet Therefore you need an internet connection to use USBprog at least at the first time Since the firm
10. rules in dependent on the udev version So it is in the folder where the built files are not in the source tree and you have to build the program first to get the file In that file replace the term USBPROG_GROUP with the name of the group you want to use and copy the file in etc udev rules d Since the lexico graphic order in that directory determines the priority processing order of rules it s quite common to prefix it with a number Example sed e S USBPROG_GROUP plugdev g build usbprog rules in gt etc udev rules d 98 usbprog rules Of course modern Linux distributions especially Red Hat and SUSE flavours offer more complicate solutions to give the current desktop user more permission to the devices However that solutions are not standardised tend do change every year and sometimes even are poorly documented There fore we don t describe that here For the average user this group based solution is sufficient You can create a new group called usbprog or you can simple re use an existing group like plugdev on Ubuntu for storage devices 19 3 Getting Started with the Software However You don t want to use that solution in a centrally administered company network Contact your system administrator instead 3 2 The Update Mode 3 2 1 How USB Works USB Device Identification You don t know much about USB to use USBprog However one fact is important to understan
11. sudo usermod aG dialout USERNAME Fedora gt 10 where USERNAMEG has to be replaced with the login of the user that should be in that group See also usr share doc usbprog README CentOS Fedora RedHat 3 1 2 Windows Supported Systems This section describes the installation of USBprog on Windows Although binary packages are provided the installation is not trivial since we need to install a device driver unlikely the other operating sys tems that are able to handle USB devices in userspace without driver installation At first make sure that you re running one of following operating systems Windows 2000 with SP4 Windows XP with SP3 32 bit only e Windows Vista with SP1 32 bit or 64 bit Windows 7 32 bit or 64 bit I was not able to test Windows Vista since I don t have it The problem that prevented other USB devices from working after the installation of the USBprog software should be resolved at Windows 7 also was affected and Windows 7 works now 12 3 Getting Started with the Software Although the installation package is prepared to run on a 64 bit Windows I was not able to test it If you are successfully able to use it please drop me a note Getting the Software Note Please install the software before attaching the hardware the first time That makes it easier for you If you already attached the hardware abort the driver installation process You can download the latest Windows i
12. the Hardware This section describes how to install the bootloader If you bought a version of USBprog which already contains the bootloader you can safely skip that step If you don t know if you have a version with bootloader please read section 2 2 1 2 2 1 Check if the Bootloader is Installed To check if the device already contains a bootloader just put the device into programming mode manually For this step you don t require any specific PC software You just need a working USB port 1 Disconnect your USBprog from the computer if it s connected 2 Close the jumper JP3 as described in section 2 1 2 on page 5 3 Connect the USBprog to a USB port If LED1 see figure 2 1 on page 5 now blinks everything is fine If not there s no working bootloader and you need to flash it 2 2 2 Flashing the Bootloader When buying a USBprog at the Embedded Projects Webshop you can choose between a slightly cheaper version without an already flashed bootloader and a slightly more expensive version that already has flashed the bootloader Flashing the bootloader is the only step where you need a second programming device It s possible to use an already initialised USBprog with the AVRISP mk2 Clone firmware flashed Any other programmer for Atmel AVR microcontrollers will do it too You need the standardised ISP interface We need not only a programmer but also a programming software While there are plenty of program mer
13. to the GUI you must download the firmware file to the cache Selecting a Device The devices command gives you a list of available updatable devices usbprog devices 0 Bus 006 Device 004 1781 c620 usbprog USBprog in update mode In that case the device is already selected as update device This is the case if there s only one device available and if that device is already in update mode see section 3 2 2 on page 21 Otherwise select the device with the device NUMBER command as update device usbprog device 0 Downloading the Firmware The List command shows you with the missing star that the bLinkdemo is not downloaded Just download the firmware with usbprog download blinkdemo RARE EEE EEE EE EEE EEE EAHA Firmware blinkdemo has been downloaded successfully Uploading the Firmware It s recommended that you manually put the hardware in update mode as described in section 3 2 2 on page 21 If that s not done and you selected another device as update device the software tries to put the device in update mode first In any case just upload the firmware with upload FIRMWARE usbprog upload blinkdemo Opening device Writing firmware MAMAR AAA RRA A RARA AAA RA RRA RARA AAA RARA AAA REA REA AAA RARA AAA REA REA AAA REA AAA RARA AAA Starting device Detecting new USB devices As the output indicates the firmware starts immediately in that case the LED blink frequency changes
14. up 2 Connect the device 3 After a few seconds the New Hardware Wizard should appear 4 Don t connect with Windows Update you don t find a driver for the USBprog there 5 Choose Install from a list or specific location Advanced 3also known as x64 or amd64 13 3 Getting Started with the Software 6 Select Search for the best driver in these locations and tick Include this location in the search 7 Choose Browse and select the driver directory mentioned above c Program Files USBprog driver That s it Figure 3 1 on the following page shows screenshots of the dialog German only To test your installation fire up the USBprog software In the command line mode devices should list exactly one USBprog device and in GUI mode the combo box should have also an entry Driver Installation on Windows Vista and 7 The following procedure describes only Windows 7 but Windows Vista should be similar To install the driver perform these steps We assume that you successfully installed the bootloader on the device as described in section 2 2 on page 7 Note If you have a 64 bit version of Windows Vista or 7 you cannot install unsigned device drivers by default However there s a software called Driver Signature Enforcement Overrider that should solve that problem Use the software at own risk sorry Okay let s start At first you need to insert jumper JP3 see section
15. 09009 80080 Figure 4 3 Pin assignment of the avrispmk2 firmware 25 4 USBprog Software Reference 4 Click on Upload The progress bar should tell you that there s a upload in process and the string Upload successful should show up in the status bar The software also starts the firmware immediately Don t forget to remove the JP3 jumper If you want to upload a firmware that is not in the cache click on the radio button Local disk and use Browse to select a full path to the firmware file binary format The rest is the same 4 3 4 Debugging If something doesn t work and you need support from the author or any other party listed in sec tion 1 5 on page 4 a logfile is always helpful To write a log file in the GUI click on Program Logging and select an appropriate path You can also start the application in logging mode usbprog gui D This logs to standard error To redirect that to a file just use the redirection operator of the shell Unix only usbprog gui D 2 gt path to logfile log 4 4 USBprog Command Line 4 4 1 Overview Why use the command line version if there s a GUI section 4 3 on page 24 There are several reas ons e The command line version is available everywhere for example on RHEL there s no wxWidgets package therefore it s much more work to get the GUI running The command line version can be scripted Some people lik
16. 2 1 2 on page 5 to put the device into programming mode after power up Then connect the device Now Windows looks for a matching driver and doesn t find one This procedure takes about one minute and then the dialog shown in figure 3 2 on page 16 appears So we have to install the driver manually 1 Open the Device Manager You find it in Control Panel Hardware and Sound Devices and Printers Device Manager 2 The device usbprogBase Mode should appear there with a little warning sign as shown in figure 3 3 on page 17 in the first picture Select Update driver 3 Windows asks you where you want to search for the driver figure 3 3 on page 17 second pic ture Choose to manually specify the location and select c Program Files USBprog driver then 4 Ared warning that the driver is not signed appears figure 3 3 on page 17 third picture Confirm the driver installation That s it To test your installation fire up the USBprog software In the command line mode devices should list exactly one USBprog device and in GUI mode the combo box should have also an entry tat least in my installation in VirtualBox maybe a native Windows is much faster 14 3 Getting Started with the Software Assistent fiir das Suchen neuer Hardware Willkommen 5 Es wird nach aktueller und aktualisierter Software auf dem Computer auf der Hardwareinstallations CD oder auf
17. 834 x32a4 ATXMEGA32A4 opt cross etc avrdude conf 14737 Uploading a Firmware To upload a program called blink hex just use avrdude p m8 e U flash w blink hex y 5 2 4 Programming AVRs with AVR Studio It s a matter of taste whether you use AVRDUDE or AVR Studio to program your AVRs If you don t use Microsoft Windows the decision is easier since AVRDUDE runs on basically any operating system while AVR Studio only runs on Windows The advantage of AVR Studio is clearly that it s integrated in the rest of the IDE so you don t have to fire a command prompt to program the device If you have not already downloaded and installed AVR Studio we suggest to visit following site that contains direct links to the latest AVR Studio versions You can download the program then without registering at Atmel m http www mikrocontroller net articles AVR Studio After you installed AVR Studio don t forget to install the Jungo USB driver needed for the AVR ISP mkII device regardless whether it s the original or the clone Read the included documentation if you have problems 35 5 Common Firmwares If that s done you should be able to connect with the device using Tools Program AVR Connect Select AVRISP mkII in the left list and USB in the right list as shown in figure 5 2 on the following page Now it takes a few seconds and the programming dialog shown in figure 5 3 on the
18. Additional Groups is selected on the right select the group press SPACE to mark that group and leave YaST by pressing F10 twice Fedora CentOS and RHEL You may be surprised but the binary packages for Fedora Red Hat and CentOS are also built in the openSUSE Build Service The only difference of that section compared with the previous section is that we describe yum instead of zypper here There s no command so add a repository in yum Instead you have to change to the directory etc yum repos d and download the repository file In that case you have to substitute DIST with values of table 3 2 on the next page 11 3 Getting Started with the Software SU cd etc yum repos d wget http repos opensuse org electronics DIST electronics repo String Distribution Fedora_11 Fedora 11 Fedora_12 Fedora 12 Cent0S_5 CentOS 5 RHEL_5 Red Hat Enterprise Linux 5 Table 3 2 Distribution strings for Red Hat like distributions in the Build Service Since the refresh is done automatically by yum just install the package s with yum install usbprog usbprog gui As with SUSE and Ubuntu you can omit the usbprog gui package if you don t plan to use the graphical user interface If you want to access the USBprog as user that user has to be put in the uucp group on RHEL CentOS 5 or in the dialout group on recent Fedora versions Just execute sudo usermod aG uucp USERNAME RHEL 5 CentOS 5
19. USBprog User s Manual Bernhard Walle bernhard bwalle de 14th July 2014 Contents 1 Overview td The UShprom Hardware 4e 28 nanei oR Te a a OAR UE Fa R L2 The USBprog SOU Su Jesus A bai DAT YASH ED ER REE SS 1 3 Aboutithis Document s eii sa bee eG EE eS da See SE ee 14 Terms and Definitiotis 642444 2644655449 RAMS a date OS L5 Getting SUpport se sa 2 Kun an ak See doses serre 2 Getting Started with the Hardware 31 Commectors Mapas nny LED ee a0 4 e ee He are SR EROS EE SO 2 2 Initialisethe Hardware 3 Getting Started with the Software 32h Installation rasen aa Sa an ee ae ee Eee ae Oe oi Ge 32 The Update Mode caia a PRA Os Rene Roem bet Gade bbe es 33 Upload the First Firmware oq sa bse non ERA ESS naar 4 USBprog Software Reference 41 The Firmware Pool soa 3 8 00000 Le wenn LE MS MR bE we BG eee a 42 Configuring a Proxy so 4405445555644 aOR GSH SSS A 43 Graphical User Interlace u 4004 us ed e RA A SRA RH HESS 44 USBprog Command Ines gt ss se es ew wet Re ye nn 5 Common Firmwares Bol CONVERUONS e Les e e ok RAM SR A ERE A E a ae ee e G 52 Atmel AVR ISP mk Clone 2244 Gene dace aaa a e a a Pees Bibliography A A PW WwW WO oa O1 10 10 20 21 23 23 23 24 26 33 33 33 38 1 Overview 1 1 The USBprog Hardware If you read this document you have probably already an USBprog device In the past every micr
20. d the limitations of the USBprog especially on Microsoft Windows How a USB device is identified Whenever you connect a USB device to the computer the USB host the computer asks the USB device a few things This process is called enumeration After the enumeration process has finished the USB host assigns the USB device an address On Linux this process can be watched in the kernel log with the dmesg command usb 6 1 new full speed USB device using uhci_hcd and address 2 usb 6 1 New USB device found idVendor 1781 idProduct 0c62 usb 6 1 New USB device strings Mfr 1 Product 2 SerialNumber 0 usb 6 1 Product usbprogBase Mode usb 6 1 Manufacturer USBprog EmbeddedProjects usb 6 1 configuration 1 chosen from 1 choice As already mentioned in section 1 4 on page 4 the USBprog device has a special bootloader that allows the firmware to be updated without another device When you connect the USBprog to the computer the device normally starts the firmware If you have flashed for example the avrispmk2 firmware then the device identifies as Atmel AVR ISP mkIP Important Although the USBprog is always the same hardware device depending on the operation mode and the firmware it is seen as totally different devices from the computer s point of view It can even change its identity at runtime without re attaching USB Drivers on Windows Two important things have to be considered when using USB Devices on Microsoft Windows
21. dd the repository to your package list open a shell and then enter 6 sudo zypper ar r http repos opensuse org electronics DIST electronics repo The term DIST amp has to be substituted version of your openSUSE or SLES as shown in table 3 1 String Distribution openSUSE_11 0 openSUSE 11 0 openSUSE_11 1 openSUSE 11 1 openSUSE_11 2 openSUSE 11 2 SUSE_Linux_Factory openSUSE Factory the unstable development version SLE_10 SUSE Linux Enterprise Desktop Server 10 SLE_11 SUSE Linux Enterprise Desktop Server 11 Table 3 1 SUSE Distribution strings for the electronics Build Service repository After that refresh the package list with sudo zypper ref You re now ready to install USBprog sudo zypper install usbprog usbprog gui If you don t need the graphical user interface just omit the usbprog gui package Of course since the repository is now known by the package manager you can also install or uninstall the USBprog packages using YaST If you want to access the USBprog as user that user has to be put in the uucp group on SLES and openSUSE until 11 2 Starting with openSUSE 11 2 the group is dialout The group name has been chosen to match the group of the serial devices dev ttyS See also usr share doc packages usbprog REAI Just use YaST to perform that task Start yast users ona root shell select the user with the cursor keys press F4 Edit press Alt d Details press TAB until
22. der Windows Update Website mit Ihrer Erlaubnis gesucht Datenschutzrichtlinie anzeigen Soll eine Verbindung mit Windows Update hergestellt werden um nach Software zu suchen Ja nur diese eine Mal Ja und jedes Mal wenn ein Ger t angeschlossen wird Nein diesmal nicht Klicken Sie auf weiter um den Yorgang fortzusetzen lt Zur ck Abbrechen Assistent f r das Suchen neuer Hardware Mit diesem Assistenten k nnen Sie Software f r die folgende Hardwarekomponente installieren usbprogBase Mode A Falls die Hardwarekomponente mit einer CD 4 oder Diskette geliefert wurde legen Sie diese jetzt ein Wie m chten Sie vorgehen Software automatisch installieren empfohlen Software von einer Liste oder bestimmten Quelle installieren fur fortgeschrittene Benutzer Klicken Sie auf weiter um den Yorgang fortzusetzen lt Zur ck Abbrechen Assistent f r das Suchen neuer Hardware Wahlen Sie die Such und Installationsoptionen ey Diese Quellen nach dem zutreffendsten Treiber durchsuchen Verwenden Sie die Kontrollk stchen um die Standardsuche zu erweitern oder einzuschr nken Lokale Pfade und Wechselmedien sind in der Standardsuche mit einbegriffen Der zutreffendste Treiber wird installiert I Wechselmedien durchsuchen Diskette CD IV Folgende Quelle ebenfalls durchsuchen C Programme US Bprog driven Durchsuchen
23. e It does matter on which USB port a device is connected for a driver So if you connect the device to a different USB port the driver installation process has to be repeated However since Windows knows the driver from the last time everything goes automatically which doesn t Windows prevent from displaying lots of dialogues You need a device driver for each device SUSB Vendor ID 0x03eb USB Device ID 0x03eb One exception are HID drivers which can be accessed from a userspace application 20 3 Getting Started with the Software While the first fact is only a bit annoying the second fact matters when using the USBprog Since the device can change its identity at runtime after the identity changes a new device driver has to be installed And it s not possible to access the USBprog device while it emulates another device like the Atmel AVR ISP mkII However In normal operation that s not a problem I just wanted to explain that fact so that you understand why the manual switch to the update mode is necessary 3 2 2 Switching to the Update Mode Whenever the firmware not the bootloader of the USBprog needs to be updated the device must be switched from normal operation mode to update mode There are two ways of putting the USBprog in update mode 1 Sending some magic stuff to the device that puts the USBprog in update mode at normal oper ation runtime 2 Disconnecting the device setting jumper JP3 see s
24. e environment variables overwrite the Internet Explorer set tings If you are in doubt set the environment since that s better documented and supported directly by libcurl 4 3 Graphical User Interface The installation instructions in section 3 1 on page 10 explain also how to start the USBprog GUL After the program has started a window like figure 4 1 on the following page should appear Of course the GUI looks different on the different operating system but since the program is built from the same sources using the cross platform toolkit wxWidgets the differences should be small 4 3 1 Getting Information for a Firmware Some very common firmwares are described in chapter 5 on page 33 in that documentation However for any firmware available you can display some brief information Just select the firmware in the combo box and choose Firmware Info or press F2 A dialog like figure 4 2 on the following page appears If you want to get the pin assignment choose Firmware Pins or press F3 A dialog like figure 4 2 on the next page appears 4 3 2 Cache Management Functions If you want to have all firmware files available for offline usage just choose Cache Download all For cleanup there are two different entries The Clean function only deletes unused firmware files that are still in the cache but are use less Files that are not referenced in the index file versions xm
25. e me prefer CLIs over GUIs Because the GUI and the command line use the same library they should share all bugs and features They also share the cache The USBprog command line client works like a shell Each command takes a fixed number of argu ments If the argument is not specified the shell asks for it usbprog helpcmd command gt _ 1Command Line Interface 26 4 USBprog Software Reference Also some commands can be accessed via multiple names usbprog helpcmd bla Invalid command bla usbprog bla Invalid command bla The best If compiled with readline support which is the case for all binary packages listed in sec tion 3 1 1 on page 10 TAB completion works like you would expect it 4 4 2 Getting Help Because a CLI cannot be self explanatory there are several ways to get a quick help beside from that document The command usbprog help displays a list of all available commands To get more help for a specific command use helpcmd COMMAND or COMMAND For example usbprog pin Name pin Aliases pins Argument firmware Description Prints a list about pin usage This might help you when connecting something to your USBprog Last but not least the manual page usbprog 1 briefly lists all commands and invocation parameters 4 4 3 Exiting Well it s quite obvious but since the documentation should be complete there are three ways to exit the shell 1 The co
26. eader files usually in a subpackage dev or devel are installed too e a working C compiler like g Perl htip www perl org to build the manual pages from the POD sources libusb http www libusb org libxml http www xmlsoft org libcurl http curl haxx se GNU Readline http tiswww case edu php chet readline rltop html only if you want to use command line completion with TAB wxWidgets http www wxwidgets org only if you want to build a graphical user interface Download Build and Install After everything is fine download the source tarball from following source im http developer berlios de project showfiles php group_id 7642 You should have a file called usbprog VERSION tar bz2 on the disk where VERSION represents the version of the program At first extract that tarball and change into the newly created directory afterwards tar xvfj usbprog VERSION tar bz2 cd usbprog VERSION Now configure the software using configure Lots of text messages appear If the last lines look like Readline enabled GUI wxWidgets enabled Son Debian Ubuntu Son RPM based distributions like Red Hat or SUSE 18 3 Getting Started with the Software everything is fine Of course disabled is also okay but then the specific feature is missing Build and install the software with make sudo make install or su c make install sudo ldconfig or su c ldc
27. ection 2 1 2 on page 5 and connecting the device again While the first variant seems to be easier especially when developing a new firmware where you have to re flash the USBprog every few minutes it clearly has its disadvantages It doesn t work on Windows for the reasons already explained and it sometimes doesn t seem to work reliably at all Therefore As ordinary user we always recommend to use the jumper to switch to update mode After programming the USBprog automatically switches from update mode to normal mode So don t forget to remove the jumper to prevent the USBprog from starting in update mode at next time you connect the USBprog again or the computer boots To detect if the firmware is in update mode you may already have noticed it the red LED flashes in a sequence flash flash pause flash flash 3 3 Upload the First Firmware We describe the command line interface here as first step for a simple reason It s exactly the same on every platforms and a command can be reproduced by the user more easily than finding GUI elements So open a shell on Unix Linux MacOS or open the USBprog Commandline in the Start menu on Windows You should see a prompt that looks like usbprog _ 10 yes even on Windows 21 3 Getting Started with the Software Now connect the USBprog device with the JP3 update mode jumper set After you connected the USBprog to the USB port of your
28. l any more This can be old versions of firmwares still in the index file or removed firmwares The Delete cache function removes all firmware files from the cache 4 3 3 Uploading a Firmware Uploading a firmware from the online pool is easy 1 Connect the device in update mode see section 3 2 2 on page 21 2 Select a device in the Device list Maybe you need to click on Refresh first 3 Select a firmware in the Firmware list 24 4 USBprog Software Reference M USBprog x Program Firmware Cache Help Device O USBprog in update mode Refresh Bus 006 Device 002 a Online Pool LEDBLINK v Refresh Upload Read more http www embedded projects net usbprog GNU GPL O Local disk Browse 4 7c a a a Y a Figure 4 1 Screenshot of USBprog on Linux Firmware Information x Name AYRISP mk2 Clone URL http www ixbat de usbprog File name avrispmk2 bin Author Benedikt Sauter Version 2 2007 08 01 Device ID s Vendor Ox03eb Product Ox2 104 BCDDevice 0x0200 Description Ser of the original AYRISP mk2 It can be used with all oftwares which are supported AYRISP fnk2 such as AVR Studio avrdude etc Close Figure 4 2 Information about the avrispmk2 firmware Pin Assignment Information x P1 MOSI P2 CC P3 P4 P5 RST P6 PZ SCK P8 P9 MISO P10 GND LED Active JP TX RX 900
29. le The pin assignment is the standardised ISP interface which is described in section 5 2 2 on page 33 Flashing the Firmware Now it s time to flash the firmware with AVRdude At first you have to find out how your programmer is named in AVRdude which is listed in 1 where the c option is described This symbolic name is spelled as PROGRAMMER in the commands below At first you have to download the firmware file at https usbprog googlecode com svn trunk usbprog_ base firmware usbprog_base hex Save the file as usbprog_base hex Now flash the firmware with the command 6 avrdude p m32 c PROGRAMMER U flash w usbprog_base hex The second step requires to set the fuse bits with following interactive AVRdude session avrdude p m32 c PROGRAMMER t avrdude gt write lfuse 0 0xe0 avrdude gt write hfuse 0 0xd8 avrdude gt quit 2 Getting Started with the Hardware After everything was successful disconnect the USBprog remove the jumper JP1 and connect the USBprog again The red LED blinks now This is a sign that you re ready to upload a firmware which is described in section 3 3 on page 21 just the next section 3 Getting Started with the Software 3 1 Installation 3 1 1 Binary Packages for Linux This section describes the installation of binary packages on wide spread Linux distributions If you have a more exotic Linux distribution another Unix flavour or if you just want to use the latest and greatest version pr
30. mmand exit 2 The alias quit 3 Sending a end of line EOL with Ctrl D on Unix and Ctrl Z on Windows 27 4 USBprog Software Reference 4 4 4 Getting Information for a Firmware To view a list of firmware files in the pool see section 4 1 1 on page 23 for an explanation of the firmware pool use the command List like here usbprog list JTAGICE2 JTAGICE2 XSVF Player XSVF Player at89prog at89prog avrispmk2 x AVRISP mk2 Clone blinkdemo LEDBLINK openocd x OpenOCD Debugger simpleport SimplePort usbprogrs232 x usbprogRS232 x Firmware file downloaded The star shows if the firmware is already downloaded for offline usage To display information about a specific firmware use info FIRMWARE and pins FIRMWARE usbprog info blinkdemo Identifier blinkdemo Name LEDBLINK URL http www ixbat de usbprog File name blinkdemo bin Author Benedikt Sauter Version 1 2007 08 13 Device ID s Vendor 0x1781 Product 0x0c62 BCDDevice 0x0001 Description A simple LED blink demo For information about the Pin assignment use the pin blinkdemo command usbprog pins blinkdemo 9753 1 19 8 6 4 2 P1 P2 P3 P4 P5 P6 P7 P8 P9 P10 LED Blink LED 28 4 USBprog Software Reference 4 4 5 Uploading a Firmware Before you can upload a firmware you must select a device first and contrary
31. next page appears To upload the same blink hex file as with AVRDUDE click on the in the Flash group right of Input HEX file select that file and click on Program and Verify 36 5 Common Firmwares Select AYR Programmer x Port Cancel Baud rate fi 15200 y Baud rate changes are active immediately Tip To auto connect to the programmer used last time press the Programmer button on the toolbar Note that a tool cannot be used for programming as long as it is connected in a debugging session In that case select Stop Debugging first Disconnected Mode Figure 5 2 Device selection dialog of AVR Studio AYRISP mkII in ISP mode with ATmega8 ci xl Main Program Fuses LockBits Advanced Hw Settings Hw Info Auto r Device IV Erase device before flash programming IV Verify device after programming r Flash Use Current Simulator Emulator FLASH Memory Input HEX File C Dokumente und Einstellungen bwalle Desktop blink h Program Verify Read r EEPROM A EE Use Current Simulator Emulator EEPROM Memory Input HEX File P Program Verify Read r ELF Production File Format Input ELF File C Dokumente und Einstellungen bwalle Eigene Dateien Save From 4 FLASH Y EEPROM IV FUSES IV LOCKBITS Fuses and lockbits settings must be specified before Program Save saving to ELF
32. nstaller package at following site im http developer berlios de project showfiles php group_id 7642 There s only one installer package for both 32 and 64 bit Windows While the userspace program is always 32 bit the driver is available as 32 bit and 64 bit version Windows like Linux can handle 32 bit software on x86 64 but drivers have to be 64 bit Installation of the Software Installation of the userspace software that excludes the driver part is as easy as installing any other Windows program Just start the installer with a double click confirm the license confirm the install ation path and you re done To start the graphical user interface select Start USBprog USBprog GUI The command line interface has the name USBprog Commandline To uninstall the software just use the Uninstall entry in the start menu or go to Control Panel Software Driver Installation on Windows 2000 and XP After you downloaded the software the driver is located at c Program Files USBprog driver on an English Windows Replace the Program Files with something locale specific like Programme in a German Windows installation To install the driver perform these steps We assume that you successfully installed the bootloader on the device as described in section 2 2 on page 7 1 Insert jumper JP3 see section 2 1 2 on page 5 to put the device into programming mode after power
33. o controller has its own programming hardware that is mostly relatively expensive If you work with multiple microcontroller environments you end up with plenty of programmers on your desk that are not only expensive but also waste space On the other side most self built programming hardware for example several ISP programmers for the Atmel AVR controllers was for the parallel port However modern PCs have no parallel port While you can extend a PC with a parallel port PCI card you re lost on notebooks Building and programming USB hardware is not really difficult but still more work than for the parallel port The most important thing is the firmware Once programmed with a so called bootloader the firmware can be exchanged While it s necessary to have an ISP programming device once to program the USBprog a normal PC or Mac with the USBprog software is sufficient to change the firmware So it takes only a few seconds to make a JTAG device from an Atmel MTK II clone for example Warning This document only describes the USBprog hardware in version 3 0 If you still have an USBprog 2 0 device please refer to the online documentation If you are unsure look at picture 2 1 on page 5 1 2 The USBprog Software As already mentioned in the section above you need a special PC software to exchange the firmware of the USBprog This software is available as both GUI and command line version that can be also used in scripts and Makefiles
34. oceed by reading section 3 1 4 on page 16 In any case After the installation has finished the program can be started using usbprog in a shell for the command line version of the USBprog software and usbprog gui for the graphical user interface if installed In the last case USBprog should also appear in the start menu of your desktop environment at least after logging out and logging in again Ubuntu Debian That s the easiest distribution because Uwe Herrman uwe debian org was so kind to provide Debian packages Because everything that is in Debian is also in Universe you also have that advantage on Ubuntu So Just open a Terminal and install USBprog by entering sudo aptitude install usbprog If you also want to use the graphical interface of the USBprog software use sudo aptitude install usbprog usbprog gui The only disadvantage of installing the GUI is that it probably will install some dependencies like wxGtk If you want to access the USBprog as user that user has to be put in the plugdev group To do so just execute replace USERNAME with the username that you want to put into that group sudo usermod aG plugdev USERNAME At least if you use KDE GNOME or Xfce 10 3 Getting Started with the Software openSUSE and SLES There are binary packages in the openSUSE Build Service directly from the author So they should be always up to date They are in the electronics repository To a
35. onfig You can now start the software with usbprog the CLI variant or usbprog gui the graphical user interface if built and should also find it in the menu of your desktop environment Also a manual page should be available both usbprog 1 and usbprog gui 1 Hardware Access for Normal Users Note This applies only to Linux For other operating systems please refer to the documentation of the system vendor or simply stick to root By default only the root user has raw access to USB devices Since it s not desirable to start USBprog especially the graphical user interface always as root we have to change system config uration in a way that it allows non root users the access to the device Whenever a new device is detected on the system the kernel asks a superspace deamon called udev to create anew device node below dev For USB devices the raw device file that gets accessed by libusb applications like USBprog is below dev bus usb The permission of that device file determines which user has access to that device file A simple solution is now to create a udev rule that gives that device file not root root but root GROUPG with write permission for that group All users that should be allowed to use USBprog can not be put in GROUPE A template for that udev rule is distributed with the USBprog source distribution called usbprog rules The file is generated by the CMake based build system from udev usbprog
36. own protocol like USBasp is that existing programming software can be used The most common programming tools AVRDUDE http www nongnu org avrdude AVR Studio http www atmel com dyn products tools_card asp tool_id 2725 support that hardware device on all operating systems they run on 5 2 2 Pinout The pinout of the AVR ISP mkII and of course also of this clone is the standardised ISP pinout as shown in table 5 1 on the next page http www fischl de usbasp 33 5 Common Firmwares Pin Description Pin Description 1 MOSI data out 2 VCC 5 V 3 4 GND signal ground 5 RESET 6 5 7 SCK clock 8 5 9 MISO instruction in 10 Table 5 1 ISP Pin Assignment 5 2 3 Programming AVRs with AVRDUDE Although this section should be helpful if it s the first time you re using AVRDUDE together with USBprog this document cannot replace the documentation of AVRDUDE 1 Downloading AVRDUDE If you have not already downloaded AVRDUDE you should do now On Windows we suggest the excellent WinAVR software that can be obtained at my http winavr sourceforge net Don t forget to consult its documentation 4 on any problems On any other platform we recommend the installation of AVRDUDE through the packaging system of the operating system or if not available there from sources Windows Driver Installation Like for the USBprog device itself you also have to install a device d
37. river for AVRDUDE When using the avrispmk2 firmware the USBprog emulates a different device and so it needs a different driver The installation of the driver is basically the same as the installation of the driver for the USBprog which is described in section 3 1 2 on page 13 Windows 2000 and XP and section 3 1 2 on page 14 Windows Vista and 7 respectively The only difference is that the location of the driver is c WinAVR YYYYMMTT utils libusb bin with YYYYMMTT to be replaced with the version of AVRDUDE Connecting with the Device If everything is fine and you started the avrispmk2 firmware on your USBprog connect it to a microcontroller circuit using the ISP interface and then you can test the hardware and the installation with 34 5 Common Firmwares avrdude c avrispmkII P usb p m8 avrdude AVR device initialized and ready to accept instructions Reading HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH HHH 100 0 01s avrdude Device signature 0x1e9307 avrdude current erase rewrite cycle count is 68 if being tracked avrdude safemode Fuses OK avrdude done Thank you Don t forget to replace the string m8 with the type of your microcontroller If you don t want to consult the documentation AVRDUDE also gives you a list of valid parts when using a invalid part avrdude p Valid parts are x128a4 ATXMEGA128A4 opt cross etc avrdude conf 14931 x64a4 ATXMEGA64A4 opt cross etc avrdude conf 14
38. s for Atmel AVR microcontrollers we use AVRdude because it supports quite a lot of hardware devices and it s available on basically any platform that is around there On Windows we suggest to use WinAVR which is quite easy to install 2 Getting Started with the Hardware Setting the Jumpers To program the microcontroller that is on the USBprog board you have to connect jumper JP1 as described in section 2 1 2 on page 5 There are two possibilities how the programmer gets its power 1 The programmer has its own power supply That is the case for every USB based programmer since USB can supply the device with up to 500 mA 2 The programmer takes the power from the circuit that should be programmed That is the case for most self made parallel port programmers since the parallel port is not able to supply devices with power If you have a device of the second category you have to set the jumper JP2 as described in section 2 1 2 on page 5 and shown in figure 2 3 on page 6 We suggest the 3rd method with the Schottky diode Wiring After the jumpers are right connect the USBprog with a free USB port of your computer which is necessary to supply the USBprog with power The green power LED LED1 see section 2 1 3 on the preceding page indicates that everything is okay If necessary connect your programmer with power and with your computer For the connection between your programmer and your computer you need a 10 pole ribbon cab
39. ssible location that can load the other firmware part This part is in the ideal world only loaded once into the USBprog flash and then never gets overwritten 1 5 Getting Support If you have problems with the document here there are several places where you can get support 1 There s a web based forum at http forum embedded projects net which is quite well visited Also the guy who has developed USBprog Benedikt Sauter reads that forum regularly 2 Additionally there s also a mailing list at Berlios usbprog pub lists berlios de You can sub scribe unsubscribe or read the archive at https lists berlios de pipermail usbprog pub 3 For general questions about microcontroller programming http www mikrocontroller net is al ways worth looking at There are also plenty of USBprog users out there 4 Especially for problems with the USBprog software you can also send me an email directly at bernhard bwalle de 2 Getting Started with the Hardware 2 1 Connectors Jumpers and LEDs At first we have to introduce the jumpers connectors and LEDs which we talk about in the next sections All figures in that document are meant to be drawn in the same perspective USB connector on the right as figure 2 1 JP1 JP4 LEDI JP3 iat Hui QUID 6 rrereceeter JP2 LED2 Figure 2 1 The USBprog device version 3 0 with all connectors jumpers and LEDs 2 1 1 Connectors CONN1 is the output interface which is
40. used to do something useful with the USBprog beside from blinking LEDs For example if you use the avrispmk2 firmware this is an ISP interface which is used to program microcontrollers CONN2 is obviously the USB connector which is used to connect your USBprog to the computer You have to use a Type B cable which is the normal cable to connect USB devices apart from micro or mini USB 2 1 2 Jumpers JP1 the lower two of the four pins is the jumper that must be connected if the bootloader of the USBprog should be updated See also section 2 2 on page 7 how to flash the bootloader 2 Getting Started with the Hardware JP2 controls how the power supply of the circuit that should be programmed connected to CONN1 Figure 2 2 shows the possible connections The default is no power supply for the programmed circuit In that case you must ensure that the device is supplied with power by other means This is the safest possibility If you connect the two leftmost pins that means that the 5 V VCC is directly from the USB port This setting is dangerous because an error short circuit in your circuit can damage the computer An alternative is the setting of the two rightmost pins In that case the 5 V VCC is not directly from the USB port but with a Schottky diode This is safer than the direct connection JP3 has two functions At first it can be used as 5 V serial interface for debugging You cannot directly connect this jumper to the comp
41. uter but you need some level converter in between This functionality is only needed by firmware developers More important is another function which is used by the bootloader at startup To put the device in update mode disconnect the device then connect pins 2 and 3 as shown in figure 2 3 and connect the device again JP4 is application specific i e used directly by the firmware that is flashed into the USBprog Cur rently JP4 is not used by any of the public firmwares No connection 5 V directly over USB 5V over Schottky diode over USB 000 CIO JP2 JP2 JP2 Figure 2 2 Possible connections of JP2 Default Not used Programming mode a vcc E vcc VCC RxD E RxD M RxD TxD TxD M TxD GND GND GND JP3 JP3 JP3 Figure 2 3 Possible connections of JP3 If you want to build such a level converter yourself look for example at http www nslu2 linux org wiki HowTo AddASerialPort If you want to buy such a cable in Germany the Embedded Project Shop also has one Look for FTDI Kabel TTL 232R USB zu TTL serielles Kabel 5 0 V 2 Getting Started with the Hardware 2 1 3 LEDs LED1 red is used by the firmware There are two common scenarios If the USBprog is in update mode the LED blinks slowly In the wide spread Atmel MTK II clone firmware this LED shines while the programming of the microcontroller is ongoing LED2 green is just the Power LED 2 2 Initialise
42. ware pool is cached on the disk you can also use USBprog without an internet connection later To get the list of available firmware files USBprog will connect to the internet at startup and download the file http www ixbat de usbprog versions xml So if you run some personal firewall software on Windows and that software asks you if it s okay to connect to the internet that s because of that file Right of the label Online Pool there s a combo box with all the firmwares available at the firmware pool Before uploading a firmware to the USBprog device you probably want to get some information for the firmware first 4 1 2 Location of the Cache For the curious here s the location of the firmware cache where also the version xml file is down loaded e Linux MacOS HOME usbprog e Windows APPDATAS just enter that in the Explorer and it shows you the directory in your Windows installation for example c Documents and Settings bwalle Anwendungsdaten 4 2 Configuring a Proxy The USBprog software uses libcurl for internet access Therefore it honours the environment variable http_proxy that simply can be set to the hostname of the proxy Read the manpage curl 1 and the ENVIRONMENT section in specific for more information 23 4 USBprog Software Reference In addition to that settings the Windows version of USBprog also honours the Internet Explorer proxy settings However also on Windows th
Download Pdf Manuals
Related Search
Related Contents
Samsung 230TSn Priručnik za korisnike Installation and user manual EFIT™ 850 sensor GB-DAS TMQ Vol III.iii Guide d'utilisation ............................................. 4 User's guide........ Lightolier CFH2GPF2FT User's Manual HT-3600S (dépliant keeper 2 plis.pub) Copyright © All rights reserved.
Failed to retrieve file