Analog out on D13

A shrunk down Leonardo-compatible board, thumb drive sized with native USB support. [Product info]
Post Reply
jef79m
Posts: 2
Joined: Thu Jun 28, 2012 1:40 am

Analog out on D13

Post by jef79m » Thu Jun 28, 2012 1:44 am

Hi,
I'm having trouble with the RGB Led on board.

I can set the brightness for the green and blue LEDs but the red one only goes full on or off.

If I load the fading example and point it to D13 I just get a small red blip when the value hits full brightness.
The red LED pulses correctly when i reset the stick, so I guess its not hardware related.
Any ideas what I should check first?

sudo
Posts: 6
Joined: Tue Mar 06, 2012 5:51 am

Re: Analog out on D13

Post by sudo » Mon Jul 02, 2012 3:58 pm

Hi,

Be aware that the red led is on D13 (PC7) which is not PWM capable.
(The D9 (green led) and D10 (blue) are).

I'm almost certain the "fading example" (never used it myself) uses PWM.

Hope that helps.
Q.

bwooce
Posts: 21
Joined: Mon May 28, 2012 11:15 am

Re: Analog out on D13

Post by bwooce » Wed Jul 25, 2012 11:07 am

sudo wrote: Be aware that the red led is on D13 (PC7) which is not PWM capable.
(The D9 (green led) and D10 (blue) are).
That's true, but it doesn't explain how the startup/boot sketch manages to do it... the red definitely fades in and out while the main sketch loads. But how can that be if D13 is not PWM capable?

mikefox
Posts: 9
Joined: Fri Jun 22, 2012 7:02 am
Location: Darwin, Australia

Re: Analog out on D13

Post by mikefox » Sun Jul 29, 2012 2:49 am

Hey guys,

I'm running adr1an's v2 firmware and arduino 1.0.1 and I can confirm that D13 DOES have PWM. This makes sense as the official leonardo documentation shows PWM on D13.

I don't know if the updated firmware is the key, but you can get it here if you want to try yourself: viewtopic.php?f=27&t=663

Hope this helps.

Mike

garyaj
Posts: 4
Joined: Fri Aug 31, 2012 1:29 am

Re: Analog out on D13

Post by garyaj » Sun Sep 02, 2012 4:00 am

I also can confirm that D13 has PWM on it. The ATmega32u4 chip has 6 PWM outputs and they are connected to D5, D6, D9, D10, D11 and D13 so the LeoStick has had PWM on D13 from the start.

I stuck a Logic Sniffer onto D0..D15 and used the analogWrite function to put the above mentioned pins into PWM mode. This screenshot shows the pins toggling in PWM mode.

sleat
Posts: 5
Joined: Thu Dec 20, 2012 7:49 am

Re: Analog out on D13

Post by sleat » Sat Dec 22, 2012 10:53 am

I certainly believe it works with adr1an's downloads, but I'm not sure I understand how the LeoStick bootloader can affect the behaviour of the analogWrite C function located in cores\arduino\wiring_analog.c

Can anyone elaborate? And also can anyone explain exactly how to use those two downloads without rebuilding anything?

Cheers,
Joe

Post Reply