473,325 Members | 2,712 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

WinCE COM port doesn't work on low baud rates


I am working on some program that has to comunicate at low baud rates.
Problem is that data is sometime transmitted, and sometime not. There
is no pattern in that.
I tried it on HP6515 and Toradex Colibri evaluation board. HP6515 is
Pocket PC 2003, and Colibri is WM 5.0. I tried that from VS2003, and
VS2005. It is allways the same. I tried new System.IO.Ports.SerialPort
control in CF2. The problem persist.
I put some wireing connected to COM port and HyperTerminal to listen
data between PDA and my device. I even put osciloscope on TX line that
is triggered wit RTS line that goes high to make sure that data is
transmitted or not. Sometimes there is no data.
On baud rates higher than 2400 (4800,9600,19200...) the code work OK.

Here is my sample code. Just place new class in your project, and call
it with
Dim comTemp as New Comm
comTemp.SendData("Some data")
Public Class Comm
Private WithEvents COMctl As OpenNETCF.IO.Serial.Port
Public Sub OpenPort()
Dim setTemp As New OpenNETCF.IO.Serial.HandshakeNone

'Set port to 300 7 E 1
setTemp.BasicSettings.BaudRate =
OpenNETCF.IO.Serial.BaudRates.CBR_300
setTemp.BasicSettings.ByteSize = 7
setTemp.BasicSettings.Parity = OpenNETCF.IO.Serial.Parity.even
setTemp.BasicSettings.StopBits =
OpenNETCF.IO.Serial.StopBits.one

Me.COMctl = New OpenNETCF.IO.Serial.Port("COM1:", setTemp)
Me.COMctl.Open()

Me.COMctl.DTREnable = True 'DTR line drives device connected
on COM1
End Sub

Public Sub ClosePort()
Me.COMctl.DTREnable = False
Me.COMctl.Close()
Me.COMctl.Dispose()
MyBase.Finalize()
End Sub
Public Sub SendData(ByVal strOut As String)
Call OpenPort()
Dim buf() As Byte
buf = System.Text.ASCIIEncoding.ASCII.GetBytes(strOut)
Me.COMctl.RTSEnable = True 'needed to trigger osciloscope
COMctl.Output = buf
System.Threading.Thread.Sleep(500)
Me.COMctl.RTSEnable = False
Call ClosePort()
End Sub
End Class

Sep 15 '06 #1
0 1492

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Mathew | last post by:
I am looking to write a program with Microsoft Visual Basic 6 that writes out to the com port. After the inital Connection. I will be connecting at 9600, 8 data bits, with hardware flow control. ...
8
by: engsol | last post by:
Has anyone done a script that will rspond to the serial com port(s) receive buffer interrupt, as opposed to polling and timeouts? Win2000 is the main interest right now. Thanks Norm B
3
by: rusttree | last post by:
Many moons ago, I took a class in embedded control at school. The course focused on a micro-controller mounted on a small electric car that was programmed using simple C code. The...
0
by: Alex | last post by:
Hi, I'm new at this serial port thing and I'm developing an App to receive data from the serial port, but the transmission baud rate must be of 460800 bps or higher, so my question is: is it...
2
by: badsha | last post by:
Hello, If I try to set com port to baud rate higher than 115200pbs using SetCommState() API, it returns with an error. The error code is 87 which means INVALID_PARAMETER. I tried using 128000 bps...
3
by: pcm | last post by:
Hi, Has anyone ever worked on a Python-WinCE-based program that involved serial port management ? Regards, Philippe
4
by: H J van Rooyen | last post by:
Hi All, I am writing a polling controller for an RS-485 line that has several addressable devices connected. It is a small access control system. All is well- the code runs for anything from...
7
by: davetelling | last post by:
I'm a newbie that is still struggling with OOP concepts & how to make things work they way I want. Using Visual C# Express, I have a form in which I added a user control to display a graph, based...
6
by: anu29dolly | last post by:
Hello everyone... I have written a program to write and read data from serial port.... I am able to write 80(in binary)..and is expecting 1B but i am uable to read it... My code goes as...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.