Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

3rd TImer

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

Bascom Member



Joined: 09 Dec 2014
Posts: 1

PostPosted: Tue Dec 09, 2014 6:38 pm    Post subject: 3rd TImer Reply with quote

From here : http://avrhelp.mcselec.com/index.html?config_timer1.htm
Code:
$regfile = "8515def.dat"                                   ' specify the used micro
$crystal = 4000000                                         ' used crystal frequency
$baud = 19200                                               ' use baud rate
$hwstack = 32                                               ' default use 32 for the hardware stack
$swstack = 10                                               ' default use 10 for the SW stack
$framesize = 40                                             ' default use 40 for the frame space

Config Timer1 = Pwm , Pwm = 8 , Compare_A_Pwm = Clear_Up , Compare_B_Pwm = Clear_Down , Prescale = 1
 
'to set the PWM registers, just assign a value to the compare A and B registers
Compare1a = 100
Compare1b = 200
 
'Or for better reading :
Pwm1a = 100
Pwm1b = 200
End

I have connected my two motors to first and second ports. By using Pwm1a and Pwm1b I am able to control the speed of those two motors. How do I control the speed of the third motor ? Please help.
Back to top
View user's profile
Tiny

Bascom Member



Joined: 10 Nov 2010
Posts: 89
Location: The Netherlands

netherlands.gif
PostPosted: Tue Dec 09, 2014 10:55 pm    Post subject: Reply with quote

Dear eaters,

Use timer0 to control the third pwm channel, portb.0 (oc0)

Kind regards, Tiny
Back to top
View user's profile Visit poster's website
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