Page 1 of 1

Flowcode 6 problem with a pwm loop (ATMEGA8)

Posted: Fri Sep 12, 2014 3:19 pm
by jecaron
Hi,

I work with the trial version of flowcode since 2 weeks. I like it but I have a program using PWM that dont work properly. The program is a simple DO RE MI FA SOL LA SI DO using PWM on a speaker with 500 ms between each note and running in loop.

After 3 or 4 loop some note dont play and the PWM signal just dissapear and come back to play 3 or 4 loop correctly.

Why ?

Thanks !

SC.

Re: Flowcode 6 problem with a pwm loop (ATMEGA8)

Posted: Fri Sep 12, 2014 3:57 pm
by jecaron
The program skip 2-3 notes on 5 loops. It seem the PWM dont work for those notes (that dont work).

Thanks !

Re: Flowcode 6 problem with a pwm loop (ATMEGA8)

Posted: Tue Sep 16, 2014 3:15 pm
by Benj
Hello,

Your forum topic specifies a ATMEGA8 but your attached program is setup for a 16F877A.

Also the program seems unrelated to what you are saying regards to the loop.

Can you attach the program that is giving you the difficulties and we will investigate for you.

Re: Flowcode 6 problem with a pwm loop (ATMEGA8)

Posted: Tue Sep 16, 2014 5:06 pm
by Benj
Thanks for your program via email,

Just tested the PWMmusic file using an Arduino Mega and it's working as expected. Not sure why an ATMEGA8 would have a problem but we don't have one here to replicate your setup exactly. I will have a look for an ATMEGA32 and re-test on this.

Could your chip maybe be browning out (VCC voltage drop) maybe caused by the speaker load? This might explain the intermittent issues your seeing?

5V divides across 8 Ohms is a current draw of 0.625A which the chip isn't going to be able to produce and potentially causing a brownout. Could you attach a schematic of your setup so we can see how your electronics are laid out? I would suggest driving the speaker via a transistor if your not already doing this.