Pages: 1 [2] 3 4 5   Go Down
Author Topic: Help with LED Lamp concept.  (Read 6679 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Full Member
***
Karma: 1
Posts: 209
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

On the at85 I use 3,Red 0,Green 1,Blue.
Shuffle that red over to D4 and I think you'll have a better result.  The tiny core doesn't give you hardware PWM control on D3 so the effect of analogWrite() will be a harsh cut-over from OFF to ON.

Cheers ! Geoff

Thanks Geoff,  But I have a question. The diagram http://www.akafugu.jp/images/microcontroller-reference-sheet.png it show PIN 3 as PWM.  am I missing something as usual

thanks
Logged

Offline Offline
Full Member
***
Karma: 1
Posts: 209
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

all most there.

I have one last issue,  When I run it with out transistors on the Arduino it works smooth. But when I use 3, PNP transistors it works fine up until the Green to Blue transition. It almost dims out completely then flicker to blue.

You can see what I am talking about here.http://www.youtube.com/watch?v=on6Qf8OeYgg&feature=youtu.be  The first 45 sec our so is with out Transistors.  After a few sec of blackness it with transistors. 

Sorry for the poor video 
Logged

Brisbane, Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 1123
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

On the at85 I use 3,Red 0,Green 1,Blue.
Shuffle that red over to D4 and I think you'll have a better result.  The tiny core doesn't give you hardware PWM control on D3 so the effect of analogWrite() will be a harsh cut-over from OFF to ON.

Cheers ! Geoff

Thanks Geoff,  But I have a question. The diagram http://www.akafugu.jp/images/microcontroller-reference-sheet.png it show PIN 3 as PWM.  am I missing something as usual

thanks
it is. It's just not usable as one in the Arduino IDE.  use 4 and you'll be fine.
Logged

"There is no problem so bad you can't make it worse"
- retired astronaut Chris Hadfield

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 150
Posts: 5666
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks Geoff,  But I have a question. The diagram http://www.akafugu.jp/images/microcontroller-reference-sheet.png it show PIN 3 as PWM.  am I missing something as usual

There's a hardware limitation: Pin 3 can only output the inverse of pin 4, pin 4 is the 'true' signal.
« Last Edit: February 20, 2013, 08:35:16 am by fungus » Logged

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Brisbane, Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 1123
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks Geoff,  But I have a question. The diagram http://www.akafugu.jp/images/microcontroller-reference-sheet.png it show PIN 3 as PWM.  am I missing something as usual
There's a hardware limitation: Pin 3 can only output the inverse of pin 4, pin 4 is the 'true' signal.
While that's strictly true for the datasheet, in reply #38 of this thread on ATTiny85 and PWM Coding Badly explained that the inverted PWM output can't be used by the Arduino cores for ATTiny.  My own testing confirms this gotcha - that D3 is not able to use hardware PWM with the arduino-tiny core.  Software PWM like the tone() function works fine on all 5 of the standard ATTiny85 IO pins though, so there's an easy way around this limitation if you must use that leg.

Cheers ! Geoff


Logged

"There is no problem so bad you can't make it worse"
- retired astronaut Chris Hadfield

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 150
Posts: 5666
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have one last issue,  When I run it with out transistors on the Arduino it works smooth. But when I use 3, PNP transistors it works fine up until the Green to Blue transition. It almost dims out completely then flicker to blue.

You know the PWM is working so it has to be a power supply problem. You probably need some decoupling. Add ceramic capacitors between ground and 5V next to the transistors (as close as you can), see if that helps.
Logged

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 150
Posts: 5666
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There's a hardware limitation: Pin 3 can only output the inverse of pin 4, pin 4 is the 'true' signal.
While that's strictly true for the datasheet, in reply #38 of this thread on ATTiny85 and PWM Coding Badly explained that the inverted PWM output can't be used by the Arduino cores for ATTiny.  My own testing confirms this gotcha - that D3 is not able to use hardware PWM with the arduino-tiny core.  Software PWM like the tone() function works fine on all 5 of the standard ATTiny85 IO pins though, so there's an easy way around this limitation if you must use that leg.

I don't know how the cores use the timers. I know that using hardware PWM on D3 and D4 at the same time wouldn't work for analogueWrite() functions.
Logged

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Offline Offline
Full Member
***
Karma: 1
Posts: 209
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have one last issue,  When I run it with out transistors on the Arduino it works smooth. But when I use 3, PNP transistors it works fine up until the Green to Blue transition. It almost dims out completely then flicker to blue.

You know the PWM is working so it has to be a power supply problem. You probably need some decoupling. Add ceramic capacitors between ground and 5V next to the transistors (as close as you can), see if that helps.


Thanks I will give that a try when I get home tonight.  But so I am clear. I need to put a Cap  from a Ground pin on the Arduino to the emitter on the PNP // Or is it from the Ground real to the 5v real.  

And what size Cap..    ( Way to much to learn, I am glad it is fun).

Thanks
« Last Edit: February 20, 2013, 01:21:49 pm by kculm » Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 150
Posts: 5666
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks I will give that a try when I get home tonight.  But so I am clear. I need to put a Cap  from a Ground pin on the Arduino to the emitter on the PNP // Or is it from the Ground real to the 5v real.  

Between ground (any ground) and the 5V power line as close to the PNP as possible (touching it is good).

And what size Cap..    ( Way to much to learn, I am glad it is fun).

0.1 ... 0.22 uF, that sort of size, but only ceramic type.
Logged

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Offline Offline
Full Member
***
Karma: 1
Posts: 209
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks I will give that a try when I get home tonight.  But so I am clear. I need to put a Cap  from a Ground pin on the Arduino to the emitter on the PNP // Or is it from the Ground real to the 5v real.  

Between ground (any ground) and the 5V power line as close to the PNP as possible (touching it is good).

And what size Cap..    ( Way to much to learn, I am glad it is fun).

0.1 ... 0.22 uF, that sort of size, but only ceramic type.


I am using 3 transistors, so I am thinking one for each?

Also I cant thank you guys enough, I am learning so much.
Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 150
Posts: 5666
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am using 3 transistors, so I am thinking one for each?

At least! smiley
Logged

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Offline Offline
Full Member
***
Karma: 1
Posts: 209
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am using 3 transistors, so I am thinking one for each?

At least! smiley


Did not help,

it works fine with out transistors. not as bright. and it only jacks up on the full blue to full green and full green to full blue.
Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 150
Posts: 5666
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

it works fine with out transistors. not as bright.

Has to be a power problem...how many mA are you using, how many are available.

and it only jacks up on the full blue to full green and full green to full blue.

ie. At maximum current.
Logged

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Offline Offline
Full Member
***
Karma: 1
Posts: 209
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

it works fine with out transistors. not as bright.

Has to be a power problem...how many mA are you using, how many are available.

and it only jacks up on the full blue to full green and full green to full blue.

ie. At maximum current.


Right now I am testing it on an Arduino uno.   

This is what I get.  With out transistors it works fine. With Transistors is when I get the bule to green, green to blue issues.

If I use an at85 with out Transistors Is all jacked up, but with transistors I have the same issue as with Using the Arduino.   

I have found another sketch but its not as nice, and I hate to just give up.
Logged

Offline Offline
Full Member
***
Karma: 1
Posts: 209
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The green fades almost to nothing and the blue jumps on,  if that helps any
Logged

Pages: 1 [2] 3 4 5   Go Up
Jump to: