Page 1 of 1

pwm ATTiny 85

Posted: Tue Feb 01, 2011 8:57 pm
by goblin
hello Lads,
it seems i have an issue with using a PWM on a Tiny 45/85.
i think the main problem is an undeclared TCCR1A and B. see below.

\test ref.c: In function 'FCD_PWM0_Enable':
\MYFLOW~1\test ref.c:344: error: 'TCCR1B' undeclared (first use in this function)
\MYFLOW~1\test ref.c:344: error: (Each undeclared identifier is reported only once
\MYFLOW~1\test ref.c:344: error: for each function it appears in.)
\MYFLOW~1\test ref.c:353: error: 'TCCR1A' undeclared (first use in this function)
\MYFLOW~1\test ref.c: In function 'FCD_PWM0_Disable':
\MYFLOW~1\test ref.c:393: error: 'TCCR1A' undeclared (first use in this function)
\MYFLOW~1\test ref.c: In function 'FCD_PWM0_ChangePeriod':
\MYFLOW~1\test ref.c:450: error: 'TCCR1B' undeclared (first use in this function)


i don't have it with the ATTiny26.
i have checked the two FCD files and although the [TMR0] part should be the same for all chips, they aren't.
help would be very welcom

thanks

Re: pwm ATTiny 85

Posted: Wed Feb 02, 2011 1:54 pm
by Sean
Hello.

This is one of the problems that has been addressed in the V4 upgrade to Flowcode for AVR.

In the case of the PWM component the changes seem to be backward compatible, so the V4 file is attached (re-named to comply with the V3 naming convention).
PWM_Code.c
(10.03 KiB) Downloaded 639 times
This file should be copied into the components folder of your Flowcode for AVR installation. It is recommended that you backup the original file before overwriting it.

Only 1 PWM channel is declared for the ATTINYx5 family because the second channel is multiplexed with a crystal pin.

Re: pwm ATTiny 85

Posted: Wed Feb 02, 2011 3:38 pm
by goblin
it works, Thanks