AVRStudio5 ISR Interrupt (GCC)

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

Hi guys,
I am trying to migrate to AvrStudio5... but it is not simple and not so many examples, so I know I have to come to you.
I used the following code in avrstudio4 + winavr, but now not valid anymore.
Could you please help with the new statement to utilize?
Thanks

// USART interrupt call
ISR(USARTD0_RXC_vect){
...
}

// Pin interrupt call
ISR(PORTD_INT0_vect){
...
}

// Timer interrupt call
ISR(TCF0_OVF_vect){
...
}

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

Quote:

but now not valid anymore.

ny error messages to quote, perhaps?
Which AVR model?

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

Quote:
Which AVR model?
Likely an xmega since those don't look like vector names of any regular mega or tiny.

Regards,
Steve A.

The Board helps those that help themselves.

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

Koshchi wrote:
Quote:
Which AVR model?
Likely an xmega since those don't look like vector names of any regular mega or tiny.

But it is done with that great productivity enhancer, called AVR Studio 5. The code should virtually write itself on its own.

Stealing Proteus doesn't make you an engineer.

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

Quote:
that great productivity enhancer, called AVR Studio 5
That is still in beta.

Regards,
Steve A.

The Board helps those that help themselves.

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

JohanEkdahl wrote:
Quote:

any error messages to quote, perhaps?
Which AVR model?

Yes, it is XMega128A1, and message is:
Quote:

Error 2 expected declaration specifiers before 'ISR' C:\xmega1-avr5\test_xmega1\core.c 111 1 test

And actually (may be beta), there is this other error :shock: :

const uint8_t test_rev[TEST_LEN]="TEST1";

With the following error:

Quote:

Error 1 parameter 'test_rev' is initialized C:\xmega1-avr5\test_xmega1\core.c 35 1 test

Thanks for your help

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

Quote:

Yes, it is XMega128A1, and message is:
Quote:

Error 2 expected declaration specifiers before 'ISR' C:\xmega1-avr5\test_xmega1\core.c 111 1 test


Slowly, slowly, we're making progress here. Could you attach the complete source file to a post here?

Do you get errors on all your ISRs in that file - there seems to be some fundamental problem with ISRs. Did you

#include 

?

Quote:
And actually (may be beta), there is this other error Shocked :
Code:

const uint8_t test_rev[TEST_LEN]="TEST1";

With the following error:
Quote:

Error 1 parameter 'test_rev' is initialized C:\xmega1-avr5\test_xmega1\core.c 35 1 test


You need to show more code for that. E.g. why is the erroe talking about 'parameter'? Are you having a name collision between a parameter and a local variable?

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

Thanks for ur reply,
Actually I had but commented

#include 

Now without comments I have the following errors/warnings for each time ISR is called:

ISR(USARTD0_TXC_vect){

Quote:

Error 1 parameter 'test_rev' is initialized C:\xmega1-avr5\test_xmega1\core.c 35 1 test

Warning 2 'signal' attribute only applies to functions C:\xmega1-avr5\test_xmega1\core.c 111 1 test

Warning 3 'used' attribute ignored C:\xmega1-avr5\test_xmega1\core.c 111 1 test

Warning 4 'externally_visible' attribute ignored C:\xmega1-avr5\test_xmega1\core.c 111 1 test

Error 5 expected '=', ',', ';', 'asm' or '__attribute__' before '{' token C:\xmega1-avr5\test_xmega1\core.c 111 22 test

Note: This code is fully functioning with AVRStudio4!
Thanks for your help

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

Quote:
I have the following errors/warnings for each time ISR is called:
Why are you calling an ISR?

Regards,
Steve A.

The Board helps those that help themselves.

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

Same fw with AVRStudio4 works well with ISR routine (or macros).
Please, let me know what do I need to use with AVRStudio5...
Thanks

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

Again: Show more code. At least the complete ISR.

And Steve's question is quite relevant: Are you explicitly calling ISRs? And furthermore the message you quote hints at you calling them with parameters passed. If so, this makes no sense.

In short: ISRs are not to be called explicitly. ISRs are functions servicing interrupts, i.e. they are called asynchronously by a hardware mechanism. If you need something executed both as a consequence of an interrupt condition and explicitly called by the code then break that something out and call it both from the ISR and from other places where you need it to execute.

This might lead to other problems though. If your interrupt timing is critical then this approach might break it.

A redesign might be necessary. Alas, there is little advice that can be given with the amount of information you have presented. Specifically, there is no clear and simple answer to "what you must do to make it work" unless we get more of the picture.

Lastly: Just because the code worked with a previous version of the compiler, that does not necessarily mean that the current compiler will swallow it whole. As long as the compiler implementers follow the rulings of the language standard (in this case the C language) they are free to change behavior.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

Hey, it's weird!
I simplified the code to post here... same issue.
Then I just cut and paste the c and h file, copied in another folder... compiled before posting... it works!
I re-checked and if I import the prj from avrstudio5 (import project...) compiler mess-up.

Sorry for wasting time, but that is weird...
Thanks

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

Quote:

Then I just cut and paste the c and h file, copied in another folder...

And did you set up a new project "manually" rather than letting the Studio 5 import do it? Or even re-used the imported project, but removed the old original files and added the new files that are in another directory? If so then this is probably a bug/problem in the project import function that you should report to the AS5 team. They will most probably be helped by having your original AS4 project, and possibly the imported AS5 project, attached to the report.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]