Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 00:23 06 Jul 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : com2 close error?

Author Message
drkl

Senior Member

Joined: 18/10/2015
Location: Hungary
Posts: 102
Posted: 09:38pm 29 May 2016
Copy link to clipboard 
Print this post

Hello everybody,


mm44,ver5.2
The code:

open "com2:9600" as #1 'MM44: pin30-TX PIN31-RX
close #1
setpin 30, off


The error message:
[3] SetPin 30, off
Error: Pin 30 is in use

What is the error?

drkl


 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2932
Posted: 09:48pm 29 May 2016
Copy link to clipboard 
Print this post

Not by a MM at the moment. Out of interest what happens if you add a PAUSE (try 1000) after the CLOSE line and before the SETPIN?Edited by WhiteWizzard 2016-05-31
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9588
Posted: 09:59pm 29 May 2016
Copy link to clipboard 
Print this post

I would also agree with WW - a small pause - probably 100ms would be enough between your close #1 and setpin 30 would most likely get around that issue.
Smoke makes things work. When the smoke gets out, it stops!
 
jwaldha
Newbie

Joined: 14/01/2016
Location: Hungary
Posts: 10
Posted: 10:13pm 29 May 2016
Copy link to clipboard 
Print this post

I think this is a bug in the firmware in the line 255 of the MX170/Serial.c:

if(ExtCurrentConfig[COM2_RX_PIN] == EXT_COM_RESERVED) ExtCfg(COM2_TX_PIN, EXT_NOT_CONFIG, 0);


The correct line:

if(ExtCurrentConfig[COM2_TX_PIN] == EXT_COM_RESERVED) ExtCfg(COM2_TX_PIN, EXT_NOT_CONFIG, 0);


---
JWaldha
---
JWaldha
 
drkl

Senior Member

Joined: 18/10/2015
Location: Hungary
Posts: 102
Posted: 10:13pm 29 May 2016
Copy link to clipboard 
Print this post

Sorry,
the delay doesn't solved the problem.
May it be a firmware bug?
drkl
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3282
Posted: 11:58pm 30 May 2016
Copy link to clipboard 
Print this post

It is a bug!
Thanks very much, your test program made it so easy to find.

It will be fixed in the next release.

Geoff
Geoff Graham - http://geoffg.net
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025