Pages: [1]   Go Down
Author Topic: Leonardo problem: DigitalWrite on pin A1 turn off PWM on pin 10  (Read 370 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Sr. Member
****
Karma: 8
Posts: 293
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, i'm writing this because i've found a little bug-problem using "leonardo" board with
ide 1.0.2 (win... linux isn't tested).

this is the code that does "fireworks" :
Code:
void setup() {
  // put your setup code here, to run once:
pinMode(A1,OUTPUT);
pinMode(10,OUTPUT);

}

void loop() {
  // put your main code here, to run repeatedly:
analogWrite(10,128);
//*************digitalWrite(10,HIGH);
delay(2000);
digitalWrite(A1,0);

delay(1000);

 
}


In 2 words i write an analog pwm value on pin 10 that, as normal, go up to 2,5Volts (255/2=128=2,5Volt) but when i write with digitalWrite on pin A1 (...on leonardo is 19D) pin 10 go down to 0Volt without explanations.... it will return up with the next loop.

If i use digitalWrite on pin 10 instead of analogWrite pin 10 stay normally up at 5Volt.
It seems that digitalWrite on pin A1 deactive pwm generation on pin 10.
Also i tested this phenomena setting pwm on pin 10 by manipulations of registries (timer1) but IMHO the problem is on digitalWrite instruction.

This problem is resolved (another thanks to guys of Italian section) by installing the last version of toolchain from Atmel over 1.0.2 standard IDE.... so it is a combination of 3 factor:
-Leonardo board
-analogWrite on 10 and digitalWrite on 19/A1
-original IDE 1.0.2.

Hoping that this info can be helpfull for something other,
Roberto.
Logged

Pages: [1]   Go Up
Jump to: