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: 25402
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: 8492
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 475 times
thekitty
 
Posts: 423
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: 8492
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 447 times
thekitty
 
Posts: 423
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: 423
Joined: Sat Mar 24, 2012 7:56 pm
Location: Mid-Atlantic