Go Down

Topic: DuinOS: small and simple rtos (Read 54385 times) previous topic - next topic

juliandasilva

Hi, regarding the onewire, please remember that currently, the delaymicroseconds does not work fine with DuinOS. That's the main problem, but I think you may use the CRITICAL_SECTIONS, and test. If it works, it's possible to make a "thread safe OneWire library". Sorry, but we currently haven't got onewire hardware to test.

Regards and thanks,
Julián
http://robotgroup.com.ar

Chumbud

I can tell you it is a RAM issue causing the ATmega168 not to be able to use serial output.  As a test, changing configTOTAL_HEAP_SIZE in FreeRTOSConfig.h to 500 allowed it to work.

juliandasilva

Good! So I think it must be the default heap size when using the 168. Annotated for the v0.2 version too.

gwen

#48
Nov 22, 2009, 07:47 pm Last Edit: Nov 22, 2009, 08:10 pm by gwen Reason: 1
Hi Julian,
   found the taskENTER_CRITICAL/portENTER_CRITICAL and the exit macros grepping through the source but unclear about how to include into my test program.
A simple #include <DuinOS/task.h> doesnt seem to be found..

unsure of the correct path here(I am on OSX)


   gwen

Chumbud

You just need #include "DuinOS.h", that header will include task.h.  I'm also on OS X.


juliandasilva

#50
Nov 22, 2009, 09:21 pm Last Edit: Nov 22, 2009, 09:22 pm by juliandasilva Reason: 1
Hi, the sintax is:

taskENTER_CRITICAL();
...
taskEXIT_CRITICAL();


It must work without including nothing in the main program, but in the libraries, you may need to include "DuinOS.h", as Chumbud said.

Chumbud

Quote
Good! So I think it must be the default heap size when using the 168. Annotated for the v0.2 version too.

I checked the ELF file and with the 800 bytes allocated to the configTOTAL_HEAP_SIZE for the ATmega 168, the program listing above is using 1125 bytes of static RAM  ::).  The MoreComplexBlinking example with configTOTAL_HEAP_SIZE still set to 800 bytes only uses 833 bytes of RAM.

gwen

Hi Julian,
    I tried.. but no success(prolly because of my ineptitude in the arduino environment) so for now will simply dedicate a 328p as an I2c Slave(without DuinOS) to interrogate my onewire temp sensors and pwm interfaced Co2(which can speak I2C also)  sensor and yes mostly likely the HS1101 humidity sensor as I depend on an rctime emulation for reading.

Then I will simply convey the results via I2C on the sanguino running DuinOS as I2C works just fine(duinos currently using I2C to read the 1307 RTC) (fortunately I have a few arduino capable boards in my junkbox).

As I will get home over a local holiday this week I might be able to find some DS18S20(not too accurate but speaks one wire just fine) and mail 2 or 3 out to you(they are kind of small) and see if you can make anymore progress than I have(if you are interested)?


   gwen

juliandasilva

Hi gwen, many thanks for your offer. I can say the following: Please don't send me the DS18S20, because they will not pass the Argentine Custom. I can get them here (just don't have them now). Regarding the OneWire, we will return to the whole project in about 2-3 weeks (I hope), because now are trying to get our robots ready. Then, when working again in DuinOS, the OneWire will be one of the issues, because that library is not working at all. Any comment/suggestions to this little "roadmap" are welcome.

Regards,
Julián

Checkers1811

Questions about the ATmega328P

Which IO pins do I need to avoid because they are used by DuinOS/Freertos?


juliandasilva

Hi, the OS does not use IO pins, but because it uses the Timer 1, there is no PWM (writeAnalog function) on pins 9 and 10 (unless you do the PWM by software).

Regards,
Julián
http://robotgroup.com.ar

mem

#56
Nov 25, 2009, 03:31 pm Last Edit: Nov 25, 2009, 03:34 pm by mem Reason: 1
Note that the arduino servo library requires timer1 so that library cannot be used with the OS.  However it should be possible for someone to adapt the code so that servicing the servo channels can be done as a task. I don't have the time to do this myself but would be happy to assist if someone wanted to take this on

juliandasilva

I think it will be one of the priorities for the v0.2. The servos are very important. We are thinking in re-implement a timer ISR to behave as the real time "master", with a higher ISR priority than the task switch ISR (timer 1). So, in this "RT" ISR it may be possible to put all the servos, soft pwm/freq, onewire/delaymicroseconds stuff. What do you think?

mem

are you considering using nested interrupts and does the OS currently support this?  I was wondering how long a task switch takes and if interrupts disabled during the switch.


juliandasilva

Hi, here you will find some info about that:

http://www.freertos.org/PC/

(in the left menu go to Results->AVR/WinAVR->Results).

Regards,
Julián

Go Up