Pages: 1 2 3 [4] 5 6 ... 13   Go Down
Author Topic: DuinOS: small and simple rtos  (Read 38114 times)
0 Members and 1 Guest are viewing this topic.
Argentina
Offline Offline
Full Member
***
Karma: 0
Posts: 186
Sé feliz
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

USA
Offline Offline
Newbie
*
Karma: 0
Posts: 36
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Argentina
Offline Offline
Full Member
***
Karma: 0
Posts: 186
Sé feliz
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

0
Offline Offline
Newbie
*
Karma: 0
Posts: 30
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: November 22, 2009, 02:10:42 pm by gwen » Logged

USA
Offline Offline
Newbie
*
Karma: 0
Posts: 36
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

Argentina
Offline Offline
Full Member
***
Karma: 0
Posts: 186
Sé feliz
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: November 22, 2009, 03:22:03 pm by juliandasilva » Logged

USA
Offline Offline
Newbie
*
Karma: 0
Posts: 36
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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  :smiley.  The MoreComplexBlinking example with configTOTAL_HEAP_SIZE still set to 800 bytes only uses 833 bytes of RAM.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 30
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Argentina
Offline Offline
Full Member
***
Karma: 0
Posts: 186
Sé feliz
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 66
CJH Innovations
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Questions about the ATmega328P

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

Logged

Argentina
Offline Offline
Full Member
***
Karma: 0
Posts: 186
Sé feliz
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

London
Offline Offline
Faraday Member
**
Karma: 8
Posts: 6240
Have fun!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: November 25, 2009, 09:34:01 am by mem » Logged

Argentina
Offline Offline
Full Member
***
Karma: 0
Posts: 186
Sé feliz
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

London
Offline Offline
Faraday Member
**
Karma: 8
Posts: 6240
Have fun!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

Argentina
Offline Offline
Full Member
***
Karma: 0
Posts: 186
Sé feliz
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Pages: 1 2 3 [4] 5 6 ... 13   Go Up
Jump to: