The new Raspberry Pi B Model B+ is here - Pick one up in the store and check our detailed guide!

Trinket Pinout Diagram

by ardunaut on Sat Feb 01, 2014 11:19 am

A simple tool to deal with the wiring and programming.
Sugestions will be appreciated.

Image
ardunaut
 
Posts: 2
Joined: Sat Feb 01, 2014 10:52 am

Re: Trinket Pinout Diagram

by adafruit_support_bill on Sat Feb 01, 2014 11:23 am

Nice diagram. Thanks!
User avatar
adafruit_support_bill
 
Posts: 27934
Joined: Sat Feb 07, 2009 9:11 am

Re: Trinket Pinout Diagram

by adafruit_support_rick on Sat Feb 01, 2014 11:27 am

Nice picture! I like it!
Would you mind if we used it in the tutorial?
User avatar
adafruit_support_rick
 
Posts: 10724
Joined: Tue Mar 15, 2011 10:42 am
Location: Buffalo, NY

Re: Trinket Pinout Diagram

by ardunaut on Sat Feb 01, 2014 12:54 pm

Feel free to use it...
... and thanks for this tiny board , l'm having a great time recreating many of my projects with it.
ardunaut
 
Posts: 2
Joined: Sat Feb 01, 2014 10:52 am

Re: Trinket Pinout Diagram

by thekitty on Sat Feb 01, 2014 5:10 pm

I tweaked the diagram a bit (attached). The input is 5.5-16V, pin 4 cannot use regular analogWrite, and some other embellishments like those used by Pighxxx and GreyNomad in other Arduino diagrams. Hopefully Ardunaut does not mind.
Attachments
Trinket 5V.jpg
Trinket 5V.jpg (309.86 KiB) Viewed 655 times
thekitty
 
Posts: 590
Joined: Sat Mar 24, 2012 7:56 pm
Location: Mid-Atlantic

Re: Trinket Pinout Diagram

by adafruit_support_rick on Sun Feb 02, 2014 2:27 pm

I added the tweaked diagram to the tutorial Pinout page.
User avatar
adafruit_support_rick
 
Posts: 10724
Joined: Tue Mar 15, 2011 10:42 am
Location: Buffalo, NY

Re: Trinket Pinout Diagram

by thekitty on Sun Feb 02, 2014 4:33 pm

Thanks Rick. People have also asked what resistors are connected to what pins as they may give different impedances or pullup conditions. Attached is a diagram that is a subset of the schematics showing the resistances. Hopefully I'll have accompanying info on pullup/pulldown. I thought there was a post on pullup/pulldown/internal pullups earlier by a user but I cannot find it. Mike
Attachments
Trinket Pins.jpg
Trinket Pins.jpg (130.31 KiB) Viewed 627 times
thekitty
 
Posts: 590
Joined: Sat Mar 24, 2012 7:56 pm
Location: Mid-Atlantic

Re: Trinket Pinout Diagram

by thekitty on Thu Feb 06, 2014 9:16 pm

Ok, I have the data on input pullups:

You can set an input pullup by using pinMode(pin, INPUT_PULLUP); which ties about a 20K resistor from the pin internally to the supply voltage (5V or 3V for Trinket 5V and 3V respectively).

The internal pullup is used often for detecting a switch change. you can connect a switch from the pin and the other side of the switch to ground.

The 3V and 5V Trinkets act a bit differently it turns out:

For the 3V, using external power on BAT+ for any pin (USB for pins 0-2), the switch and INPUT PULLUP will work as expected (The pullup makes the default digitalRead HIGH, press the button and digitalRead returns LOW).

For the 5V Trinket, all pins work but pins 1 and 4. Yes 4. If you need to read a switch on those pins, use a 1000 ohm resistor from the pin to 5 volts to pull it high then the switch will work to pull it low.

In other news, if you set a pin as INPUT or OUTPUT, the pin will register 0 volts unless raised high except Pin 3 on each that is pulled to 3.2 volts because of the USB pullup resistor onboard.

If you want to test things easily, write a short program to digitalRead a pin and switch Pin 1 (Red LED) on/off depending on the value read. Helps in debugging without the serial monitor.
thekitty
 
Posts: 590
Joined: Sat Mar 24, 2012 7:56 pm
Location: Mid-Atlantic

Re: Trinket Pinout Diagram

by kwschnautz on Mon May 12, 2014 10:21 am

So, if I'm understanding this correctly, the 3V Trinket has a 1.5kOhm pullup on pin 3 for USB functionality?

I'm attempting to use pin 3 as an analog input AnalogRead(3), but the pullup seems to be affecting my readings. With no sensor connected, pin 3 is 3.3V and with a LM60 temperature sensor, it pulls the value up to 3.23V, when the sensor would normally return 0.57V at room temperature. Sensors pulled into GPIO 2 and 4 (analog 1 and 2) do just fine, because they don't have that pullup.

In order to get analogRead(3) to return the true voltage, I expect that I need to remove the USB pullup. Will doing this render my Trinket unprogrammable? Is there a better fix to allow me to utilize analogRead(3)?
kwschnautz
 
Posts: 4
Joined: Fri Aug 12, 2011 9:54 pm

Re: Trinket Pinout Diagram

by kwschnautz on Mon May 12, 2014 10:55 am

Here's what I've found - the Trinket doesn't appear to start without the USB pullup on pin 3. So in order to start the program, the pullup must be present.

I'm considering adding a switch in series with the pullup - to disable it once the program has started.
kwschnautz
 
Posts: 4
Joined: Fri Aug 12, 2011 9:54 pm

Re: Trinket Pinout Diagram

by thekitty on Mon May 12, 2014 8:25 pm

You are correct in your characterization of the situation, you can use Pin 3 but additional circuitry can affect programming. I suggest socketing the Trinket with some female header if you need to pop it out to program and put in and are beyond the breadboard stage.

If you add a 1.5K between the pin and ground, you'd set the pin at 1/2 Vcc , lower with a smaller pullup but with increasing current draw to ground. The switch approach sounds tough.
thekitty
 
Posts: 590
Joined: Sat Mar 24, 2012 7:56 pm
Location: Mid-Atlantic