Faulty pwm output on Arduin Micro

Hello, I have mapped a pwm output to pin 13, it's the pin on the edge near the 3.3V pin, and used analogwrite on that pin. The problem is that when i power on my micro the output it's active and it's generating a signal with pauses, it's +5V for 1 sec, 2 sec 0V and again +5V and so on. The wierd part is that this output is active right after I put power on the board, I know that there is a boot time when the green led flashes and after it turns off the program runs, but in this case, it's doing this thing when power is applied not waiting for boot, also analogwrite dosen't seem to effect the output after boot up, it's still doing the same thing. Can anyone help me with this?

Thanks.

Try reading the reference for analogWrite. http://arduino.cc/en/Reference/AnalogWrite

This is also useful http://forum.arduino.cc/index.php?topic=148850.0

I've read the reference for analogwrite, and it seems pin 13 it's not on the list for atmega328, but my question remains, why is the output acting strange like I described? And if the board can't use pwm on pin 13, why is it listed as PWM in the pinout diagram which i download from arduino website ? It's kind of confusing...

inginerul: I've read the reference for analogwrite, and it seems pin 13 it's not on the list for atmega328, but my question remains, why is the output acting strange like I described? And if the board can't use pwm on pin 13, why is it listed as PWM in the pinout diagram which i download from arduino website ? It's kind of confusing...

Which pinout diagram are you referring to, there are more then one. A specific link would be helpful. Pin 13 does not have PWM capablities on a 328P based board, but is on a 2560/1280 mega based board.

Lefty

but my question remains

It'll probably stay that way too, until you post more details.

retrolefty:

inginerul: I've read the reference for analogwrite, and it seems pin 13 it's not on the list for atmega328, but my question remains, why is the output acting strange like I described? And if the board can't use pwm on pin 13, why is it listed as PWM in the pinout diagram which i download from arduino website ? It's kind of confusing...

Which pinout diagram are you referring to, there are more then one. A specific link would be helpful. Pin 13 does not have PWM capablities on a 328P based board, but is on a 2560/1280 mega based board.

Lefty

http://arduino.cc/en/uploads/Main/ArduinoMicro_Pinout.png

inginerul:

retrolefty:

inginerul: I've read the reference for analogwrite, and it seems pin 13 it's not on the list for atmega328, but my question remains, why is the output acting strange like I described? And if the board can't use pwm on pin 13, why is it listed as PWM in the pinout diagram which i download from arduino website ? It's kind of confusing...

Which pinout diagram are you referring to, there are more then one. A specific link would be helpful. Pin 13 does not have PWM capablities on a 328P based board, but is on a 2560/1280 mega based board.

Lefty

http://arduino.cc/en/uploads/Main/ArduinoMicro_Pinout.png

Ah, you assumed a Arduino Micro board uses a 328P chip where in fact it uses a ATmega32u4. which has different pin mapping and pin capabilities. Details count. http://arduino.cc/en/Main/ArduinoBoardMicro Lefty

retrolefty:

inginerul:

retrolefty:

inginerul: I've read the reference for analogwrite, and it seems pin 13 it's not on the list for atmega328, but my question remains, why is the output acting strange like I described? And if the board can't use pwm on pin 13, why is it listed as PWM in the pinout diagram which i download from arduino website ? It's kind of confusing...

Which pinout diagram are you referring to, there are more then one. A specific link would be helpful. Pin 13 does not have PWM capablities on a 328P based board, but is on a 2560/1280 mega based board.

Lefty

http://arduino.cc/en/uploads/Main/ArduinoMicro_Pinout.png

Ah, you assumed a Arduino Micro board uses a 328P chip where in fact it uses a ATmega32u4. which has different pin mapping and pin capabilities. Details count. http://arduino.cc/en/Main/ArduinoBoardMicro Lefty

I didn't recived any reference when I baught the board, so I took for granted the pinout diagram from the site... If you can provide me with the correct one I'll be thankful.

inginerul: If you can provide me with the correct one I'll be thankful.

The links already were? In the post you quoted and the one before it.