View previous topic :: View next topic |
Author |
Message |
MHz
Joined: 28 Sep 2007 Posts: 123
|
Posted: Wed Aug 04, 2010 5:52 pm Post subject: ATtiny861 Timer1 in PWM-Mode |
|
|
while :
Config Timer0 = Pwm , ... is ok
Config Timer1 = Pwm , Pwm = 8 , Prescale = 8 , Compare B Pwm = Clear Down , Compare A Pwm = Clear Down
results in Error message: unknown Config parameter[PWM]
also
Pwm1a = 255 : Pwm1b = 255
produces error message:Assignment error
So what's wrong with Timer1?
Thanks for any hint |
|
Back to top |
|
|
bzijlstra
Joined: 30 Dec 2004 Posts: 1179 Location: Tilburg - Netherlands
|
Posted: Thu Aug 05, 2010 9:56 am Post subject: Processor? |
|
|
Tried the lines here with several processors. No error. What processor are you using. |
|
Back to top |
|
|
Evert :-)
Joined: 18 Feb 2005 Posts: 2156
|
Posted: Thu Aug 05, 2010 10:29 am Post subject: |
|
|
Hi Ben,
Still holiday?
Mhz uses ATtiny861, it's in the subject header.
Tried it with 11198 and 11200, both give the same error as Mhz describes. _________________ www.evertdekker.com Bascom code vault |
|
Back to top |
|
|
Evert :-)
Joined: 18 Feb 2005 Posts: 2156
|
Posted: Thu Aug 05, 2010 10:44 am Post subject: |
|
|
Tiny861 doesn't have 8bit pwm, remove Pwm = 8 from the config line will compile fine. _________________ www.evertdekker.com Bascom code vault |
|
Back to top |
|
|
MHz
Joined: 28 Sep 2007 Posts: 123
|
Posted: Thu Aug 05, 2010 2:12 pm Post subject: ATtiny861 Timer1 in PWM-Mode |
|
|
Datasheet reads:
- 8/16 bit Timer/counter with prescaler and 2 PWM channels
- 8/10 bit High Speed ... with3 high freq. PWM outputs
anyway, have someone managed to setup and use the 3 PWM channels of timer counter 1?
Any code snipplets are highly welcomed
- MHz |
|
Back to top |
|
|
RON1406
Joined: 17 Feb 2005 Posts: 15 Location: Opwijk
|
Posted: Mon Apr 14, 2014 4:23 pm Post subject: Re: ATtiny861 Timer1 in PWM-Mode |
|
|
MHz wrote: | Datasheet reads:
- 8/16 bit Timer/counter with prescaler and 2 PWM channels
- 8/10 bit High Speed ... with3 high freq. PWM outputs
anyway, have someone managed to setup and use the 3 PWM channels of timer counter 1?
Any code snipplets are highly welcomed
- MHz |
.... So many years later and I'm having problems too with PWM on the OC1D pin for a Tiny861. 'Mhz', did you get a sollution of your problem? Maybe some code can help me here too then?
Thanks already,
Ron, |
|
Back to top |
|
|
O-Family
Joined: 23 May 2010 Posts: 320 Location: Japan
|
|
Back to top |
|
|
MHz
Joined: 28 Sep 2007 Posts: 123
|
Posted: Tue Apr 15, 2014 7:56 am Post subject: Re: ATtiny861 Timer1 in PWM-Mode |
|
|
[quote="RON1406"
.... So many years later and I'm having problems too with PWM on the OC1D pin for a Tiny861. 'Mhz', did you get a sollution of your problem? Maybe some code can help me here too then?
Ron,[/quote]
Hi Ron,
so many years later my memory gets weak ... I scanned my BASCOM directory and found some code but did not remember what it really was good for
I attach the shortes program containig "$regfile = "ATtiny861.dat" " hope that helps. There are more programs in this specific dir I can send to you (private, for driving RGB LEDs but don't remember if they really work - therefore the private)
Have fun
- MHz |
|
Back to top |
|
|
RON1406
Joined: 17 Feb 2005 Posts: 15 Location: Opwijk
|
Posted: Thu Apr 17, 2014 7:57 am Post subject: Re: ATtiny861 Timer1 in PWM-Mode |
|
|
Hello Mhz,
Thanks for the code you added. It helped me a lot and now I finally get activity on OC1D. I can change period time too now and pulse width, everything I need. Many thanks for the help and have a nice day,
Ron, |
|
Back to top |
|
|
|