Products > Embedded Computing

using the arduino IDE without the arduino

(1/6) > >>

Simon:
I have need to write a program that at the moment is not really going very well. For example there is an interrupt on a pin that is being pulsed at 10Hz but my readout says 1Hz, I can also see a delay in the screen updating sometimes yet there is nothing in my project to cause this delay.

My problem is that i need something like the arduino libraries but without anything that runs in the background. Is there an established way to do this? I'd like to be able to access the hardware directly but don't want to fight the arduino system and break everything.

Alternatively is there a way of putting all of the arduino libraries into a C++ project in microchip studio and using them there? I have some sort of plugin that does that but I don't want even that messing with my work.

dunkemhigh:

--- Quote --- pulsed at 10Hz but my readout says 1H
--- End quote ---

That would smell to me, and the first thing I'd do is look for alternative confirmation before trying to fix the wrong problem.


--- Quote ---My problem is that i need something like the arduino libraries but without anything that runs in the background. Is there an established way to do this? I'd like to be able to access the hardware directly but don't want to fight the arduino system and break everything.
--- End quote ---

Seems to me you're wanting your cake and eating it too. The only way to be sure is to do it yourself. Either use someone elses random code and accept everything it entails or have it do exactly what you want by writing it yourself. There is a mid-point where you could take some other code and either fix it up (but then you'd have to understand what it does, and knowing that you might as well write it properly) or use it as the basis for your own version (see previous comment). But doing that to what amounts to an OS is non-trivial unless your requirements are quite flexible, and yours don't seem to be.

Simon:
the 1 in 10 interrupt seems to be a calculation error on my part but it is clear to me that there is a load of code in the background that on the one hand I don't want to upset if it is in use and on the other hand it is no use to me so might as well take it out. I can't possibly write everything I need from scratch and at some point need to trust someone. At least the arduino libraries seem to work and really they are not ardueino specific. Try looking at the LCD library, much of it's functionality comes from standard C++ libraries. It stupid things like whatever drives the millis() functionality that I don't want and want to write my own.

langwadt:

--- Quote from: Simon on October 23, 2021, 12:32:52 am ---the 1 in 10 interrupt seems to be a calculation error on my part but it is clear to me that there is a load of code in the background that on the one hand I don't want to upset if it is in use and on the other hand it is no use to me so might as well take it out. I can't possibly write everything I need from scratch and at some point need to trust someone. At least the arduino libraries seem to work and really they are not ardueino specific. Try looking at the LCD library, much of it's functionality comes from standard C++ libraries. It stupid things like whatever drives the millis() functionality that I don't want and want to write my own.

--- End quote ---

https://github.com/arduino/ArduinoCore-samd/blob/master/cores/arduino/delay.c

westfw:

--- Quote ---i need something like the arduino libraries but without anything that runs in the background.
--- End quote ---

What is it that you think Arduino "runs in the background"?  About all it has is ISRs for a 1-millisecond clock tick and UART (if you use "Serial.")

Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version