Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arduino DUE ARM Platform #13

Open
DanieGieb opened this issue Jun 18, 2016 · 13 comments
Open

Arduino DUE ARM Platform #13

DanieGieb opened this issue Jun 18, 2016 · 13 comments

Comments

@DanieGieb
Copy link

DanieGieb commented Jun 18, 2016

Hello,

i tried to compile the clickEncoder Lib for Arduino DUE Arm Board.
Unfortunatelly, i get some compile errors.

This is the log:
`C:\Users\Daniel\Documents\Arduino\libraries\encoder-master/ClickEncoder.h:18:20: fatal error: avr/io.h: No such file or directory

#include <avr/io.h> `

Is there any sollution for this? I think avr.io is the wrong define for the registers of the DUE?

Thank you!
Regards Danie

@soligen2010
Copy link

You could try simply removing the AVR includes. This is what I did for the ESP8266 and it works. You can get my fork to see the #IF to remove the includes for the ESP. If you get a new #IF worked out that works for DUE as well, you can submit a pull request to my fork - this original fork isn't being maintained.

I also recommend to switch to my fork as I have fixed a number of bugs.

@soligen2010
Copy link

I fixed the conditional in the soligen2010 fork for the AVR includes but it it failed with other errors (sei() and cli() not defined) so there are obviously other issues. I have never used a Due, so I cant really do any more. If you get it figured out, please submit pull requests to the soligen2010 fork.

@soligen2010
Copy link

The soligen2010 fork now compiles on the Due. I don't have a Due so I cant test it, but I think it will work.

@DanieGieb
Copy link
Author

DanieGieb commented Jun 25, 2016

Hello,

I have tried it. But unfortunatelly, i get an Compile Error!
exit status 1 'class TimerOne' has no member named 'initialize'

After installing the "TimerDue" libary from here: https://github.com/ivanseidel/DueTimer
and change line 48 to 49 from:

Timer1.initialize(1000); Timer1.attachInterrupt(timerIsr);

to:

Timer1.attachInterrupt(timerIsr).start(1000);

it compiles without any errors!

I uploaded the code to the Due.
All works perfect!

Maybe this should be written in the example sketch or included with #ifndef automaticly?

Thank you for your support!
Regards Daniel

@soligen2010
Copy link

I would be happy to accept a pull request for an update to the example. Also as a note, the ESP8266 example compiles for the Due - it works without a timer and works fine as long as the loop() function is not too slow.

@Doc1012
Copy link

Doc1012 commented Apr 27, 2017

I also tried to work with ClickEncoder on the DUE. It worked perfect on the Mega.
With the DUE I get an error when compiling:

(x86)\Arduino\libraries\encoder-master/ClickEncoder.h:52:11: error: 'WiringPinMode' does not name a type typedef WiringPinMode pinMode_t; ^

I found this in the ClickEncoder.h:

#if defined(__arm__) typedef WiringPinMode pinMode_t; #else typedef uint8_t pinMode_t; #endif

It seems, that the WiringPinMode is somhow missing?

What can I do?

edit:
I also get the error when I try the ESP8266Example. So. It has nothing to do with the Interrupts.

@soligen2010
Copy link

What I think is happening is that the STM23duino and Due are both arm chips, but need different typedefs. This line was added to support STM32duino, but must have broke the Due becasue it needs the second typedef. What we need is another conditional compile #if specifically for the Due. If you can find out what the pre-compiler variable is for the Due, should be easy to change the #if.

@Doc1012
Copy link

Doc1012 commented Apr 28, 2017

After a Little Research I found:

For all Arduino Due compatible boards:
#if defined (__arm__) && defined (__SAM3X8E__) // Arduino Due compatible // your Arduino Due compatible code here #endif

(found in file sam3.h. More info there.)

If you just want to define Due (by leaving out compatible boards):

#if defined (_VARIANT_ARDUINO_DUE_X_) // your Arduino Due code here #endif

(It's defined in variant.h file of Arduino Due)

I hope, this is what you wanted.

@soligen2010
Copy link

just uploaded a fix. Please try it out

@Doc1012
Copy link

Doc1012 commented Apr 29, 2017

Sorry for that stupid question:

I can't find a new/updated file. Where is it?

@soligen2010
Copy link

Its the soligen2010 fork. I was assuming that is what you are using. As 0xpit doesn't pay much attention to this library, there is no way to update the original

@Doc1012
Copy link

Doc1012 commented May 1, 2017

Now it's clear....

It works! Your trick did the job. Thank you!

@HFATL
Copy link

HFATL commented Oct 6, 2018

Hello,

I'm also getting: 'class TimerOne' has no member named 'initialize'
I need timer interrupts on my ESP8266.

Please help.

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants