Go Down

Topic: Trinket and ATTiny85 Board Manager (Read 1 time) previous topic - next topic

2112

May 05, 2017, 01:10 pm Last Edit: May 05, 2017, 01:52 pm by 2112
I have been using my IDE 1.6.4 to program Adafruit Trinkets. I installed their board drivers from github using the IDE board manager. Yesterday I successfully programmed an ATTiny85 using my Uno as the ISP and Dave Mellis' board driver from Github. I am excited about this.   

My problem is in installing Dave's drivers it removed my Adafruit drivers from the board list. Fortunately I had WiFi available when I discovered this and I was able to reinstall Adafruits drivers. I do not always have a network available to access github to swap drivers.

At this point all I can do is enter the githib address in the Additional Board Manager URL found in Preferences. How do I get around this? I assume these files still reside on my hard drive. How do I identify them and direct IDE to use them as needed?

Thanks
Dave

DrAzzy

#1
May 05, 2017, 05:08 pm Last Edit: May 05, 2017, 05:16 pm by DrAzzy
I think you're using incorrect terminology

The "driver" is what allows your computer to talk to a device over USB (or something plugged into the slots on the motherboard) - drivers are needed for the trinket (since it acts as a USB device).
Drivers are not needed for an ATTiny that isn't doing VUSB (for example, if you're programming it via ISP) - you still need to have drivers for whatever you're using as an ISP programmer, but not for the tiny itself.

Drivers are totally unrelated to making things appear in the tools -> board menu; that's done by the "board package" or "core" (technically, core refers to one component of a board package: the core arduino libraries that implement stuff like digitalWrite() and the like - but people commonly refer to a board package as a "core").

Installing the damellis attiny board package (or my attiny board package - which is better, if I do say so myself) should not impact drivers in any way shape or form. It also should not interfere with other board packages - but it's at least plausible that it somehow wound up doing so.

You're using version 1.6.4, which was the first one with board manager, and it didn't work very well back then. Most of the 1.6.x versions are unusable; 1.6.5-r5, 1.6.9 and 1.6.12 are the only good 1.6.x versions. The 1.8.x versions have been good though! I suggest you upgrade and see if the problem persists. You also get link time optimization with most recent versions, which makes sketches take up 10-20% less space in flash.

(Also, I recommend never ever upgrading or changing the official AVR board package via board manager)
ATTinyCore for x4/x5/x61/x7/x8/x41/1634/828/x313 megaTinyCore for the megaavr ATtinies - Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts, mosfets, awesome prototyping board in my store http://tindie.com/stores/DrAzzy

2112

#2
May 05, 2017, 09:31 pm Last Edit: May 05, 2017, 11:10 pm by 2112
Thanks for the clarification DrAzzy
When I started with the Trinket I was using 1.8.x but I had issues. It wasn't working but I do not recall details. I should have written it down. THis was early in my quest and I wasn't taking notes as I am now. It was suggested that I uninstall 1.8.x and install 1.6.4 to see if that corrected the issue, which it did. I have been using 1.6.4 from then. Everything was working great with Trinkets and Uno's so I saw no reason to upgrade my IDE.

What's happening is; I had my trinket boards available in Tools > Boards. I then added the damellis attiny board package. At that point the attiny options were available in boards but all the adafruit board options were removed. I went through the steps to burn an attiny. I am so thrilled that this worked as described. This opens up another door to embedded programming for me.

From there I returned to adafruit and reinstalled their board package. At that point the attiny options were no longer available. Again, I'm looking for a way to have both available without visiting github each time I want to switch from one to the other.

I guess my next move is to install your cores to see if this solves my problem. If not I'll install 1.6.9 to see how that goes. 

2112

"(Also, I recommend never ever upgrading or changing the official AVR board package via board manager)"

Can you explain this?

Thanks

DrAzzy

#4
May 05, 2017, 11:10 pm Last Edit: May 05, 2017, 11:12 pm by DrAzzy
Try 1.6.12, or failing that, 1.6.9 or 1.6.5-r5 (that would be my order of preference - 1.6.12 gets you lto, which you really want, but the other two were also among the "good" releases in the 1.6.x versions. 1.6.4 has severe bugs in board manager, which I strongly suspect are causing your problems)

The official AVR board package has compatibility problems (certain ones don't work with certain versions of the IDE - this isn't documented officially anywhere last I checked), and then the files that your IDE is actually using are buried in the Arduino15 folder, and it doesn't use the ones in (install location)/hardware. By always using the version of the board package that came with the IDE, you can be sure it will work with your version of the IDE, and the core files are easily accessible for examination. Many of the bugs they've fixed in new versions are related to the IDE, not the board package too - so you don't really stay current by updating just the board package.
ATTinyCore for x4/x5/x61/x7/x8/x41/1634/828/x313 megaTinyCore for the megaavr ATtinies - Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts, mosfets, awesome prototyping board in my store http://tindie.com/stores/DrAzzy

2112

I get it. Can I have a duh?
I didn't realize I can add additional cores by adding additional rows in the Additional Boards Manager URL. I updated from 1.6.4 to 1.6.9. If this option was available on 1.6.4 I didn't realize it. I added Adafruit and your attiny cores to my list and now they are all there. Unfortunately I can't test any of this until Monday because all my trinkets and ATTinys are at work

Thank You DrAzzy :)

2112

An off-topic question if I may:
Do you recommend using This approach to use the Arduino as ISP to program a atmega328p without bootloader? I'm trying to get away from the bootloader when possible.

Thank you so much

DrAzzy

No, use MiniCore - https://github.com/MCUdude/MiniCore

And the hardware setup is bogus too; it omits the necessary 0.1uf decoupling capacitors between Vcc and Gnd, and between AVcc and Gnd. These are not optional - though without them it often appears to work, or starts to program and then barfs halfway through, or seems to work, but then resets or hangs unpredictably while in operation. The decoupling caps need to be right next to the chip.

I had to trash some custom PCBs for attiny85 because I put the decoupling cap too far away. I could program one page of flash, then it tried to commit the flash and reset; soldering a 0.1uf cap across the top of the chip of course fixed it in a jiffy. Aaand the other 9 copies I got of the board went into the scrap-pcb bin, and another order was placed with the board house. That's why I'm so aggressive about this issue.

Also their setup doesn't have a crystal - but you may want one, even if running at 8mhz in order to get reliable timing (for example for serial).

IMO - the bootloader is often super convenient for development, but it also has a place in deployments where you need to be able to update the firmware on your device without physical access to it. I normally use the bootloader on devices with hardware serial, but not on ones without real hardware serial.
ATTinyCore for x4/x5/x61/x7/x8/x41/1634/828/x313 megaTinyCore for the megaavr ATtinies - Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts, mosfets, awesome prototyping board in my store http://tindie.com/stores/DrAzzy

2112

#8
May 06, 2017, 02:03 pm Last Edit: May 06, 2017, 02:11 pm by 2112
Thanks DrAzzy
Are there compatible One Time Programmable versions of ATtiny? My current project doesn't require ISP once I flash it and put it in service. I also need to avoid the power up delay.

Go Up