Fujitsu F2MC-16L User Manual page 60

Hide thumbs Also See for F2MC-16L:
Table of Contents

Advertisement

APPENDIX
However, HyperTerminal displays strings as shown in Figure Bm. From this output, the tasks do
not seem to be working as in Figure Bl.
hello,i am b_task. HE LhLe01,1 oI, AiM aAm_TbA_Stka.s k.
HE LhLe01,1 oI, AiM aAm_TbA_StKa.s k.HE LhLe01, 1 oI, AiM a
Am_TbA_TbA_StKa.s k.
This is because the serial driver is implemented as described below. The serial driver in sample
program 1 invokes the interrupt handler on occurrence of a transmission enable interrupt and
uses the eventflag to notify the task of completion of preparation for output. That is, when the
printf function is execution, the cwai_flg system call is issued each time a character is output.
Figure Bn below illustrates this situation, focusing on a_tsk and b_tsk.
a_tsk
b_tsk
a_tsk output
b_tsk output "hel...b_task."
Even though a_tsk has a higher task priority than b_tsk, the tasks work as shown in Figure Bi
depending on how the drivers have been designed. This is because, although the ID3 eventflag
places the two tasks different in task priority in the wait state at the same time, the tasks are
scheduled by the FCFS (First Come First Service) system. If a_tsk enters the wait state after
b_tsk enters the wait state, b_tsk restarts working first when the conditions for releasing the
tasks from the wait state are satisfied. This symptom is called priority inversion.
a_tsk outputs a series of three characters " HE " in Figure Bn because the serial driver has a
single-character buffer.
48
Figure Bm
f3
f3
f1
f3
f3 f1
• • • • • • •
" "
"H" "E"
: READY state
: RUN state
: WAIT state
Figure Bn
Sample Program Operation (2)
Output at HyperTerminal
f3
f3
f3
f3
f3
*
"L"
"L"
" "
"h"
f1: Issues cwa_flg(1).
f1: Issues set_flg(1).
f3: Issues cwai_flg(3).
f3
f3
f3
f3
f3
"0"
","
"e"
"l"
"l"

Advertisement

Table of Contents
loading

This manual is also suitable for:

F2mc-16xlF2mc-16F2mc-16hF2mc-16f

Table of Contents