ModCom giving port error

StigOfTheDump

Senior Member
Hi
I am trying to interface a 20M2 with ModCom v8.14. I have nothing connected to the 20M2 except the download circuit.
http://www.weedtech.com/software.html
I have programmed the 20M2 with Anobium's sample code from his Youtube tutorial.
http://www.youtube.com/watch?v=nFR6rzWjU4U
Code:
[color=Blue]setfreq m8
symbol [/color][color=Black]counter [/color][color=DarkCyan]= [/color][color=Purple]b0[/color]
[color=Black]counter [/color][color=DarkCyan]= [/color][color=Navy]0[/color]

[color=Black]Main:[/color]

[color=Green]'sertxd (#b0,13,10)[/color]
[color=Blue]sertxd ([/color][color=Red]"ABC"[/color][color=Black],#[/color][color=Purple]b0[/color][color=Black],[/color][color=Navy]13[/color][color=Black],[/color][color=Navy]10[/color][color=Blue])
pause [/color][color=Navy]200[/color]
[color=Blue]inc [/color][color=Black]counter[/color]

[color=Blue]goto [/color][color=Black]Main[/color]
I kept getting an error "Com5 could not be accessed or is not responding" when I tried to run the ModCom.

On one occasion whilst starting/stopping/plugging and unplugging things in different orders, the ModCom displayed some data before the above error came. That was when I plugged the AXE027 into my download socket whilst ModCom was already running and the AXE027 already plugged into the laptop. I found that if I didn't plug the AXE027 fully home it worked. I have set up the download interface on my breadboard and the ModCom works until I connect the serial in wire of the AXE027 (wire b of the download diagram on manual 1 page 8) to the junction of the 2 resistors. Then I get the error.

Any ideas, anyone?

Eventually I hope to have ModCom (or similar) running on ERF/URF.
 

hippy

Technical Support
Staff member
It sounds like a possible construction or wiring error, or maybe just a loose connection to the breadboard.

With the PICAXE programmed, what does opening Terminal in Programming Editor (9600 baud) show ?

That should show ABC0, ABC1, ABC2 etc each on separate lines.

Have you set the ModCom software to look for "ABC" as described in the video?

Try making sure Programming Editor is closed and AXE027 is connected to PC and PICAXE before starting the ModCom software.
 
Last edited:

StigOfTheDump

Senior Member
Hi Hippy
I have created a complete new set-up. New 20M2 and socket, different AXE027 and breadboard. Still the same problem. The only thing that the 2 set-ups have in common is the laptop.
Yes I get the ABC0, ABC1 in terminal with both set-ups.

I have changed to a different USB port, same problem on both set-ups. PE was closed before ModCom was opened.
 

neiltechspec

Senior Member
Sounds like ModCom is driving serin high & stoppng the PIC in its tracks.

Try something simple like "putty" & see what that shows.

Neil.
 

StigOfTheDump

Senior Member
Try something simple like "putty" & see what that shows.
Hi Neil

I get the ABC0,ABC1 with putty, same as the picaxe terminal.

I now have 2 ModCom set-ups running on 2 computers, but both have this com error when the serial in wire is connected. Both read and display the data from the picaxe when the serial in wire is disconnected. I have also tried with either/both picaxe and laptops running on batteries. Just the same.

Got one set-up updating at 1/sec. With the serial in disconnected the ModCom is updating my dial gauge once per sec. With my DP scope on the disconnected serial in wire from the AXE027 I get a burst of data once per second (the same each time) then it goes low again.
Serial In from MoDCom.jpg
 
Last edited:

neiltechspec

Senior Member
Perhaps you need to take that up with whoever produces "ModCom".

Sounds like iffy S/W to me, if it's sending rogue bytes. Or maybe a config issue of course.

Neil
 

hippy

Technical Support
Staff member
Sounds like ModCom is driving serin high & stoppng the PIC in its tracks.
Perhaps sending data to wake-up whatever is connected ?

There might be an option to set it to not send anything if that is the case.

Adding a DISCONNECT at the start of the PICAXE program will ignore any data sent, but you will have to power-cycle / Hard Reset for subsequent downloads.
 

neiltechspec

Senior Member
Doubt you will be able to stop it sending that data, as it's designed to work with specific serial interface modules from the S/W writer.

So like hippy said, use a "disconnect" at the beginning, so PICAXE will ignore serin data unless a hard reset is applied.

Neil.
 

StigOfTheDump

Senior Member
Thanks, that fixed it.

I was thinking that I had given you the wrong impression. The picaxe had kept running, it was just the MoDCom reporting the com error. When I experimented removing the serial in wire in terminal, it carried on counting. But if I removed the 22k download resistor, still in terminal, it threw out a few lines of [00][FF] then started counting from ABC0 again. Same when I refitted the resistor.

Now with the DISCONNECT and everything set up as normal, it is working fine. I think there must have been some sequence in that data that tricked the picaxe into expecting a new download. Or is it any data on that pin will trigger a download unless serrxd is in use?
 

hippy

Technical Support
Staff member
Now with the DISCONNECT and everything set up as normal, it is working fine. I think there must have been some sequence in that data that tricked the picaxe into expecting a new download. Or is it any data on that pin will trigger a download unless serrxd is in use?
The Serial In download pin going high tells the PICAXE there has been a download initiated, so any data sent to it can convince it there's a download to come, effectively resetting it and stopping it from running its program.

DISCONNECT ( implicit in SERRXD ) tells the PICAXE to ignore the pin going high, which of course also prevents real downloads, hence the Hard Reset becoming necessary.

An alternative trick is to put a link between Serial In pin to 0V. Close that to prevent downloads, open to allow them. That shorts the serial via 22K ( paralleled with the 10K ) to 0V but shouldn't cause any damage to the cable.
 

Goeytex

Senior Member
I had been wanting to test Modcom for a while so this thread motivated me to do so. Instead of using the download cable (AXE027) for communication, I used a cheap $3 CP2102 USB/TTL adapter for communication between the Picaxe and the Modcom SW using serin/serout. This way there is no chance conflicts. The AXE027 can remain connected and the PE terminal can be used concurrently with ModCom.

The Modcom software works very nicely under this configuration.
 
Top