100 likes | 116 Views
Ldino is a versatile program building tool for Atmega328, allowing binary or hexadecimal programming, automatic uploading to Arduino, and program segments placement. It disassembles programs, produces listings, and uses a resource file for programming settings.
E N D
L An Overview
What Is ldino? • Tool to allow you to build programs for the atmega328 in binary or hexadecimal • Default base is binary • Option for using hexadecimal is “-x” • Can automatically upload your program to a connected Arduino and run it • Use “-P” option with “-o” option • Allows you to place program segments at arbitrary locations in memory
Will disassemble your program and produce a listing for it • Use “-L” option to produce a listing
Installing ldino • Runs on Linux or Windows • Has 2 components • Executable • Place it in your $PATH or %PATH% • Resource file “.ldinorc” • Must be placed in your “home” directory • $HOME on linux • %HOMEPATH% on windows • Resource file .ldinorc tells ldino how to program your Arduino board
About .ldinorc • ASCII text file containing two variables • “arduino-home”: location where Arduino IDE is installed • “arduino-port”: port where the Arduino board is attached #.ldinorc for linux arduino-home=/home/agbell/var/arduino-1.0.5 arduino-port=/dev/ttyACM0
Using ldino • Converts ASCII text into Intel .hex format • Intel .hex file is what the atmega328 runs • .hex files are “machine code” • .elf files get converted into .hex files via objcopy • Instead of building your program in C or assembly, you build it in ASCII binary or hex • You pass your ASCII “machine code” to ldino • Can produce an assembly language listing of your machine code • Can automatically load your program to the Arduino and run it
Sample Input File • Comments are allowed • .org directives tell ldino where to place code in ROM • .org operands are always hexadecimal ;this is a comment .org 10 91800024; loads R24 with DDRB (I/O address 0x24) 6280 ; OR R24 with 0x20 93800024; store R24 out to DDRB ; we don’t need to do this anymore ;9508 ; return
Command-Line Options -L: produce a listing file (.lst) of your machine code -P: program an attached Arduino board with a .hex file -V: be verbose -h: print extended help -o: place generated .hex in a specific file -v: print ldino version -x: specifies that input is in hex, not binary
Usage Examples ldino -x myfile.txt Converts ASCII text in myfile.txt into .hex format, then sends the .hex records to stdout. The ASCII text in myfile.txt must be presented in hexadecimal. ldino -P -o myfile.hex myfile.txt Converts ASCII text in myfile.txt into .hex format and sends the .hex records to a file called myfile.hex. If the conversion is successful, ldino will immediately program any connected arduino with the contents of myfile.hex using the parameters specified in .ldinorc
Usage Examples ldino -L myfile.txt Converts ASCII text (binary) in myfile.txt into .hex format, sends the .hex records to stdout, and produces a listing file named myfile.txt.lst that contains the disassembled input. ldino -P myprog.hex Programs an attached arduino with the ROM image contained in myprog.hex.