Hello Roberto, and welcome to the forum.
Within the "sticky" links at the top of the page for this forum, there are two references to RTOS/kernels.
EBS08 the Simple Basic System for HC(S)08 MCU's
In fact the second link does closely correspond with the time-based kernel of AN1262. As it happens, I am currently working on a project (absolute assembly) for the HCS08SE device, using a simplified, scaled down version of a time-based kernel, with a total of 16 timeslots generated using a TPM channel. I have attached the preliminary assembly code. This could easily be adapted to relocatable assembly.
From time to time I recall that there have been other simple task schedulers described within this forum. I suggest that you use the forum search engine to find the other references.
Regards,
Mac
Thank ypu for helping me. Thank you for the file and the links too.
I've alredy started searching on the forum and it is very useful
In the meantime I've try to realize a kernel like an1262, using
the Real Time Counter on my uC (I'm vorking with MC9S08QE64) and interrupts
genrated by it.I need a task -time about 50 microseconds, it is
correct to use RTC or I have to use a TPM module?
I'm facing off with a lot of trouble using interrupt of RTC,
now I'll have a look on HCS08 Peripheral Module
Quick Reference examples, because the CodeWarrior Help lacks on good
explanation on interrupt. I'm also waiting the book of Pereria on HSc08.
Are there any other source of documentation (or code) on Interrupts and their handling?
Hello Roberto,
Use whichever timer is most suited to your project requirements. However, for a time-based kernel, a timeslot period of 50 microseconds (say 500 bus cycles) is really too short unless your tasks are extremely simple. My normal expectation would be a timeslot period in the milliseconds region, so useful work can be done without overflow of the timeslots.
If you have operations that must be processed every 50 microseconds, this code should be directly incorporated within the timer interrupt service routine (ISR), and the code would need to be kept very short (the ISR should be completed within significantly less than 500 bus cycles).
In this case, you would probably need to use an output compare interrupt associated with a TPM channel. This is the method that the previously posted sample assembly code uses.
Application note AN2616 may also be of interest to you. Look in the FAQ section for the various methods available for implementing ISRs in C, using CW.
Regards,
Mac