View previous topic :: View next topic |
Author |
Message |
bernardinim
Joined: 07 Dec 2005 Posts: 10 Location: Italy
|
RTOS and clock ... |
Posted: Wed Dec 07, 2005 4:46 am |
|
|
I have a question: there is a minimum clock rate to use a rtos built in functions?
I'am using a PIC18F2525 and an external clock of 8MHz in EC mode, because i need the FOSC/4 for an external A/D converter.. I have no problem for the other function, but if i try to use tasks the chip seems dead... I wrong something? The clock is too slow? |
|
|
Humberto
Joined: 08 Sep 2003 Posts: 1215 Location: Buenos Aires, La Reina del Plata
|
|
Posted: Wed Dec 07, 2005 2:47 pm |
|
|
Quote: |
I have a question: there is a minimum clock rate to use a rtos built in functions?
|
Yes the clock seems too low for use a rtos built in functions, (the compiler would complain) at least if you are using timer0. A trick is to change to timer1.
Humberto |
|
|
bernardinim
Joined: 07 Dec 2005 Posts: 10 Location: Italy
|
RTOS and clock |
Posted: Fri Dec 09, 2005 9:19 am |
|
|
I tried to use timer0 in 16bit mode, with no prescaler ... but nothing
why the trick is to use Timer1 ? |
|
|
Humberto
Joined: 08 Sep 2003 Posts: 1215 Location: Buenos Aires, La Reina del Plata
|
|
Posted: Fri Dec 09, 2005 10:51 am |
|
|
Quote: |
I tried to use timer0 in 16bit mode, with no prescaler ... but nothing
why the trick is to use Timer1 ?
|
For the same reason. Timer0 is 8 or 16 bit timer/counter software selectable. After Power_on Reset (default mode) is configured as 8 bit. (T0CON.T08BIT = 1 )
I (we ?) doesn't know how CCS implement itīs hidden built in rtos functions and by far also doesn't know how Timer0 was configured.
Suggesting to use Timer1 instead of Timer0 was a "trick" I used to do to get running the rtos with a 16F877 @20Mhz where Timer0 is 8 bit only.
#use rtos(timer=0,minor_cycle=100ms)
#use rtos(timer=1,minor_cycle=100ms)
Humberto |
|
|
|