Introduction
uC/OS-II_RealTime
SDCC_uC/OS-II
Test_App
Download
References


%Complete
9/10
8/10
4/10
8/10
7/10
8/10



Download

I made this Port and Website in the Hope that it would help other students in the Embedded Computer Engineering program at UCSD Extension. Some specific improvements I think it offers are...
  1. Ability to write programs of any size. Keil Compiler Demo version has a 2K code size limit.
  2. Ability to Compile uC/OS-II source instead of using binary OS with Stubs file. I Strongly feel the benefits of hacking the OS source instead of just reading in a Text book cannot be Overstated.
  3. Ability to Write and Interface Interrupt Service Routines and External Hardware(Sensors, Actuators, Transducers, Et Cetera) to uC/OS-II Scheduler and Tasks.
  4. Ability to make more Realistic class projects
  5. Ability to see how specific Operating System Ports are to Compilers and Assemblers. There are no other uC/OS-II Ports using SDCC, a few using Keil, IAR, or Tasking Compilers, (uC/OS-II Intel Ports), but they all have problems with Stack usage, Flags, Performance, Documentation, and Interrupts. Also they cannot be built with Educational releases of Commercial Compilers.
Title Files Version Updated
SDCC_8031sdk_uCOS-II-.0002.tar.gz
SDCC_8031sdk_uCOS-II-.0002-CRLF.tar.gz
Makefile
includes.h
test.h
os_cfg_r.h
ucos_ii.h
os_cpu.h
ringbuf.h
test.c
os_cpu_asm.mcs51
os_cpu_c.c
isrs.c
os_dbg_r.c
os_mem.c
os_flag.c
os_mutex.c
os_task.c
ringbuf.c
os_core.c
os_mbox.c
os_q.c
os_time.c
ucos_ii.c
os_tmr.c
os_sem.c
.0002 10/22/2006
ChangeLog
  1. Facilities to write Interrupt Service Routines from C code, better then uC/OS-II default Assembly ISRs. OSIntSaveCtx(); OSRestoreCtx(); OSIntEnter(); OSIntExit(); in SDCC_uC/OS-II document. C SerialISR, Timer2ISR, Timer0ISR(making I2C bus to ultra sonic sensor).
  2. Test App runs DeadLock Test, Priority Inverson Test, Priority Inheritance Test, and Strict Priorities Test. Also implements I2C bus Interfaced to uC/OS-II task to range find objects with Ultra Sonic Sensor. Requires Breadboard and circuitry and Sensor External to 8031sdk.[incomplete]
  3. Unsigned Chars (OSIntNesting, OSPrioCur, OSPrioHighRdy, OSRdyGrp, OSRdyTbl[]) and OS_TCB ptrs * (OSTCBCur, OSTCBHighRdy, OSTCBPrioTbl[]) put statically in 8032 Internal Ram decreasing Context Switching Time by 40uS and Scheduling Time by 20uS. The loss is 32 bytes of Reentrant Function Call Stack but with 215 left we can still nest 25 or so routines deep if our Parameters and Local Vars like SDCC_uC/OS-II estimations. Deepest uC/OS-II function Nesting is 15.
  4. xdata Pointers used throughout uC/OS-II code instead of generic 3 bytes pointers. 2 for 3 and as they all go onto the Reentrant Function Call Stack. Savings can be great as shown in SDCC_uC/OS-II document. For Deepest nested uC/OS-II function calls it would be 45 bytes saved. Increasing possible function nesting by 7.
  5. Timer2 used for OSTickISR with auto-reload so more accurate. Timer0 cannot be used with auto-reload for OSTimeTick() because it is only 8-bit auto-reload, without auto-reload off course is can be 16-bit and make 100Hz, but then Time will drift faster. Timer2 can do 16-bit Auto-Reload.
  6. Timer0 makes I2C bus protocol because 8-bit auto-reload can bit-bang Port0.0-1 pins and easily make the protocol [incomplete]
Title Files Version Updated
SDCC_8031sdk_uC/OS-II-.0001.tar.gz
SDCC_8031sdk_uC/OS-II-CRLF.0001.tar.gz
Makefile
includes.h
test.c
os_cfg_r.h
ucos_ii.h
os_cpu.h
os_cpu_asm.mcs51
os_cpu_c.c
os_dbg_r.c
os_mem.c
os_flag.c
os_mutex.c
os_task.c
os_core.c
os_mbox.c
os_q.c
os_time.c
ucos_ii.c
os_tmr.c
os_sem.c
.0001 8/29/2006
ChangeLog
  1. Context Switching and Scheduling works. Task creation works. Interrupts in Assembly work. Interrupt Context Switching works. uCos services all work including FLAGS. Test app makes bunch of Task and has them delay and interrupt each other at random intervals output to the 8032 Internal Serial Port with Task specific text to see valid results. 5 Tasks
  2. OSCTXSw: Context Switching code called by Scheduler when Task gives up the MCU by either calling OSTimeDly(), Pending on a resource that is unavailable... Very Hardware and compiler dependent. Diff Compilers use diff stack base pointers
  3. OSSTaskStkInit: Called when Task are created, sets up their initial Stack with 8032 Registers, SDCC pseudo function registers(stack base pointers), Also put stack data argument into dptr and accumulator so Task get their stuff right.
  4. OSIntCtxSw: Context Switching from interrupts, only restores task does not save current, that must be done before call, at start of ISR
  5. OSTickISR: Assembly language, save running context, calls OSTimeTick() then either returns to itself if no new Task to run, or OSTimeTick() never lets code return to OSTickISR(), it calls OSIntCtxSw and a new Task runs, with the old left at the place when the Interrupt happened.
  6. OSStartHighRdy: Called only once when the operating system is started OSCtxSw, OSStartHighRdy, OSIntCtxSw, OSTickISR, OSTaskStkInit, os_cpu.h, os_cpu.c ucos_ii.h, includes.h,
uC/OS-II(ucos-ii,ucos,ucosii)
Copyright © 2006 Eric Enockson
Hosted by www.Geocities.ws

1