Timer Tut compile Error

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

Hi , I copied and pasted the part 1 code in this tutorial and it gives me this compile error :

"D:/Program Files/utils/bin/sh.exe": -c: line 1: unexpected EOF while looking for matching ``'

"D:/Program Files/utils/bin/sh.exe": -c: line 2: syntax error: unexpected end of file
make: *** [Timer`.o] Error 258

I am a newbie , Any Help ?

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

Post the correct bit you used.

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

What do you mean by correct bit ?
I just tried to compile this code :

#include 

int main (void)
{
   DDRB |= (1 << 0); // Set LED as output

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

   for (;;)
   {
      // Check timer value in if statement, true when count matches 1/20 of a second
      if (TCNT1 >= 49999)
      {
         PORTB ^= (1 << 0); // Toggle the LED

         TCNT1 = 0; // Reset timer value
      }
   }
} 

I am using AVR GCC , AVR studio v4.15 and trying to simulate ATMEL AVR16

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

I just tried it and it compiles perfectly for a Mega16 and a Tiny2313, so you must a different version.

That's the reason I asked.

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

So I must update my program ? The tutorial was written in 2007 .

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

I'm just using Studio 4.18 with WinAVR-20100110.

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

iA7med wrote:
make: *** [Timer`.o] Error 258

Remove the backtick (`) from the filename.

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

Success :D . I mistyped the "'" , When I made a new project without the "'" It Worked .

Thank you Both .