Pages: 1 ... 6 7 [8] 9 10 ... 22   Go Down
Author Topic: Arduino Tiny  (Read 49666 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 35
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm sorry, if you mean why, it's because the Uno needs this capacitor to disable the auto reset. (while the other boards should have a resistance between Reset and +5v I think)

Edit: here is the long version of the output.
Code:
Binary sketch size: 748 bytes (of a 8192 byte maximum)
D:\arduino-0022\hardware/tools/avr/bin/avrdude -CD:\arduino-0022\hardware/tools/avr/etc/avrdude.conf -v -v -v -v -pattiny85 -cstk500v1 -P\\.\COM6 -b19200 -Uflash:w:C:\Users\henri\AppData\Local\Temp\build149233312836482128.tmp\Blink2.cpp.hex:i

avrdude: Version 5.4-arduino, compiled on Oct 11 2007 at 19:12:32
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

         System wide configuration file is "D:\arduino-0022\hardware/tools/avr/etc/avrdude.conf"

         Using Port            : \\.\COM6
         Using Programmer      : stk500v1
         Overriding Baud Rate  : 19200
avrdude: ser_open(): setting dtr
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Recv:
avrdude: Recv:
         AVR Part              : ATtiny85
         Chip Erase delay      : 4500 us
         PAGEL                 : P00
         BS2                   : P00
         RESET disposition     : possible i/o
         RETRY pulse           : SCK
         serial program mode   : yes
         parallel program mode : yes
         Timeout               : 200
         StabDelay             : 100
         CmdexeDelay           : 25
         SyncLoops             : 32
         ByteDelay             : 0
         PollIndex             : 3
         PollValue             : 0x53
         Memory Detail         :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65     6     4    0 no        512    4      0  4000  4500 0xff 0xff
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           flash         65     6    32    0 yes      8192   64    128  4500  4500 0xff 0xff
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           calibration    0     0     0    0 no          2    0      0     0     0 0x00 0x00

         Programmer Type : STK500
         Description     : Atmel STK500 Version 1.x firmware
avrdude: Send: A [41] . [80]   [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Send: A [41] . [81]   [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Send: A [41] . [82]   [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Send: A [41] . [98]   [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
         Hardware Version: 2
         Firmware Version: 1.18
         Topcard         : Unknown
avrdude: Send: A [41] . [84]   [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Send: A [41] . [85]   [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Send: A [41] . [86]   [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Send: A [41] . [87]   [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Send: A [41] . [89]   [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
         Vtarget         : 0.0 V
         Varef           : 0.0 V
         Oscillator      : Off
         SCK period      : 0.1 us

avrdude: Send: A [41] . [81]   [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Send: A [41] . [82]   [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Send: B [42] . [14] . [00] . [00] . [01] . [01] . [01] . [01] . [03] . [ff] . [ff] . [ff] . [ff] . [00] @ [40] . [02] . [00] . [00] . [00]   [20] . [00]   [20]
avrdude: Recv:
avrdude: Recv:
avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny85
avrdude: Send: P [50]   [20]
avrdude: Recv:
avrdude: stk500_program_enable(): protocol error, expect=0x14, resp=0x50
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

avrdude: Send: Q [51]   [20]
avrdude: Recv:
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

avrdude done.  Thank you.

« Last Edit: October 27, 2011, 08:44:09 pm by enjoyaol » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hmm, ok.
I will see if I can utilize timer.2 instead.
Then move forward from there.
Thanks
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 176
Posts: 12285
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm sorry, if you mean why...

I had wanted to know why then that would have been the question.

You start with an Uno that does not have a capacitor connected.  At some point in time, you connect the capacitor.  The question is, what did you do before you connected the capacitor?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 35
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry, my english is not my first language. Before connecting the capacitor, I programmes the Uno with the ArduinoISP sketch and it seems to work since the heartbeat led is blinking high/low/high/low.

After that, I connect the attiny to the breadboard accordingly to the schema over the MIT website. Then I connect the capacitor, and etc etc... Do I need also to use the resistor ?
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 176
Posts: 12285
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry, my english is not my first language.

No need to apologize.  None of us are born being able to read English.  If there is something you do not understand, just say so.

Quote
Before connecting the capacitor, I programmes the Uno with the ArduinoISP sketch and it seems to work since the heartbeat led is blinking high/low/high/low.

Perfect.  That's exactly what you should do.

Quote
After that, I connect the attiny to the breadboard accordingly to the schema over the MIT website. Then I connect the capacitor,

Perfect.  That's exactly what you should do.

Quote
Do I need also to use the resistor ?

As far as I know, no one has needed the 120 ohm resistor in addition to a capacitor.

Is the capacitor an electrolytic?  Does it have a plus or minus on the case?

How long ago did you purchase the Arduino?

Do you have a second Arduino?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 35
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes the capacitor has a minus that I connect to Ground. The UNO is pretty new (2 months old).
I'm going to try to get an ISP programmer in some brick and mortar shop today to see if that works..
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Can the Timer.1 library be modified for use with Timer.2?
http://code.google.com/p/arduino-timerone/
Since this is the sole reason I use the Timer.1 library:
"The development of this library began with the need for a way to quickly and easily set the PWM period or frequency"

I understand Timer1 is 16bit and Timer2 is 8 bit.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 35
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well, I got it to work with another breadboard. Sorry for that ! Happy ! smiley
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 176
Posts: 12285
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


I'm glad you have it working.  No need to apologize.
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 64
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

In Reply #28 and #29, I reported success with BHogan TinyWireS I2C library on an ATtiny85.  I can now report that, following similar steps I have an ATtiny84 I2C slave talking to an Uno.  Code is the same for master and slave.  TinyWireS did have to get tweaked to add ATtiny84 # defines in usiTwiSlave.c.  Using Arduino Tiny core and Pololu AVR USB Programmer.

Interesting, in this case it is working fine without any external pull-ups.

George
Logged

Global Moderator
Italy
Online Online
Brattain Member
*****
Karma: 313
Posts: 21616
Logic is my way
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I would ask a question.
I'm having a strange behaviour using a Tiny84. I've built a circuit prototype on a breadboard using 2 gas sensors, an MQ-4 and an MQ-7.
Using those sensors with an Arduino UNO I get correct readings from them (checked on the serial monitor).

So I decided to build a circuit around a Tiny84. To check if the readings are correct I use NewSoftSerial to send  the values to Arduino UNO and then I read them from the serial monitor.
I've noticed that only the first analog read is correct, the second one seems to be influenced by the previous one.
I mean that if I read the first sensor I get, i.e., 274. On the 2nd I get 188. If I connect the 1st sensor to 5V, I get 1023 but on the 2nd one I get ~850. If I connect the 1st to GND I read 0, on the 2nd one I read around 188. Using an Arduino everything is correct and the analog pins connected to the sensors work indipendently.

It seems that I cannot do 2 readings in sequence. Is this normal for the Tinys or is there something in the Core libs?
Logged


Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 176
Posts: 12285
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


It is entirely possible that you have encountered a bug in the Tiny Core.  While I tried very hard to thoroughly test it, I have been known to occasionally make a mistake.   smiley-wink

I can say that the 0.1 uF capacitor across VCC and GND is critical.  In my testing, without the capacitor, analog read values on ATtiny processors are erratic.

Are you using the core from here...
http://hlt.media.mit.edu/?p=1229

Or here...
http://code.google.com/p/arduino-tiny/

Are you using AREF?

Have you tried a different pair of analog inputs?

Have you tried performing three reads from the same input to see if the read value approaches the expected value?
Logged

Global Moderator
Italy
Online Online
Brattain Member
*****
Karma: 313
Posts: 21616
Logic is my way
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Let's start....  smiley-wink

It is entirely possible that you have encountered a bug in the Tiny Core.  While I tried very hard to thoroughly test it, I have been known to occasionally make a mistake.   smiley-wink
Only One doesn't make errors, and He does not reside on this planet  smiley-lol

Quote
I can say that the 0.1 uF capacitor across VCC and GND is critical.  In my testing, without the capacitor, analog read values on ATtiny processors are erratic.
I always use a 0.1 uF cap between Vcc and Gnd of every micro I use for decoupling.

Quote
From Google Code.

Quote
Are you using AREF?
No. I don't.

Quote
Have you tried a different pair of analog inputs?
No. I don't. Nor I've tried a different chip.

Quote
Have you tried performing three reads from the same input to see if the read value approaches the expected value?
I use to read the same analog bin about 10-20 times, with a 1 ms delay from each other, and then return the last reading, to let the S&H charge correctly. After I read the first pin my sketch waits for about 50 ms then it starts reading the second one using the same routine.
But I've also tried to read the pin only 1 or 2 times but nothing have changed.

This afternoon I'll try to:
1) use a different pair of pins
2) use a different Tiny84
Logged


Global Moderator
Italy
Online Online
Brattain Member
*****
Karma: 313
Posts: 21616
Logic is my way
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

An update.
I've tried a different Tiny and a different couple of pins and it worked.
So I mounted back the first Tiny84 and used a different couple of pins and it worked.

I discovered that I used A0/A1 pins and then A1/A2 pins.
But looking at the datasheet I've found that A0 is also the AREF pin... so it seems that you cannot use the AREF pin as a normal analog input, am I right?
Logged


Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 176
Posts: 12285
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


Thank you for testing and for the follow-up.

Quote
so it seems that you cannot use the AREF pin as a normal analog input, am I right?

It should work.  The datasheet indicates that, when REFS1 REFS0 = 0 0, the AREF pin is free to use as we please.  I believe I tested it but it's been many months so I could easily be wrong.

You are not calling analogReference, correct?

Please print the value of ADMUX right after calling analogRead(0) (e.g. Serial.println(ADMUX,HEX);).  You do not need to have anything connected to A0.

After calling analogRead(0), is there a stable voltage on the AREF pin?
« Last Edit: November 14, 2011, 03:04:08 pm by Coding Badly » Logged

Pages: 1 ... 6 7 [8] 9 10 ... 22   Go Up
Jump to: