TinyCircuits Forum

TinyCircuits Products => TinyLily => Topic started by: jfputnam on April 29, 2013, 10:48:53 PM

Title: Pinout documentation
Post by: jfputnam on April 29, 2013, 10:48:53 PM
I would like to see some more documentation as to pinouts and IO instructions. Being new to Arduino and this board being a cut down version it would be nice to have some rudimentary discussion of how to hook thinks up.

I did have success in a small program to use the button to toggle between a blinking yellow and green led's on ports 1 and 2 switch on 3.  I used a pull down resistor on the switch after seeing the usual floating behavior and resultant weird behaviors but a little of my old digital logic background and that got straightened out.

I next want to start working with the motor controls. I have a radio shack micro motors and a vibration motor and a server to play with.

Is there any good wiring examples of using the motor boards for these devices?
Title: Re: Pinout documentation
Post by: amnipar on May 06, 2013, 01:31:39 PM
Seconded. I recently received my TinyLily boards and several motor boards. I have a few cool ideas for projects that I'd like to try building, but I'm a little hesitant to start wiring up the motor boards. They are so tiny and there are no instructions. Please, try to set up some basic instructions for all your current boards! And I'm really looking forward to a tiny accelerometer board for TinyLily!
Title: Re: Pinout documentation
Post by: TinyCircuits on June 29, 2013, 10:22:42 PM
Sorry for taking so long to get better documentation up.  We're getting a number of new things up over the next week or two, one of the first ones is for the TinyLily Motor board documentation and some examples of how to use it.  Here's our first draft of this, we plan to update this with some photos and a video early next week. 

http://tiny-circuits.com/learn/tinylily-motor-board/

Thanks,

Ken
Title: Re: Pinout documentation
Post by: Ds1 on July 04, 2013, 01:29:53 PM
Awesome, thanks! I am as well in need of some documentation. I wanted to do this project as a simple test with my TinyLily, but the number of pins with the board they use and the TinyLily are different, so I haven't exactly figured out how to do it yet. I also don't want to break anything on my wicked-cool little microprocessor the first day I got it, haha. http://lilypadarduino.org/?page_id=552
Title: Re: Pinout documentation
Post by: wikkit on July 07, 2013, 10:41:45 PM
The emails after the kickstarter kept soliciting the submission of projects that had used the hardware. That doesn't make much sense when there's not even a pinout available to base a project on.

I spent some time this afternoon trying to get the TinyLily to work, with mixed results. Here's the pinout as best I've found so far. The challenge was increased by the silkscreen being incomplete.

(http://i.imgur.com/rErYNkE.jpg)

Starting at just left of the top, and going clockwise:
+3.54V
GND
A0 - analog input
A1 - analog input
A4 - analog input
A5 - analog input
GND
+3.54V
0 doesn't do anything
1 is +3.54V
2 is digital I/O as pin 2, I've only tried O
3 - digital I/O as pin 3 with PWM output (you can analogWrite to it a value 0-255)

I figured out that pin 3 is pwm only because it's used that way in the motor shield demo on this site.

I'm guessing the board is not working correctly, it seems like 0 and 1 should be digital I/O as well.
Title: Re: Pinout documentation
Post by: Ds1 on July 08, 2013, 11:44:14 AM
You can see the "official" Pinout in the TinyLily's sales page. Just go under photos and scroll through to see the 3D renderings, which are clearly marked. I don't have the link handy so you'll have to go find it yourself.
Title: Re: Pinout documentation
Post by: KeithJRome on July 08, 2013, 04:35:06 PM
(http://tiny-circuits.com/wp-content/uploads/2012/08/ASM2101_Rev2_top.png)
Title: Re: Pinout documentation
Post by: KeithJRome on July 08, 2013, 04:39:29 PM
0 and 1 are marked as dual-purpose in the schematic (can be D0/D1 or tx/rx), so maybe you have Serial I/O enabled on them in the loaded sketch?

http://tiny-circuits.com/wp-content/uploads/2012/09/ASM2101_Rev2.pdf
Title: Re: Pinout documentation
Post by: wikkit on July 08, 2013, 05:15:46 PM
The sketch is super basic, was just using something similar to the usual blink code to test the digital outputs. Unless the serial port has to be expressly disabled, that's not it.
Title: Re: Pinout documentation
Post by: wikkit on July 08, 2013, 05:46:44 PM
I finally found that PDF on the fourth tab of the TinyLily shop page in the bottom of a locked filing cabinet stuck in a disused lavatory with a sign on the door saying 'Beware of the Leopard'.

Perhaps a link to it from the "Learn" page would be prudent as well.
Title: Re: Pinout documentation
Post by: Ds1 on July 08, 2013, 10:32:31 PM
Hey that PDF is helpful! Although I have no idea what to use that information for, haha.
Title: Re: Pinout documentation
Post by: OSHGroup on September 18, 2013, 11:53:01 PM
Does anyone know what the 6 pads in the middle connect to?
Title: Re: Pinout documentation
Post by: SCAdianScout on October 03, 2013, 10:08:35 AM
Does anyone know what the 6 pads in the middle connect to?

I believe they are the other way of accessing the processing chip directly, without the USB board.
Title: Re: Pinout documentation
Post by: SCAdianScout on October 03, 2013, 10:17:34 AM
Starting at just left of the top, and going clockwise:
+3.54V
GND
A0 - analog input
A1 - analog input
A4 - analog input
A5 - analog input
GND
+3.54V
0 doesn't do anything
1 is +3.54V
2 is digital I/O as pin 2, I've only tried O
3 - digital I/O as pin 3 with PWM output (you can analogWrite to it a value 0-255)

I figured out that pin 3 is pwm only because it's used that way in the motor shield demo on this site.

I'm guessing the board is not working correctly, it seems like 0 and 1 should be digital I/O as well.

I tried some simple variants of the blink sketch to try and understand the board schematics (this is my first Arduinoish device).

I agree that tab zero does nothing - it seems to be continuously powered.

The tab marked 1, 2, and 3 are referred to by the same numbers, so to make an LED blink when connected to tab 1, replace the "int led = 13;" with "int led = 1;".

I hope this is helpful for others.  Now I need to learn how to do the same thing with the analogue pins.
Title: Re: Pinout documentation
Post by: calvinthedestroyer on October 05, 2013, 07:24:28 AM
You can hook up more lights by using "Charley plexing" You can use this schematic:
http://tiny-circuits.com/wp-content/uploads/2012/09/ASD2411_Rev3.pdf (http://tiny-circuits.com/wp-content/uploads/2012/09/ASD2411_Rev3.pdf)

Title: Re: Pinout documentation
Post by: TinyCircuits on October 09, 2013, 09:25:03 PM
On the TinyLily Mini, the numbers shown correspond to the Arduino "pin numbers", such as for the digitalWrite function.  So 0 as marked on the TinyLily Mini is accessed as pin number 0 in the Arduino IDE.  The ones that have the A prefix are analog pins.  In total, digital pins 0, 1, 2, 3 are supported, and analog (or digital) pins A0, A1, A4 and A5 are supported.  There are also some alternate functions on the pins (the same as an Arduino Uno), so A4 and A5 can also be used as I2C pins, and pins 0 and 1 are connected up to the USB programmer.

Because 0 and 1 are connected to the USB programmer, you can't use this pins at the same time as when the USB is plugged in (which is why it might look like they are not working to some people). 

The + and - pins are power and ground.  There are two sets of these, and they are connected together.  The reason for this is that you can have a battery hooked up to one pair, then the other pair can be used to provide power out to any peripherals you have. 

The 6 pins in the middle (that aren't soldered to anything) are for an in-circuit programming connection.  This lets you program the microcontroller initially with the Arduino IDE, and a 6-pin connector can be soldered in to allow ICSP programming and debugging using an external debugger, but most Arduino users will never use this.  If you look at the schematic, the ICSP connector used the SPI pins on the processor, so if you absolutely need some additional I/O points, you can grab a few more signals off of this.

Thanks,

Ken
TinyCircuits
Title: Re: Pinout documentation
Post by: rosewater on January 07, 2014, 09:30:53 PM
In reply to wikkit, "pin 0 does not do anything". AFter lot of frustration and trial and error, I found out that pin 0 does actually work, but only if the tiny lily is powered externally from a battery, and not connected to to the USB of my computer.

Even trying Serial.end() does not disable serial mode if connected to the USB cable to computer.
Title: Re: Pinout documentation
Post by: calvinthedestroyer on January 22, 2014, 06:33:02 AM
Does anyone know what the 6 pads in the middle connect to?

Yeah, those are for programming the chips.
see:
(https://scontent-a.xx.fbcdn.net/hphotos-prn2/t1/247047_10151576280252440_1040356672_n.jpg)
Title: Re: Pinout documentation
Post by: CaptClaude on April 29, 2014, 12:26:25 AM
After some tinkering, I managed to get some LEDs to blink.  When connected to the USB thingie, pins 0 & 1 are not useful but when connected to 3xAA batteries, they work OK, but 0 always glows before the sketch gets moving after applying power.  If blinking LEDs is the goal (and for me, believe it or not, it is), best not use 0 at all.

Can the analog pins be PINMODE-ed to digital?  If so, what are their pin numbers?  I know for instance that there is no pin 4 because
Code: [Select]
pinMode(4, OUTPUT);
digitalWrite(4, HIGH);
and then
Code: [Select]
digitalWrite(4, HIGH);   // set the LED on
delay(3000);              // wait for 3 seconds
digitalWrite(4, LOW);    // set the LED off
Does nothing.

The end goal is to use the tinylily to drive (though a couple of transistors) some HB LEDs to illuminate some (found on Amazon) fiber-optic flowers to be used as stage props in a production of Shakespeare in Hollywood.  I am trying to get a "breathe"-style but the first adapted sketch I tried didn't work and my attempts at dimming with
Code: [Select]
void loop()
{
  for(i = 0 ; i <= 255; i+=1)
  {
    analogWrite(LEDpin, i);
    delay(20);
  }
  for(i = 255 ; i >= 0; i-=1)
  {
    analogWrite(LEDpin, i);
    delay(20);
  }

}
tonight have not gone anywhere -- the LED comes ON and then goes OFF.  It's been a while since my last Arduino project (likewise for the theatre) so my brain may be rusted shut.

Are there restrictions on which pins can PWM and which not?

Thanks!
Title: Re: Pinout documentation
Post by: CaptClaude on April 30, 2014, 12:54:38 AM
I have at least in part answered my own question:  Pin 3 is a PWM pin -- we know this because the motor sketch example uses it.  :-[
I would still like to know if there are any other pins that can PWM.

The really interesting thing is that my test sketch does not run when connected to USB, only when run off external power (3xAA works great).

Cheers.
Title: Re: Pinout documentation
Post by: CaptClaude on May 02, 2014, 02:07:27 AM
Something else I am sure that everyone else knows but which I feel compelled to document here:  The a0, a1, a4 & a5 pins are also digital output pins.
THe next experiment will try and see if any of them are also PWM pins.
Code: [Select]
/*
  Blink a0, a1, a3, a4 pins
 */
 int pin;

void setup() {               
  // initialize the pins as an output.
  pinMode(14, OUTPUT);
  pinMode(15, OUTPUT);
  pinMode(18, OUTPUT);
  pinMode(19, OUTPUT);
 
}

void loop() {
  pin = 14;
  digitalWrite(pin, HIGH);   // set the LED on
  delay(1000);              // wait for a second
  digitalWrite(pin, LOW);    // set the LED off
  pin = 15;
  digitalWrite(pin, HIGH);   // set the LED on
  delay(1000);              // wait for a second
  digitalWrite(pin, LOW);    // set the LED off
  pin = 18;
  digitalWrite(pin, HIGH);   // set the LED on
  delay(1000);              // wait for a second
  digitalWrite(pin, LOW);    // set the LED off
  pin = 19;
  digitalWrite(pin, HIGH);   // set the LED on
  delay(1000);              // wait for a second
  digitalWrite(pin, LOW);    // set the LED off

}

Let's not all chime in here at once...

Cheers.