Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Atmega1284 and PWM

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR
View previous topic :: View next topic  
Author Message
maxneo

Bascom Member



Joined: 07 Sep 2010
Posts: 35

PostPosted: Tue Jan 27, 2015 11:02 am    Post subject: Atmega1284 and PWM Reply with quote

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
View user's profile
i.dobson

Bascom Expert



Joined: 05 Jan 2006
Posts: 1534
Location: Basel, Switzerland

switzerland.gif
PostPosted: Tue Jan 27, 2015 11:23 am    Post subject: Reply with quote

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

_________________
Home of AVRTimer, the Bascom timer value calculator.
http://www.planet-ian.com

Walking on water and writing software to specification is easy if they're frozen.
Back to top
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 4970
Location: Holland

blank.gif
PostPosted: Tue Jan 27, 2015 11:26 am    Post subject: Reply with quote

all timers have just 2 outputs.
_________________
Mark
Back to top
View user's profile Visit poster's website
maxneo

Bascom Member



Joined: 07 Sep 2010
Posts: 35

PostPosted: Tue Jan 27, 2015 11:44 am    Post subject: Reply with quote

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
View user's profile
Tubeampman

Bascom Member



Joined: 27 Feb 2006
Posts: 95
Location: Bodo

norway.gif
PostPosted: Tue Jan 27, 2015 1:35 pm    Post subject: Reply with quote

Hi

This helped me to use timer3.


http://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&t=12180&highlight=

Řyvind
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum