Digistump Forums

The Digispark => Digispark Projects => Topic started by: digistump on January 05, 2013, 11:18:37 pm

Title: USB connected LCD
Post by: digistump on January 05, 2013, 11:18:37 pm
If you haven't yet check out one of the newest examples of how to use the DigiUSB library:

http://digistump.com/wiki/digispark/tutorials/usb2lcd

Hope you enjoy it!
Title: USB connected LCD
Post by: Trakkasure on January 08, 2013, 07:14:46 pm
When attempting to test this code:

/Users/loggedinuser/Applications/DigiSpark.app/Contents/Resources/Java/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/lib/avr25/crttn85.o:(.init9+0x2): relocation truncated to fit: R_AVR_13_PCREL against symbol `exit\' defined in .fini9 section in /Users/loggedinuser/Applications/DigiSpark.app/Contents/Resources/Java/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/avr25/libgcc.a(_exit.o)

Please advise.
Title: USB connected LCD
Post by: digistump on January 08, 2013, 07:25:28 pm
Do you perhaps not have the board and programmer both set to Digispark (Tiny Core)?

That is the only thing I can think of, unless you made any changes to the code.
Title: USB connected LCD
Post by: Trakkasure on January 08, 2013, 07:30:32 pm
I first loaded the LCD example, (displaying the string \"Digispark!\" on the display)
Changed the text and recompiled. (And uploaded)

All succeeded.

Then loaded the USB2LCD to test this code.

When clicking \"verify\" I received that error. So the error was during compile.
Digispark (Tiny Core) is selected as the board.
Digispark is the programmer (although for just compiling this shouldn\'t matter)
Title: USB connected LCD
Post by: Trakkasure on January 08, 2013, 07:32:44 pm
I should add, I\'m using the latest version of Digispark (from Jan 5th)

Using OSX Mountain Lion (had to make the security changes in system preferences to get it to execute)
Title: USB connected LCD
Post by: Trakkasure on January 08, 2013, 07:38:28 pm
Also, I renamed Arduino.app to DigiSpark.app to keep track of different IDEs for the different boards I have.
Title: USB connected LCD
Post by: Trakkasure on January 08, 2013, 07:42:13 pm
After commenting out all references to DigiUSB in the code (yea, pointless for using the example, but a simple debugging step for me) it compiled fine.
Title: USB connected LCD
Post by: digistump on January 08, 2013, 07:44:25 pm
Ok - got it figured out, it is a bug in the Arduino IDE (or the avr compiler/linker more precisely), I\'m packing orders right now but I\'ll get it fixed and upload a new version tonight

(here is all the technical details: http://avr.2057.n7.nabble.com/Advice-on-R-AVR-13-PCREL-errors-linking-for-Tiny85-and-Mega168-td9327.html)
Title: USB connected LCD
Post by: digistump on January 08, 2013, 07:44:53 pm
commenting out helped because the bug is related to when you get over a certain size compiling for attinys
Title: USB connected LCD
Post by: Trakkasure on January 08, 2013, 07:53:54 pm
Excellent. Thanks.

I\'m systematically testing my shields with different code.

So far, I\'m very happy with the DigiSparks!
Title: USB connected LCD
Post by: digistump on January 08, 2013, 08:15:29 pm
Can you try this version: http://s3.amazonaws.com/digispark/builds/arduino-1.03-osx-digispark-2013-01-08.zip
Title: USB connected LCD
Post by: Trakkasure on January 08, 2013, 08:39:50 pm
Downloading to test now.
Title: USB connected LCD
Post by: Trakkasure on January 08, 2013, 09:21:53 pm
Everything compiles and uploads.

I\'m having trouble locating the python application (is it somewhere in the Java directory?) to send data to the DigiSpark through the USB to have it show on the LCD.
Title: USB connected LCD
Post by: Trakkasure on January 08, 2013, 09:24:14 pm
The ruby version requires ruby >= 1.9.3
I only have 1.8.7 (standard on Mountain Lion)
Title: USB connected LCD
Post by: Trakkasure on January 08, 2013, 09:25:54 pm
Ok. Found the python app.. I was looking in the .app not thinking to look in the ZIP directory.
Title: USB connected LCD
Post by: Trakkasure on January 08, 2013, 09:41:24 pm
After installing PyUSB and wxPython, running the monitor send and read all give me
No DigiUSB Device Found

Could be (on OSX again) that I don\'t have libusb.
I\'ll have to check it out tomorrow.
A thorough step by step on getting a working system would be good for this example. Once I get it working, I could provide that here.
Title: USB connected LCD
Post by: digistump on January 08, 2013, 09:47:17 pm
It very well could be because you don\'t have libusb - try installing that with homebrew or macports - I\'d think just libusb would do the trick, but if not libusb-compat might help. Let me know if that works, I think it will since I have pretty much a clean install of os x 10.7 with only libusb installed out of the ordinary.

If you could write it up that\'d be most appreciated - also if you can think of anyway to make an app or terminal program or something like that that would work for send, read, write, and receive - that would be awesome, I couldn\'t get them to work as an app since they need a terminal and I don\'t know enough about macs to come up with something else yet.

Thanks,
Erik
Title: USB connected LCD
Post by: digistump on January 08, 2013, 09:49:29 pm
Here is a great way to get libusb binaries as well - probably easier - http://www.ellert.se/twain-sane - just grab the appropriate libusb package and install
Title: USB connected LCD
Post by: MichaelMeissner on January 08, 2013, 10:10:03 pm
I posted a reply about a similar issue over in the Arduino forums.  In the Arduino forums, the issue is -Wl,-relax option.  While I work on GCC (and in the past binutils) as my day job, I\'m trying not to dive into it for hobby related projects on the AVR and ARM chips, so somebody else would need to modify the code to use the appropriate attributes for the functions that must be a certain distance from the interrupt vectors, or take -Wl,-relax off and accept the larger programs:
http://arduino.cc/forum/index.php/topic,140108.msg1054357.html#msg1054357
Title: USB connected LCD
Post by: digistump on January 08, 2013, 10:35:31 pm
@MichaelMeissner  you certainly no more of the technical side then I do - but what I did is just update the Arduino IDE with the newest version of the link (\"ld\") executable (from winavr for windows and avr crosspack for os x) and that seems to solve it.
Title: USB connected LCD
Post by: Bluebie on January 08, 2013, 11:55:17 pm
On a Mac the best way to upgrade ruby and install the latest version of libusb, as well as many other useful command line tools is with Mac Homebrew. In a terminal enter each of these lines:

ruby -e \"$(curl -fsSkL raw.github.com/mxcl/homebrew/go)\"
brew install libusb libusb-compat ruby


You\'ll need an administrator account to install homebrew initially. This will download and compile the needed programs. I recommend against using those odd installer applications as they inject the software deep in to the heart of OS X and can potentially cause instability, and usually do not offer any simple means of uninstallation. Homebrew keeps all it\'s stuff in it\'s own directory and just uses shell paths to have things look there first, leaving it very easy to uninstall stuff and leaving system software using the libraries which came with the operating system.
Title: USB connected LCD
Post by: Trakkasure on January 09, 2013, 07:57:46 pm
Wanted to confirm that after installing libusb, this demo works.
Title: USB connected LCD
Post by: Bluebie on January 09, 2013, 08:52:01 pm
Yay ^_^
Title: USB connected LCD
Post by: chipman78 on January 10, 2013, 09:33:07 am
Hey all.  I\'ve been silently following along, but am hitting my own (newbie) roadblock.
I have setup Homebrew and installed libusb.  My DigiSpark has the program running on it.  What else do I need to do on my mac to see output on the LCD?  (I am not very familiar with python)
Title: USB connected LCD
Post by: digistump on January 10, 2013, 10:42:17 am
chipman you should actually be able to just open the monitor app and send data to the Digispark with it, that will appear on the LCD - then you can explore the ruby and python options after that
Title: USB connected LCD
Post by: chipman78 on January 10, 2013, 12:11:27 pm
I haven\'t been able to launch monitor.app.  It immediately crashes.

This is what is showing in my mac\'s Console:
1/10/13 3:18:26.199 PM com.apple.launchd.peruser.501[145]: ([0x0-0x553f53a].org.pythonmac.unspecified.monitor[85673]) Exited with code: 1

I\'ve seen this on a MacPro running 10.8.1 and a MacBook Air running 10.7.x
Title: USB connected LCD
Post by: digistump on January 10, 2013, 12:18:24 pm
try


sudo easy_install pyusb
cd /path to examples/DigiUSB/source
python send.py \"text on LCD\"
Title: USB connected LCD
Post by: chipman78 on January 10, 2013, 12:22:13 pm
YES!!  Thank you!
Loving the product, BTW.  Great work!
Title: USB connected LCD
Post by: digistump on January 10, 2013, 01:55:05 pm
wonderful! - if you do \"sudo easy_install wx\" then you should be able to run \"python monitor.py\" as well
Title: Re: USB connected LCD
Post by: jonwa on February 16, 2013, 03:29:15 pm
I'm confused. Where is this USB2LCD part?
All the other examples where in examples/digispark, but there is no USB2LCD program there.

Title: Re: USB connected LCD
Post by: digistump on February 16, 2013, 07:30:34 pm
Example->DigiUSB->USB2LCD
Title: Re: USB connected LCD
Post by: jonwa on February 17, 2013, 03:51:08 pm
There is no example directory, however under examples, there is a Digispark directory, but there is no USB2LCD under that directory.


I eventually found it under
libraries/DigisparkUSB/examples/DIGIUSB2LCD


Never thought to look for example code under libraries.
Especially as there are already two other "examples" directories.


"Digispark - Example Programs"
and
examples/Digispark