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.
Flowcode 6 problem with a pwm loop (ATMEGA8)
Moderator: Benj
Flowcode 6 problem with a pwm loop (ATMEGA8)
- Attachments
-
- PWMDemo.fcfx
- (5.72 KiB) Downloaded 222 times
Re: Flowcode 6 problem with a pwm loop (ATMEGA8)
The program skip 2-3 notes on 5 loops. It seem the PWM dont work for those notes (that dont work).
Thanks !
Thanks !
- 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)
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- 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)
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel