Jeremy Leach
Senior Member
Hello everyone.
I've got a puzzle with an 18M2 (firmware PICAXE-18M2+ vD.A, PICAXE running atdefault 4MHz) where I'm sending "RTSHi" from my laptop as a test (over an AXE027 cable) and :
SERRXD [5000,CommsTimeout],b6,b7,b8,b9,b10 works fine and loads up R,T,S,H,i
However SERRXD [5000,CommsTimeout],("RTS"),b6,b7 always times out.
If I reduce the qualifier to just "*" then it doesn't block but the loaded data is corrupted.
It looks as if adding the qualifier causes an internal processing delay somehow on the PICAXE, which causes a timing problem. However I'm just guessing.
Does anyone have any ideas? It might well be me missing something obvious though ! It's not essential for me to use a qualifier but it would be nice to understand the issue. Thanks.
Just in case it has any relevance, my VB.NET sending code is :
Dim WithEvents ComPort As New IO.Ports.SerialPort
With ComPort
If .IsOpen Then .Close()
.PortName = My.Settings.com_port
.BaudRate = 4800 ' 4800 'Speed for18M2 at 4MHz
.Parity = IO.Ports.Parity.None
.DataBits = 8
.StopBits = IO.Ports.StopBits.One
.ReadTimeout = 5000
.Open()
.DiscardOutBuffer()
End With
Dim WritePacket() As Byte
WritePacket = Encoding.ASCII.GetBytes("RTSHi")
ComPort.Write(WritePacket, 0, 5)
I've got a puzzle with an 18M2 (firmware PICAXE-18M2+ vD.A, PICAXE running atdefault 4MHz) where I'm sending "RTSHi" from my laptop as a test (over an AXE027 cable) and :
SERRXD [5000,CommsTimeout],b6,b7,b8,b9,b10 works fine and loads up R,T,S,H,i
However SERRXD [5000,CommsTimeout],("RTS"),b6,b7 always times out.
If I reduce the qualifier to just "*" then it doesn't block but the loaded data is corrupted.
It looks as if adding the qualifier causes an internal processing delay somehow on the PICAXE, which causes a timing problem. However I'm just guessing.
Does anyone have any ideas? It might well be me missing something obvious though ! It's not essential for me to use a qualifier but it would be nice to understand the issue. Thanks.
Just in case it has any relevance, my VB.NET sending code is :
Dim WithEvents ComPort As New IO.Ports.SerialPort
With ComPort
If .IsOpen Then .Close()
.PortName = My.Settings.com_port
.BaudRate = 4800 ' 4800 'Speed for18M2 at 4MHz
.Parity = IO.Ports.Parity.None
.DataBits = 8
.StopBits = IO.Ports.StopBits.One
.ReadTimeout = 5000
.Open()
.DiscardOutBuffer()
End With
Dim WritePacket() As Byte
WritePacket = Encoding.ASCII.GetBytes("RTSHi")
ComPort.Write(WritePacket, 0, 5)