Argentina
Offline
Full Member
Karma: 0
Posts: 186
Sé feliz
|
 |
« Reply #45 on: November 21, 2009, 11:57:59 pm » |
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
Newbie
Karma: 0
Posts: 36
|
 |
« Reply #46 on: November 22, 2009, 08:58:51 am » |
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
Full Member
Karma: 0
Posts: 186
Sé feliz
|
 |
« Reply #47 on: November 22, 2009, 10:00:29 am » |
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
Newbie
Karma: 0
Posts: 30
Arduino rocks
|
 |
« Reply #48 on: November 22, 2009, 01:47:46 pm » |
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
Newbie
Karma: 0
Posts: 36
|
 |
« Reply #49 on: November 22, 2009, 02:21:17 pm » |
You just need #include "DuinOS.h", that header will include task.h. I'm also on OS X.
|
|
|
|
|
Logged
|
|
|
|
|
Argentina
Offline
Full Member
Karma: 0
Posts: 186
Sé feliz
|
 |
« Reply #50 on: November 22, 2009, 03:21:21 pm » |
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
Newbie
Karma: 0
Posts: 36
|
 |
« Reply #51 on: November 22, 2009, 04:12:06 pm » |
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.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 30
Arduino rocks
|
 |
« Reply #52 on: November 24, 2009, 11:18:19 pm » |
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
Full Member
Karma: 0
Posts: 186
Sé feliz
|
 |
« Reply #53 on: November 24, 2009, 11:50:50 pm » |
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
Jr. Member
Karma: 0
Posts: 65
CJH Innovations
|
 |
« Reply #54 on: November 25, 2009, 08:30:31 am » |
Questions about the ATmega328P
Which IO pins do I need to avoid because they are used by DuinOS/Freertos?
|
|
|
|
|
Logged
|
|
|
|
|
Argentina
Offline
Full Member
Karma: 0
Posts: 186
Sé feliz
|
 |
« Reply #55 on: November 25, 2009, 08:53:05 am » |
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
Faraday Member
Karma: 6
Posts: 6226
Have fun!
|
 |
« Reply #56 on: November 25, 2009, 09:31:25 am » |
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
Full Member
Karma: 0
Posts: 186
Sé feliz
|
 |
« Reply #57 on: November 25, 2009, 09:55:03 am » |
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
Faraday Member
Karma: 6
Posts: 6226
Have fun!
|
 |
« Reply #58 on: November 25, 2009, 11:34:10 am » |
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
Full Member
Karma: 0
Posts: 186
Sé feliz
|
 |
« Reply #59 on: November 25, 2009, 11:37:41 am » |
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
|
|
|
|
|
|