This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Count 1 minute in RTX51-Full

Hello,
I'm using the T89C51RD2 micro with RTX51-full RTOS.
I need to count number of passed minutes and I want to know what is the prefered way to do it.
According to the user manual and data sheet the built-in UART requires 32 clock cycles (from timer 2) for each bit (of the received byte). Because the code timed an 8 bits, the value that will be needed for init the time in auto-reload mode is calculated by dividing the CPU cycle count by 32*8=256.
According to this information with a frequency of 11.0592MHz and time slice of 25msec (os_set_slice(23040)) I can wait 5 seconds max (os_wait(K_IVL, 200, 0);).
Now I thought about several options:
Option 1 – Write "os_wait(K_IVL, 200, 0);" line 12 times (5sec*12=1minute).
Option 2 – Write "os_wait(K_IVL, 200, 0);" line in "for" loop that count to 12.

Which of them is better? Are there's any other way to do it?

Thanks a lot,
Roberto.