huaitsai
驱动牛犊
驱动牛犊
  • 注册日期2002-04-02
  • 最后登录2008-03-19
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
阅读:3920回复:11

WinCE真的可以做到1msec中断实时real-time吗?

楼主#
更多 发布于:2002-04-11 17:25
WinCE真的可以做到1msec中断实时real-time吗?
bohao
驱动牛犊
驱动牛犊
  • 注册日期2001-07-25
  • 最后登录2002-12-16
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
沙发#
发布于:2002-04-12 17:36
估计很难的说,因为它不是真正的RTOS.
问的问题很傻,请不要笑话我! 回答的不好,还请多多包涵!
fastworm
驱动牛犊
驱动牛犊
  • 注册日期2002-04-06
  • 最后登录2004-09-27
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
板凳#
发布于:2002-04-15 13:42
winCE属于soft-RTOS,它的线程时间片的单位是1ms,系统缺省使用100ms.如果实在需要在较短的时间响应中断,可以设为10ms.不过不推荐这种方法.
! ? ......
jacobqzl
驱动小牛
驱动小牛
  • 注册日期2001-10-10
  • 最后登录2005-04-23
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
地板#
发布于:2002-04-16 20:58
答案是:不行!做不到1ms的。1ms是理论上的值。
icesoft
驱动牛犊
驱动牛犊
  • 注册日期2002-01-12
  • 最后登录2002-06-26
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
地下室#
发布于:2002-04-16 21:21
Microsoft claims that windows CE,running on a Hitachi SH3 reference platform,starts an ISR in two to five microseconds and an IST in 90 to 170 microsenconds after an interrupt coours-specs suitable for many embedded applications.
huaitsai
驱动牛犊
驱动牛犊
  • 注册日期2002-04-02
  • 最后登录2008-03-19
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
5楼#
发布于:2002-04-17 10:56
那除了购买RTOS之外  在WinCE或Win9x甚至Win2000中
有法子得到1msec的实时吗?
icesoft
驱动牛犊
驱动牛犊
  • 注册日期2002-01-12
  • 最后登录2002-06-26
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
6楼#
发布于:2002-04-17 16:29
没有!
merelau
驱动牛犊
驱动牛犊
  • 注册日期2002-03-21
  • 最后登录2016-01-09
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
7楼#
发布于:2002-04-18 10:46
绝对没有
fastworm
驱动牛犊
驱动牛犊
  • 注册日期2002-04-06
  • 最后登录2004-09-27
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
8楼#
发布于:2002-04-18 18:08
完全不可能!CE相对于Windows桌面OS其实时性还是要更好,但仍做不到1ms.
! ? ......
huaitsai
驱动牛犊
驱动牛犊
  • 注册日期2002-04-02
  • 最后登录2008-03-19
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
9楼#
发布于:2002-04-23 17:31
真是不行吗?可是我依下列这个Visual Basic例子在windows98
跑却可以达到1msec  各位可以试试原作者程序也欢迎试试
我更改后的程序:

原作者程序(www.allapi.net):
\'This project requires a Form and a Module
\'On the form, there should be one command button (Command1)
\'and one Timer (Timer1)

\'In the form:
Option Explicit
Private Sub Form_Load()
    \'KPD-Team 2001
    \'URL: http://www.allapi.net/
    \'E-Mail: KPDTeam@Allapi.net
    Command1.Caption = \"Start\"
End Sub
Private Sub Form_Unload(Cancel As Integer)
    \'Stop the timers if they\'re still counting
    timeKillEvent hMMTimer
    Timer1.Enabled = False
End Sub
Private Sub Timer1_Timer()
    \'increment VBTimer
    VBTimer = VBTimer + 1
End Sub
Private Sub Command1_Click()
    If Command1.Caption = \"Start\" Then
        \'Start both timers
        Timer1.Interval = 1
        Timer1.Enabled = True
        hMMTimer = timeSetEvent(1, 0, AddressOf TimerProc, 0, TIME_PERIODIC Or TIME_CALLBACK_FUNCTION)
        Command1.Caption = \"Stop\"
    Else
        \'Stop both timers
        timeKillEvent hMMTimer
        Timer1.Enabled = False
        Command1.Caption = \"Start\"
        \'Show result
        MsgBox \"Timer1_Timer was called \" & VBTimer & \" times;\" & vbNewLine & \"TimerProc was called \" & MMTimer & \" times.\"
        VBTimer = 0
        MMTimer = 0
    End If
End Sub
\'In a module
Option Explicit
Public Const TIME_ONESHOT = 0  \'Event occurs once, after uDelay milliseconds.
Public Const TIME_PERIODIC = 1  \'Event occurs every uDelay milliseconds.
Public Const TIME_CALLBACK_EVENT_PULSE = &H20  \'When the timer expires, Windows calls thePulseEvent function to pulse the event pointed to by the lpTimeProc parameter. The dwUser parameter is ignored.
Public Const TIME_CALLBACK_EVENT_SET = &H10  \'When the timer expires, Windows calls theSetEvent function to set the event pointed to by the lpTimeProc parameter. The dwUser parameter is ignored.
Public Const TIME_CALLBACK_FUNCTION = &H0   \'When the timer expires, Windows calls the function pointed to by the lpTimeProc parameter. This is the default.
Public Declare Function timeKillEvent Lib \"winmm.dll\" (ByVal uID As Long) As Long
Public Declare Function timeSetEvent Lib \"winmm.dll\" (ByVal uDelay As Long, ByVal uResolution As Long, ByVal lpFunction As Long, ByVal dwUser As Long, ByVal uFlags As Long) As Long
Public VBTimer As Long, MMTimer As Long
Public hMMTimer As Long
Sub TimerProc(ByVal uID As Long, ByVal uMsg As Long, ByVal dwUser As Long, ByVal dw1 As Long, ByVal dw2 As Long)
    \'Increment MMTimer
    MMTimer = MMTimer + 1
End Sub


我更改后的程序:
\'This project requires a Form and a Module
\'On the form, there should be one command button (Command1)
\'and one Timer (Timer1)
\'and three Text (Text1, Text2, Text3)

\'In the form:
Option Explicit
Private Sub Form_Load()
    \'KPD-Team 2001
    \'URL: http://www.allapi.net/
    \'E-Mail: KPDTeam@Allapi.net
    Command1.Caption = \"Start\"
End Sub
Private Sub Form_Unload(Cancel As Integer)
    \'Stop the timers if they\'re still counting
    timeKillEvent hMMTimer
    Timer1.Enabled = False
End Sub


Private Sub Timer1_Timer()
    \'increment VBTimer
    VBTimer = VBTimer + 1

    Form1.Text1.Text = Time
  
    If oo >= 100000 Then
       oo = 0
    End If
    
End Sub
Private Sub Command1_Click()
    If Command1.Caption = \"Start\" Then
        \'Start both timers
        Timer1.Interval = 100
        Timer1.Enabled = True
        hMMTimer = timeSetEvent(1, 0, AddressOf TimerProc, 0, TIME_PERIODIC Or TIME_CALLBACK_FUNCTION)
        Command1.Caption = \"Stop\"
    Else
        \'Stop both timers
        timeKillEvent hMMTimer
        Timer1.Enabled = False
        Command1.Caption = \"Start\"
        VBTimer = 0
        MMTimer = 0
    End If
End Sub



\'In a module
Option Explicit
Public Const TIME_ONESHOT = 0  \'Event occurs once, after uDelay milliseconds.
Public Const TIME_PERIODIC = 1  \'Event occurs every uDelay milliseconds.
Public Const TIME_CALLBACK_EVENT_PULSE = &H20  \'When the timer expires, Windows calls thePulseEvent function to pulse the event pointed to by the lpTimeProc parameter. The dwUser parameter is ignored.
Public Const TIME_CALLBACK_EVENT_SET = &H10  \'When the timer expires, Windows calls theSetEvent function to set the event pointed to by the lpTimeProc parameter. The dwUser parameter is ignored.
Public Const TIME_CALLBACK_FUNCTION = &H0   \'When the timer expires, Windows calls the function pointed to by the lpTimeProc parameter. This is the default.
Public Declare Function timeKillEvent Lib \"winmm.dll\" (ByVal uID As Long) As Long
Public Declare Function timeSetEvent Lib \"winmm.dll\" (ByVal uDelay As Long, ByVal uResolution As Long, ByVal lpFunction As Long, ByVal dwUser As Long, ByVal uFlags As Long) As Long
Public VBTimer As Long, MMTimer As Long, oo As Long
Public hMMTimer As Long
Public mmclock As Long

Sub TimerProc(ByVal uID As Long, ByVal uMsg As Long, ByVal dwUser As Long, ByVal dw1 As Long, ByVal dw2 As Long)
    \'Increment MMTimer
    MMTimer = MMTimer + 1
    oo = oo + 1
    
    If MMTimer = 1000 Then
       mmclock = mmclock + 1
       MMTimer = 0
    End If
    
    Form1.Text2.Text = mmclock
    Form1.Text3.Text = oo
    
    Next
End Sub







chnh
驱动小牛
驱动小牛
  • 注册日期2002-04-09
  • 最后登录2004-02-16
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
10楼#
发布于:2002-04-26 18:03
WinCE中达到1ms是没问题的
harktrip
驱动小牛
驱动小牛
  • 注册日期2003-11-30
  • 最后登录2016-01-09
  • 粉丝1
  • 关注0
  • 积分51分
  • 威望457点
  • 贡献值0点
  • 好评度170点
  • 原创分0分
  • 专家分2分
11楼#
发布于:2009-06-19 11:25
樓上幾個說不行的,你們也真是的

自己沒搞過 就說不行
游客

返回顶部