我使用pb定製作業系統時只能新增三個串列埠,在定製的wince上執行串列埠測試程式發現,我開啟***1:後操作的是物理串列埠2,收發資料正常。開啟***2:操作的為物理串列埠3,傳送一次資料後程式無響應。可以開啟***3:,但不能收發資料。
我到網上的相關**搜尋了一下,得知物理串列埠1是用來除錯用的,正常情況下,我們的應用程式不能夠訪問。
我在登錄檔中查到的wince下的三個串列埠設定為:
[hkey_local_machine/drivers/builtin/serial]
sysintr=dword:13 //10h+3
iobase=dword:02f8h
iolen=dword:8
prefix="***"
dll="***16550.dll"
devicearrayindex=dword:0
order=dword:0
priority=dword:0
[hkey_local_machine/drivers/builtin/serial2]
sysintr=dword:14 //10h+4
iobase=dword:03e8
iolen=dword:8
prefix="***"
dll="***16550.dll"
devicearrayindex=dword:0
order=dword:0
[hkey_local_machine]-[drivers]-[builtin]-[serial3]
sysintr=dword:15 //10h+5
iobase=dword:02e8
iolen=dword:8
prefix="***"
dll="***16550.dll"
devicearrayindex=dword:0
order=dword:0
我把登錄檔中的三個串列埠的sysintr和iobase分別改為與物理串列埠2,3,4相對應。如下:
[hkey_local_machine/drivers/builtin/serial]
sysintr=dword:13 //10h+3
iobase=dword:02f8h
iolen=dword:8
prefix="***"
dll="***16550.dll"
devicearrayindex=dword:0
order=dword:0
priority=dword:0
[hkey_local_machine/drivers/builtin/serial2]
sysintr=dword:1a //10h+10
iobase=dword:03e8
iolen=dword:8
prefix="***"
dll="***16550.dll"
devicearrayindex=dword:0
order=dword:0
[hkey_local_machine/drivers/builtin/serial3]
sysintr=dword:1b //10h+11
iobase=dword:02e8
iolen=dword:8
prefix="***"
dll="***16550.dll"
devicearrayindex=dword:0
order=dword:0
執行測試程式結果與剛才還是一樣,為什麼***1正常,而***2與***3卻不正常呢,我發現登錄檔中***1的鍵比***2/***3多出了乙個priority鍵,是不是問題處在這裡?我在***2和***3的登錄檔項中都新增了priority鍵,鍵值為0。執行測試程式發現:3個串列埠都能正常開啟關閉,也能夠正常收發資料,但又出現了新的問題:***1對應成了物理串列埠4,***2對應物理串列埠3,***3對應物理串列埠2。這個問題還是以後再說吧。
WINCE下如何虛擬多個串列埠
應用背景 我們的產品是gps產品,gps模組是通過tx與rx來和cpu串列埠控制器的uart2連線的,對應於com3 這個可以根據自己的專案的需要來定 platform.reg中登錄檔資訊如下 gps uart2 com3 hkey local machine drivers builtin ser...
WINCE下如何虛擬多個串列埠
應用背景 我們的產品是gps 產品,gps 模組是通過tx與 rx來和 cpu串列埠控制器的 uart2 連線的,對應於 com3 這個可以根據自己的專案的需要來定 platform.reg 中登錄檔資訊如下 gps uart2 com 3 hkey local machine drivers bu...
Win CE串列埠通訊
今天學習了wince下的串列埠通訊實驗。現小結如下 1。裝置檔名 裝置檔名字首由3個大寫字母組成,用來標識與特殊流介面驅動程式相對應的特殊裝置檔名。檔名字首儲存在登錄檔的相應驅動程式的鍵值中。如com 序列驅動程式 acm 音訊壓縮管理器 等。2。訪問裝置驅動方法 通過createfile read...