Trinket and #296

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
flounder
 
Posts: 494
Joined: Wed Sep 18, 2013 9:10 pm

Trinket and #296

Post by flounder »

I designed a project around the Trinket. I have been unable to get my code to load from my Win 8.1 tablet, even after booting with driver signing disabled. So, I thought, since this code loads and runs correctly on an Arduino Uno R3, there is some compatibility mismatch. So I will use the Arduino Breakout Board, Adafruit #296, which has more RAM and a friendlier boot system, and appears to be the "bare bones" version of an R3. I only need two I/O pins, and the display only needs 384 bytes of RAM, and I had hoped the Trinket would have been sufficient. But maybe 384 is just a little too close to 512, hence the fallback to the larger chip. I try to get it to download on that. No luck. I try it from my Win7 massive, bulky, heavy "lap"top. No luck. Also the 32u4 chip used on the breakout board does not appear in the list of boards in the Arduino IDE. More grovelling around, and I find a note that says to compile for the "Arduino Leonardo". I try that, and my test sketch downloads. So I make a couple tweaks to it, and try to download again. I find that it is looking for an "Arduino Leonardo" driver, which does not exist. I unplug and replug the chip in the USB port. It comes back as an Arduino Leonardo. Nothing I do makes this binding go away. So I've got a total screwup of my laptop. And maybe of the #296.

Before I "roll back" my whole new install of 1.5.?-r2 (including the signed drivers) on my laptop, or download the signed drivers to my Win8.1 Pro tablet, I need to know what I should be doing before I have two FUBARed machines, and what I need to do to use the #296 part correctly.

Or, better still, to use the Trinket successfully, because that will save me having to print out a new case with mountings rearranged for the #296 part (including the holes for connectors, mountings for the Trinket and NeoPixel 8x8 display, and various bosses to screw down the cover to, it's a 6-hour print job using 105g of filament). Besides, I have the Trinket already soldered into place.

Help!

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: Trinket and #296

Post by adafruit_support_mike »

The Trinket can only run a limited subset of general Arduino code. You might be able to adapt what you're doing to the Trinket depending on what you're trying to do, but it isn't a drop-in replacement for the Uno. It's generally best to assume libraries won't work until testing proves that they do.

The ATmega32u4 is the same microcontroller in the Leonardo and Flora, and its main difference from the Uno's ATmega328P is that the 32u4 handles its own USB communication. The 328P relies on another chip to convert USB to Serial input.

Since the 32u4 does handle USB on-chip, Windows will see a COM port while the bootloader is running, but then that COM port will go away when the bootloader passes control to the main code. You do need a driver to tell Windows how to communicate with the bootloader, and should be able to find links to one at the bottom of this page: http://ladyada.net/products/atmega32u4breakout/

User avatar
flounder
 
Posts: 494
Joined: Wed Sep 18, 2013 9:10 pm

Re: Trinket and #296

Post by flounder »

Well, if it were only failing to download my code, or the code appeared to download but not work, I would suspect the incompatibilities you suggest. But I can't even download the "blink" sketch. So the key here is that I cannot download ANYTHING. If I could download "blink", and my code didn't work, then I could attribute it to incompatibilities at the library level. But that's not my problem.

User avatar
pocketmoon
 
Posts: 78
Joined: Fri Dec 27, 2013 8:21 pm

Re: Trinket and #296

Post by pocketmoon »

Hi,

What error are you seeing when you try to upload a sketch ?

User avatar
flounder
 
Posts: 494
Joined: Wed Sep 18, 2013 9:10 pm

Re: Trinket and #296

Post by flounder »

Two things: first, the suggestion about the links at the end of a page whose URL was given was useless; I had already followed every one of those links, plus google searches, before I posted the question.

Second: When using the Trinket, I no longer remember the error message, sorry, but I will re-research this problem now that arduino.cc has downloadable signed drivers. But my experience with the first point went like this: I couldn't find a COM port when I tried the #296 part. So, in reading all the grotty details in the links pointed out in Point The First, I discovered that selecting the Leonardo board was a recommendation, so I did that. It compiled and downloaded successfully, but when I made a couple changes in the sketch, it now started complaining that it couldn't find any connection called "Arduino Leonardo". Bringing up Device Manager told me that a device called "Arduiono Leonardo" was plugged in, and it had the little circle-! indicating there was a problem. The problem was that no driver could be found. I unplugged and replugged the USB cable, and the device came back as "Arduino Leonardo", again with no driver loaded. I could no longer find any serial port connection availability, in both the IDE and Device Manager. Hitting the reset button on the board made it temporarily go away, and a few seconds later the board came back, still as a "Leonardo". So now I have a problem figuring out if I FUBARed the board, or just my laptop. Or both.

The problem with the Trinket is also that the IDE absolutely insists on recompiling my sketch each time, even though there have been no changes in it; this takes longer than the 10-second timeout of the Trinket bootloader. However, various attempts to delay the reset while the compilation takes place have been unsuccessful. "Ctrl+R" to compile. The upload key combination (I think it was Ctrl+U). Watch the compilation start. Count "One thousand and one, one thousand and two,...,one thousand and N", hit reset. Assorted values of N have not changed the outcome.

I am using the 8x8 NeoPixel display, and a 3-pin Ping))) ultrasonic ranging device, and that's all. Power is from a 2A power supply, and seems adequate for the percentage of pixels I display--typically less than 30, and often less than 20 pixels, using R, G, or RG (no case of RGB).

Again, the software downloads and runs successfully on an R3. I chose the #296 part because it seemed to offer the same features as the R3 at a lower price point and, more importantly, a fraction of the size. Not as small as the Trinket, which is still my first choice.

Once I get the signed drivers installed on my Win8.1 tablet, I'll try again and report in detail all that I have observed. I'm just trying to get the 'blink' sketch to download.
thanks
joe

User avatar
flounder
 
Posts: 494
Joined: Wed Sep 18, 2013 9:10 pm

Re: Trinket and #296

Post by flounder »

I never did get the Windows 8 installation to run. I gave it up as a bad idea, and acquired a MacBook Air. I wanted to experiment a bit on my next project, so I connected a BlueFruit programmer to the #296 chip. Following all the directions, I got it to pair up instantly with my MacBook. Cool. Now, let's download the sketch.

Oops. A Java Exception explaining that the programmer is not responding. OK, I check it again. The BlueTooth Preferences page tells me that the BlueFruit is not connected. I eventually just remove it, and seconds later, it is found again. I hit the 'pair' button and it is reconnected.

The download fails. Same error. Lather, rinse, repeat.

I have no idea what is going on here. So I try again. This time, I watch the BlueTooth Preferences window, while doing nothing else. Although the BlueFruit was immediately paired, in about 30 seconds (suspicious, that), it becomes disconnected. I get a message about a BlueTooth keyboard not being recognized. I cancel that window. I remove the BlueFruit programmer, and a few seconds later the scan brings it back. I pair it up and I wait. 30 seconds later, it becomes disconnected.

Footnote: the BlueFruit programmer comes with a 1uf capacitor which is supposed to go SOMEWHERE, the somewhere being carefully unmentioned. When I did a search, I found the project for the temperature/humidity sensor, stared at the pictures, and deduced that it goes in series with the pin and got the proper polarity. It would have saved me twenty minutes if the technical discussion had mentioned this little fact.

I am using the 32u4 part. I would like to try this with a Trinket as well, but with the BlueTooth going flaky on me, I have no idea if I can trust any design. I don't have time for this. I have things I want to build, and I'm losing time at the rate of one day per day, because nothing seems to work. I have a six-pack of Trinkets which seem to be nothing more than a way to occupy a drawer in my parts cabinet. I have a BlueFruit programmer that "just works", except it doesn't. I'm retired, and I learned to read a schematic by age 12. It isn't like I am clueless here. I've been a professional programmer for 50 years, a C++ expert, and drew my first "schematic" (not using standard symbols, just pictures I drew of the parts) when I was about 10. A couple more years of study revealed how standard parts are represented. So assume that I am a reasonably experienced, reasonably intelligent (I do have a PhD in Computer Science) person. I have read the tutorials. I have searched the fora. I have google™d for answers. And I'm stuck!

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: Trinket and #296

Post by adafruit_support_mike »

The 1uF capacitor goes in series with the Arduino's RESET pin. Its job is to convert a HIGH transition into-LOW a short pulse that resets the Arduino and allows it to reboot. If you just feed the RESET pin a LOW signal, it sits in the reset state indefinitely.

That's common for all methods of connecting an external device to the Arduino for bootloader programming, and is mentioned on the first page of the tutorial in the Learning system: https://learn.adafruit.com/introducing- ... k/overview
This package includes the necessary 1uF capacitor between the DTR and reset pin.
(right above the photo showing an EZ-Link connected to an Arduino)

You won't be able to use the EZ-Link with a Trinket because the Trinket doesn't program the same way as an Arduino. The ATtiny85 doesn't have a UART/Serial port, so we have to send data to the bootloader as a USB signal. The Trinket also doesn't have USB hardware, but the bootloader does software USB emulation long enough to collect the incoming firmware. USB and UART are very different protocols though, and the EZ-Link only knows how to speak UART.

User avatar
flounder
 
Posts: 494
Joined: Wed Sep 18, 2013 9:10 pm

Re: Trinket and #296

Post by flounder »

OK, so I can't use a Trinket. What about the forthcoming Trinket Pro? And why can't I get it to work on the #296 breakout, which apparently doesn't have the problem with the Trinket? As I said, I'm losing a day per day because of this. I can redo my case to hold the #296 part, but if I'm reprinting the case, I want to program this part with the BlueFruit breakout, rather than connect up a reset switch and USB connector. Why does the BlueFruit breakout lose connectivity with the MacBook Air after 30 seconds?

User avatar
flounder
 
Posts: 494
Joined: Wed Sep 18, 2013 9:10 pm

Re: Trinket and #296

Post by flounder »

I just double-checked the page you gave me the link to, and there is nothing on it that tells me how to put the 1uf capacitor into the circuit. For example, the polarity is not mentioned, and I'm running on far too little sleep to work it out from Maxwell's Equations. It is not clear how to connect the Tx/Rx pins of the BlueFruit to the Tx/Rx pins of the #296; the printing on the board suggests that Tx is sending data out from the BlueFruit, which means I should connect it to the Rx of the #296. Ditto the symmetric connection of BlueFruit.Rx, which I'm assuming (partly because of the arrows screened onto the BlueFruit board) is input to the BlueFruit, which means that it should be connected to the Tx of the #296. Some hints might be nice if this is wrong, and the pin marked "Tx" means "I'm the one you connect to the Tx pin", which might explain the errors I'm seeing.

There is no generic schematic that explains the connectivity to a board that supports serial programming. Remember, I'm new to this (having spent 50 years in software development), and I'm having to "outguess" what I think is being said. A simple schematic, showing the connectivity to an Arduino, would help (although for my Arduino, I got the shield version of the BlueFruit. Now I have to get the BlueFruit Shield, my stackable headers, my breadboard, a soldering iron, and a place to work all adjacent to me. This is more complex than it needs to be right now, and will remain so into the foreseeable future.

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: Trinket and #296

Post by adafruit_support_mike »

From the overview page:
overview.jpg
overview.jpg (78.92 KiB) Viewed 618 times
And from the "Arduino Programming" page:
connect.jpg
connect.jpg (64.26 KiB) Viewed 618 times

User avatar
flounder
 
Posts: 494
Joined: Wed Sep 18, 2013 9:10 pm

Re: Trinket and #296

Post by flounder »

Hmm. I missed that second one, and I thought I'd carefully looked at all the pages. Perhaps my suggestion of a simple schematic in the hardware (rather than programming) section should be considered.

But I still don't know why OS X BANNED is disconnecting the BlueFruit programmer.
joe

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: Trinket and #296

Post by adafruit_support_mike »

How long ago did you get the EZ-Link? We recently discovered a bug in one of the Bluefruit programming jigs that wasn't caught by the testing jig.

User avatar
flounder
 
Posts: 494
Joined: Wed Sep 18, 2013 9:10 pm

Re: Trinket and #296

Post by flounder »

According to the records of shipments, I got 5 on 8-Jan-14 and one on 23-Apr-14. I don't know which one I used for my current setup, but it was probably one of the 8-Jan batch.
joe

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: Trinket and #296

Post by adafruit_support_mike »

Hmm.. what ID number does it report when it makes a connection?

User avatar
flounder
 
Posts: 494
Joined: Wed Sep 18, 2013 9:10 pm

Re: Trinket and #296

Post by flounder »

I don't recall seeing anything like this. How would I discover it? Mac OS X BANNED.
joe

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”