Author Topic: member tutorials error - PWM  (Read 1214 times)

0 Members and 1 Guest are viewing this topic.

Offline fiflak666Topic starter

  • Jr. Member
  • **
  • Posts: 22
  • Helpful? 0
  • My native language isn't english :P
member tutorials error - PWM
« on: March 03, 2009, 01:41:38 PM »
http://www.societyofrobots.com/member_tutorials/node/231

this tutorial is very useful but I found an error

at the page that I linked above there is something like this:

Code: [Select]
TCCR1B = (1 << WGM13) | (1<<WGM12) | (1<<WGM11) | (1 << CS10);
but TCCR1B register doesnt have WGM11 flag

it sholud like like this:

Code: [Select]
TCCR1B = (1 << WGM13) | (1<<WGM12) | (1 << CS10);
TCCR1A = (1 << COM1A1) | (1 << COM1B1) | (1 << WGM11);

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,072
  • Helpful? 107
Re: member tutorials error - PWM
« Reply #1 on: March 04, 2009, 07:19:44 PM »
Hi.

I wrote the tutorial so thanks for spotting any errors.

PWM and Timers are rather unportable from one controller/Timer to another - with different bits in different registers etc. So rather complex.

Can you let me know which processor you are using, and which Timer you are using - then I can update it.

Thanks in anticaption.

Webbot
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline TrickyNekro

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,207
  • Helpful? 15
  • 1.6L Peugeot 307 tuner
Re: member tutorials error - PWM
« Reply #2 on: March 04, 2009, 09:13:31 PM »
I think he is right........
TCCR1B only has WGM12 and WGM13....
At least the ATMEGA32 and ATMEGA8 you have in the tutorial are by this....
For whom the interrupts toll...


P.S. I've been inactive for almost a year... Don't give promises but I'll try to complete my tutorials. I'll let you know when..

Cheers!

 

Related Topics

  Subject / Started by Replies Last post
6 Replies
2499 Views
Last post March 02, 2008, 03:36:28 PM
by Admin
14 Replies
2995 Views
Last post June 07, 2010, 11:34:40 PM
by voyager2
2 Replies
956 Views
Last post September 15, 2009, 07:59:57 PM
by smartie_on_computer
3 Replies
888 Views
Last post April 14, 2010, 07:35:52 AM
by Pratheek


Get Your Ad Here