Show Posts
Pages: [1] 2 3 ... 6
1  Development / Other Software Development / Re: SCoop - multitask and Simple COOPerative scheduler AVR & ARM on: August 10, 2014, 06:14:50 am
Have you got a 'yield' somewhere in your main loop, such that processing is handed over to your 'mytask'?

Jim
2  Development / Other Software Development / Re: SCoop - multitask and Simple COOPerative scheduler AVR & ARM on: March 01, 2014, 05:30:13 pm
Could you possibly show me where you downloaded the complete SCoopMe library. I cant find it.
Would you please give me a link from where you got the SCoopMe file from?

Fabrice posted the link for SCoop and SCooMe in his initial post, but here it is anyway:

https://code.google.com/p/arduino-scoop-cooperative-scheduler-arm-avr/downloads/list

Jim

3  Development / Other Software Development / Re: SCoop - multitask and Simple COOPerative scheduler AVR & ARM on: February 28, 2014, 08:59:09 am
So were you using Scoop or ScoopME 'alibaba9292'?

As I mentioned in an earlier post, I couldn't get the Scoop examples to compile, so I abandoned it and settled for using ScoopME on my project. With the exception of the timer limitation, it works well.

Jim
4  Using Arduino / Sensors / [SOLVED] Re: DS1307 Real Time Clock Halts on power off. on: January 22, 2014, 12:29:18 pm
Thanks for the informative reply 'jremington'.

It turned out the it was a programming error of mine after all!

I had a line to pick up the time at compliation:
Code:
rtc.adjust(DateTime(_DATE_,_TIME))

Whereas it should have been:
Code:
if (! rtc.isrunning()) rtc.adjust(DateTime(_DATE_,_TIME));

Jim
5  Using Arduino / Sensors / DS1307 Real Time Clock Halts on power off. on: January 20, 2014, 11:00:08 am
I'm using a DS1307 Real Time Clock module on an Arduino, using the 'adafruit' RTC library.

It works OK, but if the board is powered off, the clock doesn't continue to run on the backup battery. It doesn't reset the clock - it just halts on the last time and date setting. I've tried changing the backup battery, but with no effect - besides, if the battery was flat I'd expect the clock to reset, not halt.

Ideas, anyone please?

Jim
6  Development / Other Software Development / Re: SCoop - multitask and Simple COOPerative scheduler AVR & ARM on: December 31, 2013, 12:24:06 pm
Hello

that the beauty of modern programing with templates,
in fact when you declare a SCoopTimer you can specify as a third paramter another object in charge of counting the time.
by default the object used is "SCtimerMs"
and this is visible in the source code line 240. here is the extract
Code:
// class for creating "timers"
template< class CHILD,
          unsigned TIME,
  class SCTIME = SCtimerMs >

struct SCoopTimer : SCoop< SCoopTimer< CHILD, TIME, SCTIME > > {

  static SCTIME timer;
  static SCTIME thresold;

if you create you own object called SCtimerSec then you can pass it when declaring your timer, as a third parameter, like this

Code:
struct myTimer1 : SCoopTimer< myTimer1, 100, SCtimerSec > { // every 100 second
static void run() {
  // user code go here.
} } myTimer1;

and for creating you own SCtimerSec, just copy paste and rework the SCtimerMs smiley

I have tested some month ago and rember it worked. Hope you ll get successfull smiley
this template stuff is really amaizing

or you could alsways enter in the timer.run() every second and manage to continue only after 3600 ticks smiley thats the old fashion way but without risk!




I've had a look at your library Fabrice, and:

You see that tiny speck of silver, high up in the sky? It's a jet aircraft cruising at 40, 000 feet. That's how far over my head your coding is!

;^)

I hoped that by changing the lines as suggested early in the SCoopME.h file:

 
Code:
typedef uint32_t SCmillis_t;  // define the size for any timers in milliseconds. can be changed to uint32_t

That I would get a long int for the Timer - but it had no effect.

I've worked round my problem by using a ordinary Task with:

Code:
struct read_pressure : SCoopTask< read_pressure > {

  static void setup() {}
  static void loop() {

    volatile static uint32_t last_reading = 0;

    if (millis() - last_reading > ONE_HOUR) {
...
// Do barometer pressure reading at 1 Hr intervals
...     
    last_reading = millis();
  }
  }
} read_pressure; // End of Task read_pressure.
[code]

It works OK, but is a bit of a 'kludge' and would be nicer if I could use a 32 bit Timer..

Jim
[/code]
7  Development / Other Software Development / Re: SCoop - multitask and Simple COOPerative scheduler AVR & ARM on: December 29, 2013, 07:36:52 am
Thanks for the quick reply Fabrice.

I'm going to have to digest your suggestions - I have enough problems with 'regular' programming, let alone 'modern'!

Many thanks again for the support - have a good New Year!

Jim
8  Development / Other Software Development / Re: SCoop - multitask and Simple COOPerative scheduler AVR & ARM on: December 28, 2013, 01:57:59 pm
I'm relieved to see that you haven't abandoned SCoop, Fabrice!

Firstly, thank you for SCoopME - it's transformed my project and integrates nicely with the phi_prompt menu library I'm using.

As I mentioned in an earlier post, I couldn't get the SCoop examples to compile on Arduino 1.5.4, and switched to SCoopME, which works well.

One feature I ideally need is for the SCoopTimer to handle a time period of 1 Hour, so it needs a milliseconds input of a long unsigned int, rather than int as it is now.  Any ideas how I can work round this problem, please?

Jim 
9  Development / Other Software Development / Re: NilRTOS - A Fast Tiny Preemptive RTOS on: December 20, 2013, 04:11:54 pm
Not sure if I ought to be starting a new thread, rather than continue with this old one - but here goes!

NilRTOS looks promising for my project. I've got it more or less working with SCoopME, but want to see if NilRTOS is better suited, and more compact.

I've noted in all the examples the warning:

"Loop is the idle thread. The idle thread must not invoke any kernel primitive able to change its state to not runnable"

I'm not sure what this means and its implications for my project! My existing code has functions that access an LCD, and functions accessing a few digital sensors.

What sort of functions do I need to look out for, please?

Jim
10  Development / Suggestions for the Arduino Project / Re: Does Arduino need a real-time scheduler? on: December 18, 2013, 08:07:41 am
If you want to cater for a hobbyist like myself with a non-software background, then it's essential to provide good clear documentation.

I for one will alway choose a library of any complexity that has good clear documentation, even at the expense of overlooking a possible more suitable one where I'm expected to wade through the code to deduce its workings.

My interest in scheduling is because I'm reading a few sensors with an Arduino.. I'm using Dr Liu's 'phi_prompt' menu library to select and display the values on an LCD. Unfortunately the phi_prompt  library sits in loops waiting for user input, during which the sensors aren't read, so I'm looking for a way round the problem and suspect the way forward may be some sort of scheduling system.  I'll look at NilRTOS (thanks 'fatlib16'!), but I've not seen a big fat PDF file describing it, so I may not get far!

Jim
11  Development / Other Software Development / Re: SCoop - multitask and Simple COOPerative scheduler AVR & ARM on: December 17, 2013, 02:15:28 pm
In fact, I had tried SCoop and then witched to SchedulerARMAVR, which is much simpler, and which I am using right now, because I do not need all the goodies provided by SCoop, it is much smaller and has the same interface as the standard Arduino Scheduler library.

Interesting - I'll have a look at the SchedulerARMAVR library. Like you, my project uses very little of the facilities that SCoop/SCoopME offer and SchedulerARMAVR may suit.

There's precious little documentation for SchedulerARMAVR and there appears to only the Scheduler.startloop and yield() functions. Do you happen to know of anything else that will enable me to get a 'handle' on it, please?

I notice in the 'Multiple Blinks' example:

Code:
// IMPORTANT:
  // When multiple tasks are running 'delay' passes control to
  // other tasks while waiting and guarantees they get executed.
  Scheduler.delay(1000);


I'm a bit confused as I thought it was yield() that passes control to the other tasks!

Jim
12  Development / Other Software Development / Re: SCoop - multitask and Simple COOPerative scheduler AVR & ARM on: December 16, 2013, 02:12:41 pm
I have not tried, but it looks like <SCoop.h> is in fact not included.
As the message says, try to enable verbose output to get more information.

The above message is verbose.

Quote
Make sure you have SCoop installed int he right place and enabled in the IDE.

It all appears to be installed in the correct place and appears in the IDE OK.

The only example I've managed to get to comple is the SCoopME template.ino. In fact I'm starting to use SCoopMe in my project and it shows some promise. I've abandoned SCoop! The 'basic sketch' on page 1 of the 'Scoop User Guide V1.2' doesn't compile for me either.

Do you know what the difference is between SCoop and SCoopME ? 'fabriceo' offers no clues and appears to have  gone silent on this thread!

Thanks for the  reply.

Jim
13  Development / Other Software Development / Re: SCoop - multitask and Simple COOPerative scheduler AVR & ARM on: December 12, 2013, 05:32:27 pm
OK no response so far, so some details:

EXAMPLE 1
VERSION 1.2 NEW YEAR PACK 10/1/2013

Gives the following compilation errors:

Arduino: 1.5.4 (Linux), Board: "Arduino Duemilanove or Diecimila, ATmega328"

example1:7: error: expected constructor, destructor, or type conversion before ‘(’ token
example1:10: error: expected constructor, destructor, or type conversion before ‘(’ token
example1:13: error: ‘myTask2’ has not been declared
example1.ino: In function ‘void loop()’:
example1:14: error: ‘sleepSync’ was not declared in this scope
example1.ino: At global scope:
example1:17: error: expected constructor, destructor, or type conversion before ‘(’ token

  This report would have more information with
  "Show verbose output during compilation"
  enabled in File > Preferences.

All the the  other examples give similar errors, plus a whole load more!

Ideas, anyone - please?

(Come on 'fabriceo' SCoop's - your pet. You should be able to provide some input here!    ;^)  )

Jim
14  Development / Other Software Development / Re: SCoop - multitask and Simple COOPerative scheduler AVR & ARM on: December 04, 2013, 02:33:42 pm
I've been looking for a simple task manager/scheduler for my project, and came across SCoop.

I did as I usually do first off with 'strange' libraries and tried to run the examples to get a 'feel' for SCoop.

I found that none of the examples would compile with the Arduino 1.5.4 IDE - they all gave multiple errors that appeared to be library related,  but I didn't look any deeper.

Is there an 'issue' with SCoop and the Arduino IDE?

Jim
15  Using Arduino / Project Guidance / Re: phi_prompt with task scheduling? on: December 03, 2013, 02:29:26 pm
Send me your code and a description how it is meant to work and ill see if its adaptable  to a state machine.

Thanks a lot for the offer!

My project has grown quite big and isn't pretty! What I might do is fork off a cut-down version that's more manageable in a 'proof of concept' use of your state machine library (when I can understand it better!). If I get stuck - and I probably will - I'll come back to you fo help.

Do you have any more documentation or examples than those in the SM.zip file, that I can study, please?

Jim
Pages: [1] 2 3 ... 6