Home

USBula – Serial to USB-Flash-Drive Bridge Firmware User Manual

image

Contents

1. Open Open Open Auto Baudrate 2 3 Communication protocol The USBula acts as a slave device and sends only data in response to a request from the host The protocol is half duplex After transmitting a request the host must wait for the response The commands are transmitted as ASCII sequences Payload data for read write file can also be binary and do not have to be in ASCII format V1 2 O Thomas Fischl USBula com 7 12 USBula Serial to USB Flash Drive Bridge Firmware User Manual Every command ends with a line break character USBula sends LF n When receiving it also interprets the CR r as end of line The maximum line length including command and paramter characters is 128 bytes The payload data for read and write command is limited to 100 bytes All numeric values are transmitted in hexadecimal as ASCII sequence Example decimal 158 gt hexadecimal 9E Simultanously two files can be opened maximum files opened 2 To specify which file is currently addressed an identifier called file handler is used 2 4 Command description This section describes the available serial commands Characters sent from Host to USBula are printed in red The opposite direction is marked with green Line feeds are represented by 2 4 1 V Get Version String Get USBula firmware version string Syntax Parameters Example Vel x x x Version string VJ Via el Viel 2 4
2. R Baud 9600 x Data 8 7 Stop 1 Parity None 7 CTS Flow control Rx 489 Reset Tx 411 Reset Count o 0 Reset Newline at LF peinado Clear received Ascii C Hex C Dec Bin Saveoutput C Clear at o fF i erronea i 2 Autoscroll Show errors Received Data 1 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100 105 gt 00n gt 00n gt 00n 0Cy gt 00n gt 00 gt 00n Hello 05y gt 00n worl 05y gt 00n du FFFX02w gt 00n FFFFF 00y gt 00y Input contro Input options Clear transmitted Ascii Hex Dec Bin Send on enter LF z Send file DTR RTS Selection Type asc v ASend Transmitted data E pl 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100 105 110 Un OOw test txtw Wwo0Cy Hello worldy COn OOr test txtw ROOSFFy ROO5SFFy ROOSFFy ROOSFFy COn History 10 10 Connect to dev ttyUSBO b 9600 d 8 s 1 p None 3 Licensing USBula is free for evaluation and personal use For commercial purpose a license must be aquired Please contact license usbula com V1 2 O Thomas Fischl USBula com 10 12 USBula Serial to USB Flash Drive Bridge Firmware User Manual 3 1 License options and pricing There are four different license options which depends on the purpose of use and if source code is required License Price ex
3. USBula Serial to USB Flash Drive Bridge Firmware User Manual USBula is a ready to use firmware for accessing USB flash drives from your application over a simple serial protocol It runs on a Microchip PIC24FJ64GB002 microcontroller available in four different packages SMD and THT For commercial applications there is a one time license fee model which limits the production costs to the actual part costs The PIC24FJ64GBO002 is available from many distributors some with the option for pre programming the controllers Features e Connects USB memory stick to your application without USB programming Ready to flash binary files HEX format supported by most programmers e Runs on well available PIC24 microcontroller on stock part from many distributors e Free version for evaluation and personal use e Source code available via license option modify it for your needs e 5V tolerant serial interface with simple protocol for file access e FAT16 FAT32 is supported 8 3 character filenames are used Typical Application Your Application UART USB Microcontroller PIC24 USB flash drive flashed with USBula Examples Data logging load store configurations firmware updates Code example Serial print Un sync baudrate detection while Serial read An consume response Serial print O1A test txt n open f
4. running in UART mode with auto baud detection Pin numbers for SOIC SPDIP SSOP packages are shown D D gt gt F F K3 30 30 O iei 4 ICSP 10k 4 2 G 59 MCLR RAO RP5 2 ND O R3 ia RA1 RP6 Hz 65 VDD1 rag E 28 nb c8 Lor vpo 4 ail RBO RPO PGED1 vsst RB1 RP1 PGEC1 100n 100n 27 6 E O i HG VSS2 RB2 RP2 7 Optional for in circuit programming RBSIRPS E mane RB4 RP4 GND 10 ras osco RB5 14 3 Razioscl RB7IRP7 E RB8 RP8 E TX RB9 RP9 ax To host controller Q1 E RB10 RP10 D oo jH a RB11 RP11 D 23 vuse 12MH2 RB13 RP13 24 20 25 5V VCAP VDDCORE RB14 RP14 25 C4 c5 c9 1306 Se RB15 RP15 26 22p 22p 100n T 4 7u VBUS R2 9 19 DisvREG AROMA GND GND GND GND LT GND Dtm PIC24FJXXGB002 D Q VBUS YN GND D ale aa ZE Ooo V1 2 Thomas Fischl USBula com 4 12 USBula Serial to USB Flash Drive Bridge Firmware User Manual 1 1 4 Supply voltages 3 3V and 5V The USB part needs 5V Current on the 5V line depends on the used USB flash drive 100 mA The maximum current should be limited e g with a PTC fuse to protect the circuit against short circuits on the USB connector The microcontroller must be supplied with 3 3V needs 25 mA If the target design doesn t provide this vol
5. TISIIE 5 EE AE seuiaveatb tise TEE E 10 3 1 Lic enseoptions and PMC ie rt 11 3 2 License terms id o 11 V1 2 2014 Thomas Fischl USBula com 2 12 USBula Serial to USB Flash Drive Bridge Firmware User Manual 1 Integration Guide This section describes how to integrate USBula into a customer application design 1 1 Hardware USBula runs on a Microchip PIC24FJ64GB002 microcontroller The following guide is intended to help the developer integrating this controller into the customers application This information is only a prosposal whitout any guarantee on correctness Please consult the PIC24FJ64GB002 family datasheet for obligatory details This datasheet also includes Guidelines for getting started with 16 bit microcontrollers Section 2 0 with useful information about required external components PIC24FJ64GB002 product page with link to the datasheet http www microchip com wwwproducts Devices aspx product PIC24FJ64GB002 1 1 1 Chip packages The PIC24FJ64GBO002 is available in different chip packages The package which fits to the rest of the customers design can be used 28 lead QFN 28 lead SOIC 0 3 28 lead SPDIP 28 lead SSOP These are the part numbers of the available package types Package Type Shipped in Tubes Shipped as Tape Reel QFN PIC24FJ64GB002 I ML PIC24FJ64GB002T I ML SOIC 200 mil PIC24FJ64GB002 1 SO PIC24FJ64GB002T I SO SPDIP PIC24FJ64GB002 I SP SSOP PIC24FJ64GB002 1 SS PIC24
6. 2 O Open file Open file with given name The given file handler is used to access this file with following commands Syntax Parameters Example Ofm filename f file handler Open file handler 1 test txt 500 m Mode r read only w Olw test txt write a append gt 00 filename 8 3 character name with prefixed path 2 4 3 C Close file Close file with given file handler Pending data buffered in RAM are flushed to the USB memory stick Syntax Parameters Example Cr f file handler Close file handler 1 gt 004 Cial gt 004 2 4 4 R Read Read from given file handler the given count of bytes If the end of file is riched the remaining V1 2 Thomas Fischl USBula com 8 12 USBula Serial to USB Flash Drive Bridge Firmware User Manual bytes are send as filler Syntax Parameters Example Rfssyy l f file handler Read 5 bytes from file handler s d ss bytes to read 1 filler OxFF ss bytes read from file If end YY filler RIOSFEJ of file riched bytes are filled T count of read bytes max gt 00J with filler 100 Hello rra 054 2 4 5 W Write Write to given file handler Syntax Parameters Example Wtssa f file handler Write Hello world 12 gt 00 ss bytes to read chars to file handler 1 ss bytes write to file ww count of bytes written W10CJ ww max 100 gt O Hello
7. FJ64GB002T 1 SS 1 1 2 Pinout Description The following table lists the pins which are used by USBula It describes which function is mapped to pin numbers of available package types SOIC QFN Function Description SPDIP SSOP 13 28 10 25 VDD 3V3 Power supply 20 17 VCAP Voltage regulator output Connect capacitor to this pin 23 20 VUSB USB voltage 3V3 V1 2 O Thomas Fischl USBula com 3 12 USBula Serial to USB Flash Drive Bridge Firmware User Manual 15 12 VBUS USB voltage 5V 8 27 5 24 VSS Ground supply 19 16 DISVREG Disable voltage regulator Connect to GND 9 6 OSCI Oscillator 12 MHz crystal 10 OSCO 26 MCLR Reset input 4 1 PGED1 Programming data optional for in circuit programming 2 PGEC1 Programming clock optional for in circuit programming 18 15 RP9 RX UART receive signal 11 8 RP4 TX UART transmit signal 2 27 RAO MODEO Internally pulled up to VDD 3 28 RA1 MODE1 See section Mode Selection For UART Mode leave pins open not connected 12 9 RA4 MODE2 24 21 RB13 CFG0 Internally pulled up to VDD 25 22 RB14 CFG1 See section UART configuration For Autobaud leave pins open not connected 26 23 RB15 CFG2 1 1 3 Schematics example The PIC24 needs only a few external components to act as bridge between a simple serial interface and USB This diagram shows a mimalistic circuit
8. cates over the serial interface with USBula This section describes how to V1 2 Thomas Fischl USBula com 6 12 USBula Serial to USB Flash Drive Bridge Firmware User Manual configure the interface and the serial protocol for accessing files on the USB flash drive 2 1 Interface mode selection The communication mode must be selected via the MODEO 2 pins The inputs are pulled internally to VDD So the pins must left open if high levels are expected MODE2 MODE1 MODE0 Mode Open Open Open UART Mode All other options Reserved for future use Currently only the UART mode is supported by USBula 2 2 UART communication The UART is set up with these parameters 8 data bits no parity 1 stop bit Rx Tx are used for communication with the host There are no hardware handshake signals Wiring with the host system Host UART Tx gt USBula UART Rx USBula UART Tx Host UART Rx The baudrate can be selected with pins CFGO 2 The inputs are pulled internally to VDD If high levels are expected the pins must be left open If auto baudrate is selected the baudrate is determined automatically while sending the first command after reset This first command must be the sync command U CFG2 CFG1 CFG0 Baudrate Baud GND GND GND 1200 GND GND Open 2400 GND Open GND 9600 GND Open Open 19200 Open GND GND 38400 Open GND Open 57600 Open Open GND 115200
9. cl VAT Units Source code Purpose USBula FREE No charge unlimited Not included Evaluation personal use USBula LE 99 up to 250 Not included Commercial USBula LP 199 unlimited Not included Commercial USBula LPS 399 unlimited Included Commercial It is recommended to start with USBula FREE to evaluate its function and test it with the intended system components USBula FREE has only one difference to the other license options it automatically generates a file usbula txt with license information on every USB flash drive which is plugged in With USBula LPS you get the source codes MPLAB X project and an additional documentation which describes the firmware concept the development environment and the steps to compile the firmware project License upgrades are not possible Please order a new license if the granted number of units are not enough 3 2 License terms Software license agreement for USBula the Serial to USB Flash Drive Bridge Firmware General and Definitons USBula com Thomas Fischl Schmidsberg 3 94130 Obernzell Germany is willing to license the accompanying Software USBula the Serial to USB Flash Drive Bridge Firmware to you Licensee only if you accept all the terms in this license agreement If you do not agree to these terms do not download acquire or use the Software Software License Grant USBula com grants the Licensee a non exclusive license to
10. erial to USB Flash Drive Bridge Firmware User Manual MPLAB IPE is bundled with the MPLAB X IDE which can be downloaded for free http www microchip com pagehandler en us family mplabx The IPE tool is automatically installed with the MPLAB IDE It is available for Windows Linux and MacOS X File View Settings Help Select Device and Tool Results Family All Families va Checksum C2DB Device PIC24FJ64GB002 Apply A ie Fail Count 3 Tool hd Total Count 6 Source Browse SQTP tLess Output 2014 07 08T13 35 35 0200 Completed loading IPE Steps for programming with IPE tool Select Device PIC24FJ64GB002 Connect PicKit3 select it as Tool Open USBula HEX file as Source Browse Conenct Target with PicKit3 Press button Program O oe N 1 2 2 Order pre programmed chips The method described in the last section is applicable for prototypes and small production lots For mass production it can be more economically to use a programming service which ships the microcontroller already flashed packed in tubes or tape reels A few distributors provide such a service even Microchip via microchipDIRECT http www microchipdirect com programming However it is recommended to integrate the ICSP connector pads to the application circuit for prototyping and debugging 2 Serial interface The host system communi
11. ile id 1 append mode while Serial read An consume response Serial print W10b n prepare write of 11 bytes while Serial read An consume response Serial print Hello World write data to file while Serial read An consume response Serial print C1 n close file while Serial read An consume response V1 2 2014 Thomas Fischl USBula com USBula Serial to USB Flash Drive Bridge Firmware User Manual Table of Contents T Integration CUE As 3 A A A yh ant oleae E e a EE O EEA 3 A a AA O A A a aa a a 3 1 1 2 PIQUE DeServiilousistssacovsseesccsantsusdehacsnsatsssavveciarseeanysdeiadsniasvsadscdacevsnatagtorpuisuadinanssetpsauaatenasnias 3 an AA A A A weeds 4 1 1 4 Supply voltages 3 3V and PV a 5 1 2 Load UsBula HE Pl IN Ata aaa aia 5 1 21 PICKS and MPEA B IPES ds IA e on AAA AA 5 1 2 2 Order pre programmed CP ios 6 E O A O aine sep aun SS 6 2 1 Interface mode selec aa 7 2 2 UART COMMUNICATION isaac ds AA LAOS ARRE aadar VENA ERR NEA 7 223 Communication prota dci 7 24 Command descriptions a a ai acia 8 24L NV A o EEE agate AEE EE E E a eeeuise aan etn 8 PARA O o o ence Ren SaaS 8 E E A A NA 8 PE A A va Seve ease TEE E EAE E E nouaind 8 2A WO INTO A IA AAA NAAA es 9 246 WSS VACHPONIZE AI O io 9 2 S Response ad o o as al dedos de el 9 26 EXAM lest aer ance ceasease cet svtse tease ee eE Eaa Glseiaeiear ein daara ase S PEERS E easy 10 DCO
12. t warranty of any kind either express or implied including without limitation any implied warranties of condition uninterrupted use merchantability fitness for a particular purpose or non infringement In no event shall USBula com be liable for any direct or indirect damages arising in any way out of the use of this Software Termination of License Agreement This agreement terminates immediately upon violation of any of the terms of this license areement In this case the Licensee will immediately stop using the Software Miscellaneous The Licensee is not permitted to publish or distribute the Software particularly the HEX and source files It is not allowed to sub license the Software to a third party This agreement is governed by the laws of the Federal Republic of Germany The place of jurisdiction shall be Passau Germany Should any of this license agreement be held to be invalid by any court of competent jurisdiction that provision will be enforced to the maxium extend permissible and the remainder of the license agreement shall nonetheless remain in full force and effect V1 2 Thomas Fischl USBula com 12 12
13. tage yet a voltage regulator can be used There are out many voltage regulators for this purpose e g the MCP1700 with maximum output current of 250 mA Po 103 VIN VOUT a 03 C2 3 4 7u 100n MCP1700 100n l pm O ND GND O zZ iw o Z iw 2 1 2 Load USBula HEX File The USBula firmware is provided in a compiled ready to use binary HEX format This format is very common for flashing software into microcontrollers It is supported by most programmers and can be handled by most electronic manufacturing services 1 2 1 PicKit3 and MPLAB IPE A cost effective solution is a Microchip PicKit3 debugger programmer Part Number PG164130 in combination with the free tool MPLAB IPE PicKit3 is a in circuit debugger programmer with a 2 54mm 6 pin connector The interface is called ICSP An 6 pole pin header can be placed on the target circuit so the programmer can be plugged directly on it These connections are required for programming PicKit3 Header PIC24FJ pins SOIC SPDIP SSOP QFN Function 1 VPP MCLR 1 26 VPP MCLR 2 VDD 3V3 3 I VSS GND 4 PGD 4 1 PGED1 5 PGC 5 2 PGEC1 6 LVP Do not connect Further details are described in the Flash Programming Specification downloadable from the PIC24FJ64GB002 product page http www microchip com wwwproducts Devices aspx product PIC24FJ64GB002 V1 2 Thomas Fischl USBula com 5 12 USBula S
14. use the Software according to the terms and conditions defined below With downloading or acquiring the Licensee chooses one of the following options USBula FREE the Software is for evaluation purpose and personal use only The use in commercial products is not allowed USBula LE the Software can be installed in up to 250 units of one specific product USBula LP the Software can be installed in unlimited units of one specific product USBula LPS the Software can be installed in unlimited units of one specific product Additionally the source code of the Software is made available for the Licensee The Licensee can modify and use the source codes for his needs USBula LE LP LPS can be used in any product where the Software does not represent the main V1 2 O Thomas Fischl USBula com 11 12 USBula Serial to USB Flash Drive Bridge Firmware User Manual function of the device e g these license does not cover breakout boards or Serial to USB Flash Drive converters in this case please ask for a customized license Mentioning that USBula is used in the product is not necessary The Software uses parts of Microchip Libraries for Applications The Licensee accepts the terms of the underlying license aggreement www microchip com mla_license It mainly constricts the use to Microchip products porting to other microcontrollers is not permitted Warranty Disclaimers The Software and documentation is provided as is withou
15. world FOCA 2 4 6 U Synchronize Alive This command is used to syncronize USBula to the used baudrate if configured in auto baudrate mode The command must sent first before other commands If USBula doesn t response the command must be sent again after timeout If a fix baudrate is selected via the CFGO 2 pins this is not necessary The U command can also be used to check if USBula is alive like ping pong Syntax Parameters Example UJ Ual gt 004 gt 004 2 5 Response codes USBula answers to commands with a response code which indicates possible errors Code Description gt 00 Successful Everything okay gt 01 Unknown command gt 02 Syntax error gt 03 Invalid file handler gt 04 Error while opening file V1 2 O Thomas Fischl USBula com 9 12 USBula Serial to USB Flash Drive Bridge Firmware User Manual gt 05 File not open gt 06 Error while reading file gt 07 Invalid size parameter 2 6 Example The following screenshot shows an example communication USBula is connected with a USB to serial interface to an PC running HTerm a terminal programm http www der hammer info terminal The commands are just typed into the input field and sent out with enter Send on enter LF The response is shown in the Received Data window do File Options View Help Disconnect Port dev ttyUSBO y

Download Pdf Manuals

image

Related Search

Related Contents

  こちらをご覧ください[PDF 710KB]  Huawei Ascend W1 Black  DH 25PA, DH 25PB - hitachi  AHPCS10 AHPCL10PRO AHPCL10  QUICK START GUIDE: ARC-2e Menu ARC  Garmin GMR 24 xHD  Manuel d`apprentissage du bijoutier Modell  

Copyright © All rights reserved.
Failed to retrieve file