Reputation: 1231
My problem is that Arduino's IDE is not enough for me lately. To briefly explain;
I need to use interrupt when a data is available on serial port. But arduino IDE does not have that ability. It just uses interrupt from pins' state changes. I need it to be driven by not pins but from serial port inside the software.
I have been searching for a long time but no answer on the internet for me.
My question is that is there an IDE to use with Arduino that I can use C++ or .NET or Java to program the microprocessor Atmega328P which arduino uses.
Upvotes: 0
Views: 1703
Reputation: 2819
The Arduino IDE is using a standard C++ compiler. The IDE is a front end for the Win AVR toolchain (see sourceforge) which is using GNU GCC, a standard based C++ compiler.
Yes, you can use other IDEs:
I use Eclipse, and the setup is described here: Arduino guide for Eclipse setup
The setup effort is high and not for a beginner. Getting the libraries compiled and linking to a program will require understanding many details. But once you get over that learning curve, Eclipse will give you a more complete development IDE.
BUT, you will still be using the same C++ compiler.
You can use Atmel Studio. With this also you would once again be using the GNU GCC compiler for C++.
And the antithesis of IDE, you can use plain make files with WinAVR.
That being said, there is nothing in the current compiler that limits you from doing what you want. It is a common mistake to confuse the language and the libraries.
The Arduino IDE includes a Serial library, but there is nothing that forces you to use it. You can take the code in arduino\avr\cores\arduino\HardwareSerial.cpp and make a copy MyHardwareSerial.cpp that you modify as you need.
I recommend you read through the code of the current HardwareSerial because you will be surprised to see that the code is already doing what you ask about. The data is being read from the serial port based on interrupts from the UART. That code will show you how to implement interrupt service routines that are responding to events from the UART.
But your question may be based on a mistaken premise. The current hardware serial library is hardware interrupt based. Also, the library provides a callback approach for respond to received data. The HardwareSerial object will call serialEvent() in your code. See API description and an example program
Upvotes: 1