Page 1 of 1

PWM FLOWCODE 6.1 AVR DISPLAY ERROR

Posted: Sat Nov 15, 2014 12:53 am
by coffy
hi,
display error PWM Avr ATMEGA 324P: 20 000 000 Hz clk/8 period register n=255
You forgot to divide by 2 the frequency

reading the file avr_cal_pwm.c, you choose the mode:
Phase and Frequency Correct PWM Mode
fOCnxPFCPWM = fclk_I/O/(2 ⋅ N ⋅ TOP)

F = 4.88 kHz
Period = 204.8 microseconds
can you change the display,the macro works very well.

actual measurement f = 4.88 kHz :
http://tsin.langevin-la-seyne.fr/SIN/attelle.html
thank you
BRUNO

Re: PWM FLOWCODE 6.1 AVR DISPLAY ERROR

Posted: Mon Nov 17, 2014 1:35 pm
by Benj
Hello Bruno,

Thanks for the bug spot, I have had a go at fixing the bug and it seems to be working correctly.
cal_pwm.fcpx
(7.21 KiB) Downloaded 300 times
The file needs to be placed here before starting Flowcode "C:\Program Files (x86)\Flowcode 6\components".

Let me know how you get on.

Re: PWM FLOWCODE 6.1 AVR DISPLAY ERROR

Posted: Mon Nov 17, 2014 2:03 pm
by coffy
hi,
I tested
thank you, it works very well :D :D
bruno