Go Down

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

leo72

Yeah, it does (flashing right now  ;) ).
It seems that it's not possible to have the PWM signals with timer 0. Strange....

Coding Badly


That is strange.  I must have broken something after testing it.

It will be a few days before I have time to investigate.  In the meantime, if you try to fix it yourself, I will do what I can to assist (like answering questions).

leo72

I don't know if I will have time to do that, because I was preparing a simple funny light for my "presepio" (Nativity scene or crib, I don't know the exact translation  :smiley-sweat: ) so I chose the Atmega328 to finish my work.  :smiley-sweat:

After that work, maybe I could try to get a look at the code of the core.

Coding Badly

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 snipped ]  You'll see that only the red signal fades; the other 2 stay off.


Your sketch works well here.

Are you using Linux?

leo72

Yes, I am...
Why do you ask this?  :smiley-roll-sweat:

Coding Badly


You're the second person on the forum...

* To have a problem with the Tiny Core
* That I cannot reproduce
* That is using Linux for development

At this point, the evidence points to the GCC AVR toolset you're using.  For what it's worth, I'm using WinAVR-20100110 (the IDE comes with WinAVR-20081205).

When I tested, I used your sketch.  It worked as expected (all three LEDs fading from off to full-on).

leo72

I'm very happy to hear this from you...  :smiley-roll-sweat:
Do you remember this problem:
Linux Kernel 3.0 stopped ArduinoISP working

So, if 1+1=2, I can say for sure that the Linux AVR toolchain is BUGGY at the maximal level! Crap....
This is not the first problem that I'm having with the toolchain, with Tiny but with Arduino/Atmega328 too.

With ArchLinux I had to heavely patch all the toolchain because I had a lot of problems compiling the sketches, and after I patched everything, I discovered the above bug.... that was replicated on the latest Ubuntu 11.10 too.... So I roll back to Ubuntu 11.04.... and a new bug has emerged!!
:0

Start thinking to switch to PIC for their Linux support....  :smiley-roll:

Coding Badly

I'm very happy to hear this from you...  :smiley-roll-sweat:


I am sorry for bringing you such bad and annoying news.

Quote
Do you remember this problem:
Linux Kernel 3.0 stopped ArduinoISP working


I do.  And I (finally) have a possible theory (see the other thread).

Quote
Start thinking to switch to PIC for their Linux support....  :smiley-roll:


Noooo!  You must not fall to the Darkside!

leo72


Quote
Start thinking to switch to PIC for their Linux support....  :smiley-roll:

Noooo!  You must not fall to the Darkside!

XD
By the way, I don't understand why Atmel isn't supporting other OSes than Windows! Atmel is very common through hobbiest and hackers but a lot of them use Linux rather than Win's....

Coding Badly


I think Atmel has a "supported" Linux toolset available from their website.  I believe they even have two (or more) binary packages available.

Have you tried the toolset available from Atmel?

leo72


I think Atmel has a "supported" Linux toolset available from their website.  I believe they even have two (or more) binary packages available.

For "Linux support" I mean an official IDE. AVRStudio works only under Windows. Microchip has its IDE both for Win and Linux. The AVR toolchain under Linux has always been bugged (starting from binutils-avr ending to gcc-avr)...  :smiley-roll-blue:

Quote

Have you tried the toolset available from Atmel?

Where are they? I didn't know about them.

Coding Badly


Scott Howard graciously posted this to the Developers List...

Quote
They do, and this is where Debian/Ubuntu's tool chain directly comes from:
http://distribute.atmel.no/tools/opensource/avr-gcc/

Also, here are precompiled binaries (32 and 64 bit)
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=17311&category_id=163&family_id=607&subfamily_id=1965

http://www.arduino.cc/playground/Linux/Debian
http://www.arduino.cc/playground/Linux/Ubuntu


That is, quite literally, all I know about it.

leo72

Those are patches to apply to the GNU AVR tools. But it seems that they are a little bit out of date since they seem to be dated feb/2011. Debian/Ubuntu should already have the AVR tools patched.

Coding Badly


leo72

One question about PWM with Attiny85.
In the file pins_arduino.c there are the alternative functions of the pins, and PWM signals are marked on pins D0 and D1.
Code: [Select]
#if defined( __AVR_ATtinyX5__ )

// ATMEL ATTINY45 / ARDUINO
//
//                           +-\/-+
//  Ain0       (D  5)  PB5  1|    |8   VCC
//  Ain3       (D  3)  PB3  2|    |7   PB2  (D  2)  INT0  Ain1
//  Ain2       (D  4)  PB4  3|    |6   PB1  (D  1)        pwm1
//                     GND  4|    |5   PB0  (D  0)        pwm0
//                           +----+

// these arrays map port names (e.g. port B) to the
// appropriate addresses for various functions (e.g. reading
// and writing) tiny45 only port B


But the datasheet says that both timers 0 & 1 are capables of PWM functions, and that the PWM pin are D0, D1, D3 and D4 (to be more exact, D3 is the inverse of the signal that is present on D4). Does the core Tiny support PWM signals on pin D4 too? Is the pin mapping out of date?

Go Up