Flowcode 6 problem with a pwm loop (ATMEGA8)

A forums to allow bugs and problems with Flowcode v6 to be reported and resolved.

Moderator: Benj

Post Reply
jecaron
Posts: 2
Joined: Fri Sep 12, 2014 3:15 pm
Contact:

Flowcode 6 problem with a pwm loop (ATMEGA8)

Post 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.
Attachments
PWMDemo.fcfx
(5.72 KiB) Downloaded 222 times

jecaron
Posts: 2
Joined: Fri Sep 12, 2014 3:15 pm
Contact:

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

Post by jecaron »

The program skip 2-3 notes on 5 loops. It seem the PWM dont work for those notes (that dont work).

Thanks !

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

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

Post 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.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

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

Post 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.

Post Reply