View previous topic :: View next topic |
Author |
Message |
maxneo
Joined: 07 Sep 2010 Posts: 35
|
Posted: Tue Jan 27, 2015 11:02 am Post subject: Atmega1284 and PWM |
|
|
I have a problem with Atmega1284 it would not compile when I use Timer3 to PWM. See the code below.
$regfile = "m1284pdef.dat"
$crystal = 8000000
$hwstack = 32
$swstack = 16
$framesize = 40
Config Clockdiv = 1
line 40 Config Timer3 = Pwm , Pwm = 10 , Compare A Pwm = Clear Down , Compare B Pwm = Clear Down , Compare C Pwm = Clear Down , Prescale = 8
chan1 Alias Pwm3a 'PORTE.3
chan2 Alias Pwm3b 'PORTE.4
chan3 Alias Pwm3c 'PORTE.5
When I compile, I get this message
Error : 12 Line : 40 Unknown CONFIG parameter [PIN] , in File : C:\Program Files (x86)\MCS Electronics\BASCOM-AVR\SAMPLES\TestPWM.bas
What am I doing wrong
Sincerely Janne
(BASCOM-AVR version : 2.0.7.8 ) |
|
Back to top |
|
 |
i.dobson
Joined: 05 Jan 2006 Posts: 1571 Location: Basel, Switzerland

|
Posted: Tue Jan 27, 2015 11:23 am Post subject: |
|
|
Hi,
Are you sure that timer 3 has 3 pwm Outputs?
This works:
Code: |
Config Timer3 = Pwm , Pwm = 10 , Compare A Pwm = Clear Down , Compare B Pwm = Clear Down , Prescale = 8
chan1 Alias Pwm3a 'PORTE.3
chan2 Alias Pwm3b 'PORTE.4
|
Regards
Ian Dobson _________________ Walking on water and writing software to specification is easy if they're frozen. |
|
Back to top |
|
 |
albertsm
Joined: 09 Apr 2004 Posts: 6198 Location: Holland

|
Posted: Tue Jan 27, 2015 11:26 am Post subject: |
|
|
all timers have just 2 outputs. _________________ Mark |
|
Back to top |
|
 |
maxneo
Joined: 07 Sep 2010 Posts: 35
|
Posted: Tue Jan 27, 2015 11:44 am Post subject: |
|
|
Thanks on much I got for me that there were 3 pc timer in Atmega1284 thank you got me on the right ulcers.
grateful Janne |
|
Back to top |
|
 |
Tubeampman
Joined: 27 Feb 2006 Posts: 101 Location: Bodo

|
|
Back to top |
|
 |
|