error while using tutorial Newbie guide using avr timers

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hello,

sorry for the double post, but i think that they find the post easier here then in the tutorial section.

am i the only one who gets a error on this sentence code :

TCCR1B |= (1 << CS10); // Set up timer 

i get undefind symbol CS10, do i have to include someting to get it work?

thanks, Robbin

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What C compiler, what AVR?

(I'm guessing this maybe CV where the register names are defined as standard but the bit names aren't)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

i use the STK500 with codeVisionAVR as compiler

you guessed right ^^, do you know how i can make it work ?

robbin

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OK then my guess was right. As I say, the .h files that ship with CV have the register names (TCCR1B etc.) defined but they do not have all the individual bit names (CS10 etc.) defined.

The suggested solution is that in your installation of Atmel's AVR Studio you should find an xmlconvert.exe program which will take the .XML files in the Partdescriptionfiles sub-directory and generate .h files from them that can be used with CV.

Or you could "nick" the relevant .h from an installation of GCC

Or you could just #define those bit names you actually want to use

Or you could hard code the bit mask

Or (and I guess this is what the CV authors intended) you could run the code generation wizard to get the timer register settings (which it does by just hard coding bit masks though this is quite unreadable and relies on the nearby comment to document what the settings actually are)

Cliff