Author Topic: "Bluebiespark" Digispark Arduino app betas! Many bugs fixed - mac only  (Read 10906 times)

Bluebie

  • Sr. Member
  • ****
  • Posts: 486
Hey guys!


I've gone through the Digispark Arduino software and fixed tons of bugs - I've fixed millis(), micros(), and delay(), so they all work when you're using DigiUSB. I've added a new version of the micronucleus bootloader which runs the digispark at 16.5mhz regardless if you plugged it in to a USB port or an external power supply (original digisparks run at 16.0mhz when externally powered, which messes up your delays and things!). I've added an option to select 16.0, 8.0, or 1.0mhz as clock speed options in the Tools > Boards menu - save power, and use a clock speed which is compatible with more existing arduino libraries! I've hooked up the Burn Bootloader menu item so it uploads the latest and greatest digispark bootloader to your current digispark, upgrading it in place, or if you select a programmer in the programmers menu it will install the digispark bootloader in to a raw attiny85 chip, giving it a USB upload interface and the ability to use the reset pin!


The upload tool now automatically detects "-1" erase failures on Mac OS and recovers the connection, continuing the upload immediately - so much less annoying!


I've also added a new function to the DigiUSB library: DigiUSB.delay(); It works exactly the same as the regular global delay() function, but it keeps refreshing the DigiUSB library while it delays, so your connection to your computer doesn't crash. If you toss a few DigiUSB.delay() in to your program you can completely do without DigiUSB.refresh().


All of these changes are up on github, and will hopefully be merged in to the main Digispark Arduino software in the future, but I'm finding these bugfixes so useful (especially the DigiUSB ones!) that I wanted to share them with you sooner than later.


You can download my upgraded Digispark Arduino app from http://creativepony.com/seadawg/Bluebiespark%20Beta%202.zip for 64bit Intel Mac computers. Let me know what you think, if you find bugs, etc.


To upgrade the bootloader on your digispark for the clock speed fix:


Open Tools menu, make sure programmer is set to Digispark, then choose Burn Bootloader. Now plug in your digispark and wait. After about ten seconds or so a bunch of upload status stuff will come out the bottom - if the upload succeeded, wait another ten seconds or so - now try uploading to your digispark. It should now have the upload speed fix. You can verify the bootloader upgraded by opening "System Information" app from /Applications/Utilities, going to the usb section, plugging in your digispark and typing cmd+r to refresh. Keep refreshing till "Vendor-Specific Device" appears in the list. Click this - if the Version is 1.02, it's the old bootloader the digispark shipped with. If it upgraded the version will now be 1.06.


A word of warning:


I am not affiliated with Digistump and provide no warranty that the bootloader upgrade will not impair the functionality of your digispark. I'm quite confident it wont cause any trouble, but no promises and no legal obligations. Digistump wont replace your digispark if it stops working because of a bootloader upgrade. If you're unsure, ask Digistump for advice.


Edit: Updated with info on beta 2, which fixes more stuff!
« Last Edit: March 03, 2013, 06:09:24 pm by Bluebie »

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
These changes we'll be merged into a big update of the official release this week!


Thanks so much Bluebie!

Bluebie

  • Sr. Member
  • ****
  • Posts: 486
Someone should fix up DigiKeyboard, Joystick, and Mouse to have the same timer fixes and new delay() function before the next release!

Bluebie

  • Sr. Member
  • ****
  • Posts: 486
DigiMouse is done.

Bluebie

  • Sr. Member
  • ****
  • Posts: 486
DigiJoystick is done. Keyboard remains.

Bluebie

  • Sr. Member
  • ****
  • Posts: 486
Keyboard done, some examples updated too. yay!

Bluebie

  • Sr. Member
  • ****
  • Posts: 486
Anyone wanna new beta with all these other libraries fixed and delay() functions all around? Here it is: http://creativepony.com/seadawg/Bluebiespark%20Beta%203.zip

bobricius

  • Newbie
  • *
  • Posts: 49
Great job Bluebie! Please, make upgrade for jumper version of 1.06 on github. thanks

Bluebie

  • Sr. Member
  • ****
  • Posts: 486
I haven't yet figured out the best user interface for choosing which type of bootloader to install and use. Burn Bootloader option in Arduino doesn't seem to let you choose which bootloader you want, and I don't know java so I'm disinclined to try and hack in extra menus and things myself.


Maybe I could make the upgrader in to an arduino sketch as well as offering hex files, so you could just download the .ino file and hit upload? It should be okay, but I worry a little that people might change a line or accidentally type something somewhere and end up bricking their digispark - at least with hex files I know people wont accidentally corrupt them (they have checksums)


I'll try and make a jumper upgrader tonight. Stay tuned!

Bluebie

  • Sr. Member
  • ****
  • Posts: 486
Done this thing - prebuilt jumper version of 1.06 now available on github at https://github.com/Bluebie/micronucleus-t85/tree/master/upgrade/releases


I'll try and keep these released concurrently in the future now it's easier to do both versions of the build.

dougal

  • Sr. Member
  • ****
  • Posts: 289
Re: "Bluebiespark" Digispark Arduino app betas! Many bugs fixed - mac only
« Reply #10 on: March 15, 2013, 08:54:17 am »
I just tried to update the bootloader on a spark, but when I choose "Burn Bootloader", it just immediately tells me "Error while burning boot loader." I have a feeling I'm missing a step somewhere on my end, though...


Bluebie

  • Sr. Member
  • ****
  • Posts: 486
Re: "Bluebiespark" Digispark Arduino app betas! Many bugs fixed - mac only
« Reply #11 on: March 15, 2013, 09:03:47 am »
Do you have a specific reason to update the bootloader? If not, don't do it.


If you really want the clock speed precision fix, make sure the selected board is Digispark (Tiny Core), and the selected Programmer is Digispark. Then choose Burn Bootloader and then plug in the digispark you want to update immediately (don't wait for anything to appear on screen, just do it!). It should then say down the bottom the same sort of text as if you've uploaded a program in the usual way. once it's finished uploading, wait ten seconds before uploading some other sketch to the digispark. If that doesn't work, unplug it, choose to upload your sketch, and plug it in in the usual way, and if that doesn't work I guess the digispark is broken now or something and it's all my fault but that hasn't happened to anyone so far so it's probably okay but no promises!

dougal

  • Sr. Member
  • ****
  • Posts: 289
Re: "Bluebiespark" Digispark Arduino app betas! Many bugs fixed - mac only
« Reply #12 on: March 15, 2013, 09:22:51 am »
No, no particular need, I just wanted to put the timing fixes in "just because". It only gives a split-second between me selecting to burn, and the appearance of the error. I haven't been able to get the spark plugged in in the tiny timeframe. :)


I guess I'll give it a pass for now.


Bluebie

  • Sr. Member
  • ****
  • Posts: 486
Re: "Bluebiespark" Digispark Arduino app betas! Many bugs fixed - mac only
« Reply #13 on: March 15, 2013, 07:50:17 pm »
It should give you ten seconds. What version of OS X are you running and on what model of Mac? Does uploading regular sketches work or does it also error immediately?

bobricius

  • Newbie
  • *
  • Posts: 49
Re: "Bluebiespark" Digispark Arduino app betas! Many bugs fixed - mac only
« Reply #14 on: March 18, 2013, 06:04:16 am »
Bluebie: I test your great bootloader jumer version .... after upload sketch is not started ... I must remove and plug again. Is possible to start sketch after upload withou unpluging? thanks