打印

ucos 跑在dspic4011上意义大吗?

[复制链接]
3572|7
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
rockn|  楼主 | 2007-9-16 18:23 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
做一个控制器项目带两行字符液晶显示,请问用操作系统意义大吗?
沙发
龙在天涯| | 2007-9-16 22:21 | 只看该作者

如果有现成的UCOS系统,是有意义的

如果有现成的UCOS系统,这样作实时系统和普通循环系统都是一样的工作量,实时系统在任务调动上可以给项目带来时间分配上的便利,特别是在考虑到显示的无闪烁性和数据的响应实时性后,使用实时系统则更好的把握这一点。

使用特权

评论回复
板凳
soso| | 2007-9-17 06:59 | 只看该作者

ucosii不可能运行在4011

    删减到不干活的地步编译,那一点可怜的RAM也是不够的,我试过了。建议你用PICOS18,不过比较晦涩,看你理解能力,那是一个全新的RTOS。我 在这下面建立了10个信号量,6个任务,最后的资源RAM剩下不到20,ROM剩余100byte,险胜一身冷汗!

使用特权

评论回复
地板
sodwell| | 2007-9-17 07:56 | 只看该作者

re

UCOS对dspic和PIC18有现成的移植代码,我在网上有下过,反正有现成的不妨试试看,玩玩也好。
同意2楼的:这样作实时系统和普通循环系统都是一样的工作量,实时系统在任务调动上可以给项目带来时间分配上的便利,特别是在考虑到显示的无闪烁性和数据的响应实时性后,使用实时系统则更好的把握这一点。

使用特权

评论回复
5
soso| | 2007-9-17 08:59 | 只看该作者

不要误导

  30f4011小庙容不下大神,能否容纳ucosii,你编译过了就知道。
  感觉你们说的用不用rtos工作量差不多的话值得讨论。熟练运用rtos,会节省大约50%的调试维护时间;作出的程序的健壮程度,前后台设计模式无法比拟的。当然,学习rtos是一个绝对痛苦的过程。

使用特权

评论回复
6
rockn|  楼主 | 2007-9-18 21:06 | 只看该作者

我编译进去了,以下是我的配置

建了两个100个字的堆栈任务,用了ram1548,共2048,应该简单跑几个任务没问题。估计也装不了太多东西了。


/*
*********************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*
*                           (c) Copyright 1992-2003, Jean J. Labrosse, Weston, FL
*                                           All Rights Reserved
*
*                                  uC/OS-II Configuration File for V2.7x
*
* File    : OS_CFG.H
* By      : Jean J. Labrosse
* Version : V2.76
*********************************************************************************************************
*/

#ifndef OS_CFG_H
#define OS_CFG_H

                                       /* ---------------------- MISCELLANEOUS ----------------------- */
#define OS_ARG_CHK_EN             1    /* Enable (1) or Disable (0) argument checking                  */
#define OS_CPU_HOOKS_EN           1    /* uC/OS-II hooks are found in the processor port files         */

#define OS_DEBUG_EN               1    /* Enable(1) debug variables                                    */

#define OS_EVENT_NAME_SIZE       2    /* Determine the size of the name of a Sem, Mutex, Mbox or Q    */

#define OS_LOWEST_PRIO           13    /* Defines the lowest priority that can be assigned ...         */
                                       /* ... MUST NEVER be higher than 63!                            */

#define OS_MAX_EVENTS             6    /* Max. number of event control blocks in your application      */
#define OS_MAX_FLAGS              4    /* Max. number of Event Flag Groups    in your application      */
#define OS_MAX_MEM_PART           0    /* Max. number of memory partitions                             */
#define OS_MAX_QS                 0    /* Max. number of queue control blocks in your application      */
#define OS_MAX_TASKS              8    /* Max. number of tasks in your application, MUST be >= 2       */

#define OS_SCHED_LOCK_EN          1    /*     Include code for OSSchedLock() and OSSchedUnlock()       */

#define OS_TASK_IDLE_STK_SIZE    200    /* Idle task stack size (# of OS_STK wide entries)              */

#define OS_TASK_STAT_EN           1    /* Enable (1) or Disable(0) the statistics task                 */
#define OS_TASK_STAT_STK_SIZE     100    /* Statistics task stack size (# of OS_STK wide entries)        */
#define OS_TASK_STAT_STK_CHK_EN   1    /* Check task stacks from statistic task                        */

#define OS_TICK_STEP_EN           0    /* Enable tick stepping feature for uC/OS-View                  */
#define OS_TICKS_PER_SEC         1000    /* Set the number of ticks in one second                        */


                                       /* ----------------------- EVENT FLAGS ------------------------ */
#define OS_FLAG_EN                0    /* Enable (1) or Disable (0) code generation for EVENT FLAGS    */
#define OS_FLAG_WAIT_CLR_EN       1    /* Include code for Wait on Clear EVENT FLAGS                   */
#define OS_FLAG_ACCEPT_EN         1    /*     Include code for OSFlagAccept()                          */
#define OS_FLAG_DEL_EN            1    /*     Include code for OSFlagDel()                             */
#define OS_FLAG_NAME_SIZE         2    /*     Determine the size of the name of an event flag group    */
#define OS_FLAG_QUERY_EN          1    /*     Include code for OSFlagQuery()                           */


                                       /* -------------------- MESSAGE MAILBOXES --------------------- */
#define OS_MBOX_EN                0    /* Enable (1) or Disable (0) code generation for MAILBOXES      */
#define OS_MBOX_ACCEPT_EN         1    /*     Include code for OSMboxAccept()                          */
#define OS_MBOX_DEL_EN            1    /*     Include code for OSMboxDel()                             */
#define OS_MBOX_POST_EN           1    /*     Include code for OSMboxPost()                            */
#define OS_MBOX_POST_OPT_EN       1    /*     Include code for OSMboxPostOpt()                         */
#define OS_MBOX_QUERY_EN          1    /*     Include code for OSMboxQuery()                           */


                                       /* --------------------- MEMORY MANAGEMENT -------------------- */
#define OS_MEM_EN                 0    /* Enable (1) or Disable (0) code generation for MEMORY MANAGER */
#define OS_MEM_QUERY_EN           1    /*     Include code for OSMemQuery()                            */
#define OS_MEM_NAME_SIZE         32    /*     Determine the size of a memory partition name            */


                                       /* ---------------- MUTUAL EXCLUSION SEMAPHORES --------------- */
#define OS_MUTEX_EN               0    /* Enable (1) or Disable (0) code generation for MUTEX          */
#define OS_MUTEX_ACCEPT_EN        1    /*     Include code for OSMutexAccept()                         */
#define OS_MUTEX_DEL_EN           1    /*     Include code for OSMutexDel()                            */
#define OS_MUTEX_QUERY_EN         1    /*     Include code for OSMutexQuery()                          */


                                       /* ---------------------- MESSAGE QUEUES ---------------------- */
#define OS_Q_EN                   0    /* Enable (1) or Disable (0) code generation for QUEUES         */
#define OS_Q_ACCEPT_EN            1    /*     Include code for OSQAccept()                             */
#define OS_Q_DEL_EN               1    /*     Include code for OSQDel()                                */
#define OS_Q_FLUSH_EN             1    /*     Include code for OSQFlush()                              */
#define OS_Q_POST_EN              1    /*     Include code for OSQPost()                               */
#define OS_Q_POST_FRONT_EN        1    /*     Include code for OSQPostFront()                          */
#define OS_Q_POST_OPT_EN          1    /*     Include code for OSQPostOpt()                            */
#define OS_Q_QUERY_EN             1    /*     Include code for OSQQuery()                              */


                                       /* ------------------------ SEMAPHORES ------------------------ */
#define OS_SEM_EN                 1    /* Enable (1) or Disable (0) code generation for SEMAPHORES     */
#define OS_SEM_ACCEPT_EN          1    /*    Include code for OSSemAccept()                            */
#define OS_SEM_DEL_EN             1    /*    Include code for OSSemDel()                               */
#define OS_SEM_QUERY_EN           1    /*    Include code for OSSemQuery()                             */
#define OS_SEM_SET_EN             1    /*    Include code for OSSemSet()                               */


                                       /* --------------------- TASK MANAGEMENT ---------------------- */
#define OS_TASK_CHANGE_PRIO_EN    0    /*     Include code for OSTaskChangePrio()                      */
#define OS_TASK_CREATE_EN         1    /*     Include code for OSTaskCreate()                          */
#define OS_TASK_CREATE_EXT_EN     0    /*     Include code for OSTaskCreateExt()                       */
#define OS_TASK_DEL_EN            0    /*     Include code for OSTaskDel()                             */
#define OS_TASK_NAME_SIZE         4    /*     Determine the size of a task name                        */
#define OS_TASK_PROFILE_EN        0    /*     Include variables in OS_TCB for profiling                */
#define OS_TASK_QUERY_EN          1    /*     Include code for OSTaskQuery()                           */
#define OS_TASK_SUSPEND_EN        1    /*     Include code for OSTaskSuspend() and OSTaskResume()      */
#define OS_TASK_SW_HOOK_EN        1    /*     Include code for OSTaskSwHook()                          */


                                       /* --------------------- TIME MANAGEMENT ---------------------- */
#define OS_TIME_DLY_HMSM_EN       0    /*     Include code for OSTimeDlyHMSM()                         */
#define OS_TIME_DLY_RESUME_EN     1    /*     Include code for OSTimeDlyResume()                       */
#define OS_TIME_GET_SET_EN        0    /*     Include code for OSTimeGet() and OSTimeSet()             */
#define OS_TIME_TICK_HOOK_EN      1    /*     Include code for OSTimeTickHook()                        */


typedef INT16U             OS_FLAGS;   /* Date type for event flag bits (8, 16 or 32 bits)             */

#endif

使用特权

评论回复
7
龙在天涯| | 2007-9-18 21:23 | 只看该作者

4011的容量没有问题,我试过的,当时跑2个任务

4011的容量没有问题,我试过的,当时跑2个任务,FLASH和RAM都是有充分余量的所以我可以说在4011上没问题,在单片机中如果不是有很复杂的逻辑和不停变换的各种信号需要实时采集或者任务间需要同步等等这些绕来绕去的操作的话,我建议尽量少用消息,信号,邮箱之类的,很占RAM。程序也大,运行中总是被这样那样的消息打断,当然,不是不可以,只是建议不用,你自己绕来绕去也烦嘛。

使用特权

评论回复
8
rockn|  楼主 | 2007-9-18 23:00 | 只看该作者

好的,我试一试

多谢各位建议

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

23

主题

70

帖子

2

粉丝