pwm ATTiny 85

Forum for problems or queries regarding other Flowcode Components. Eg LEDs, Switches, LCD, Gfx LCD etc

Moderators: Benj, Mods

goblin
Posts: 10
Joined: Tue Aug 11, 2009 7:47 pm
Contact:

pwm ATTiny 85

Postby goblin » Tue Feb 01, 2011 8:57 pm

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

Sean
Valued Contributor
Valued Contributor
Posts: 548
Joined: Tue Jun 26, 2007 11:23 am
Has thanked: 6 times
Been thanked: 44 times
Contact:

Re: pwm ATTiny 85

Postby Sean » Wed Feb 02, 2011 1:54 pm

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.52 KiB) Downloaded 412 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.

goblin
Posts: 10
Joined: Tue Aug 11, 2009 7:47 pm
Contact:

Re: pwm ATTiny 85

Postby goblin » Wed Feb 02, 2011 3:38 pm

it works, Thanks