Go Down

Topic: Arduino Tiny (Read 68109 times) previous topic - next topic

leo72


You are not calling analogReference, correct?

No, I didn't.

Quote

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.

0
0
0
0
etc...

Quote

After calling analogRead(0), is there a stable voltage on the AREF pin?

4V64

Coding Badly


Thanks again for taking the time to run these tests.


Are you calling pinMode or digitalWrite?  Maybe there is a pin-mapping bug and A0 is getting turned into an output.  Or the internal pull-up is being enabled.


Quote
After calling analogRead(0), is there a stable voltage on the AREF pin?   4V64


Does connecting a pull-down resistor to A0 change the voltage?


I'm running out of ideas.  Will using A1 and A2 cause any problems?

leo72

I'M SO SORRY....  =(
I wasted your time searching non-existing bugs...  :smiley-roll-blue:

I didn't notice that I was using A0/D10 as the RX pin for NewSoftSerial..... SORRY.
Deleting it, everything has started to work perfectly!
I was using the serial to debug my sketch and my circuit... Me stupid...  :smiley-red:

Coding Badly


No need to apologize.  We now have documented proof that A0 works.  As far as I'm concerned, it was worth the time.

leo72

Just another question.

Do you think to support the Tiny861 into your Tiny core in the future?
It should be an interesting micro to work with.

Coding Badly


I agree.  The 861 is an interesting processor.  It seems to be fourth on the "popularity" list: 85 (and 13), 84, 2313, then the 861.

I have one here for testing.  I even let it out of its cage about two weeks ago.

At some point, I will add support for it.  Unfortunately, too many things keep getting in the way.

MGeo

Hello,

Thanks again to Coding Badly for work on Tiny.

I have an application I am working on making use of 16 bit Timer1 with interrupts.

If I do not plan to use mills/delay in my app, is it possible for me to disable Timer0 within core, or would the be major surgery?

George

harry

Hi

I have designed a breakout for the Attiny2313, Attiny85 and Attiny84. Please have a look here http://arduino.cc/forum/index.php/topic,82083.0.html for more info.

Hope it can be useful to some people.

Thanks

leo72

Just a question.

Atmel has released new versions of ATtinyx4 marked "A" (ATtiny24A/44A/84A) that, it seems, should differ from the previous ones for the adoption of the PicoPower core.


Does the Tiny core support them? Or do you have in mind to add the support for them shortly?

leo72

A question about PWM.
Is it me or it isn't possible to use more that 1 PWM signal?

I would like to fade an RGB LED using PWM signals on digital pins 2-3-4 using analogWrite but I'm having strange results. It seems that 3 PWM signals cannot be used together: only the last one appears to work.

Is it a limit of the Tiny core or a limit of the micro itself?

Coding Badly

Thanks again to Coding Badly for work on Tiny.


You are welcome.

Quote
If I do not plan to use mills/delay in my app, is it possible for me to disable Timer0 within core, or would the be major surgery?


Should not be too difficult.  The code in question starts here...
http://code.google.com/p/arduino-tiny/source/browse/trunk/hardware/tiny/cores/tiny/wiring.c

Put a conditional compile around or comment out everything in init (bottom of the file) that starts with "MillisTimer_".


Coding Badly

Atmel has released new versions of ATtinyx4 marked "A" (ATtiny24A/44A/84A) that, it seems, should differ from the previous ones for the adoption of the PicoPower core.

Does the Tiny core support them? Or do you have in mind to add the support for them shortly?


In core_build_options.h ...
http://code.google.com/p/arduino-tiny/source/browse/trunk/hardware/tiny/cores/tiny/core_build_options.h#63
...there is a section for the X4 family.  You may have to add something like this; current code...

Quote
#if defined( __AVR_ATtiny24__ ) || defined( __AVR_ATtiny44__ ) || defined( __AVR_ATtiny84__ )
#define __AVR_ATtinyX4__
#endif


...potential new code...

Quote
#if defined( __AVR_ATtiny24__ ) || defined( __AVR_ATtiny44__ ) || defined( __AVR_ATtiny84__ )  || defined( __AVR_ATtiny24A__ ) || defined( __AVR_ATtiny44A__ ) || defined( __AVR_ATtiny84A__ )
#define __AVR_ATtinyX4__
#endif


You may also have to update boards.txt; current entry...

Quote
attiny84at16.build.mcu=attiny84


...potential new entry...

Quote
attiny84at16.build.mcu=attiny84a


But I doubt any of those changes are necessary.  In any case, please report back with what you find.

Coding Badly

Is it me or it isn't possible to use more that 1 PWM signal?


In my testing, all available PWM channels worked correctly.

Quote
Is it a limit of the Tiny core or a limit of the micro itself?


Should not be a problem with either.

Which processor?

leo72

I'm trying to fade an RGB LED using an Attiny84@8 MHz.
Connet an RGB LED to phisical pins 5-6-7 (digital pins 2-3-4) and try this code:
Code: [Select]
const byte RED=4;
const byte BLUE=3;
const byte GREEN=2;

void setup() {
    pinMode(RED, OUTPUT);
    pinMode(BLUE, OUTPUT);
    pinMode(GREEN, OUTPUT);
}

void loop() {
    for (byte i=0; i<255; i++) {
        analogWrite(RED, i);
        analogWrite(BLUE, i);
        analogWrite(GREEN, i);
        delay(10);
    }
}


You'll see that only the red signal fades; the other 2 stay off.

Coding Badly


Huh.  How strange.  Does digital 5 (physical 8, PA5) work?

Go Up