Problem using SERRXD, Disconnect and reconnect

BobMcNobby

Senior Member
Hi, I have written some code for 28x2 so that I can use the AXE27 USB/serial lead for data on the Serin/Serout pins (as per programming)

When I send a byte from the Programming Editor Terminal program, my picaxe appears to RESET
I have tried the disconnect/reconnect in various different ways, but I cant stop my software resetting as soon as a byte is received

I have even simplified the code to just...
SERRXD [1000,timeout_jump], b1
...and it still does the same

Anyone else had trouble with this or know a solution ??

Thanks in advance

Bob
 

nick12ab

Senior Member
Check the wiring on the Reset pin and whether you have a decoupling capacitor.

What about with no timeout at all in the serrxd command? Does it work then if you do that?
 

SAborn

Senior Member
Just dont use reconnect, as what is happening is you reconnect and send a byte before the picaxe has reached the line of code that instructs the disconnect, so the picaxe goes into download mode thinking there is a download comming and appears to reset.

By staying disconnected should solve the problem, but will require a hard reset to download a new program.
 

MartinM57

Moderator
I think you need to post the WHOLE of a minimalist program that shows the problem (and tell us how you know it is resetting) to progress further...
 

SAborn

Senior Member
I can only think you have a hardware problem then, as i have used serial in and out commands in several projects and not had the problem you report.

Check the tracks on your pcb for bridges, there may be a hair fine bridge causing the problem. (its taken me days to find a micro fine bridge in the past)

Try this test to see if it works for you.

Code:
#terminal 4800
Main:

serrxd [100],b1

if b1 = "X" then
sertxd ("Well that worked",13,10)
endif

b1 = 0

goto main
you will need to send out a upper case X to receive a message back,
 

BobMcNobby

Senior Member
thanks all, i dont have a problem getting comms working, I can send from terminal and get my replay as expected, its just that as it does it my program gets reset
I can tell cos I have a green/red led for 'mode' and if I select mode 2 and send a byte it goes back to mode 1. Definately NOT software doing this I am 100% sure there is a reset going on
 

SAborn

Senior Member
If the above test works then its a error in your program (which you refuse to post so far) or its a hardware problem (to which we have no schematic to) so if you want answers then give us the tools to work with, or we are just peeing on the Xmas tree trying to solve the Santa question.

Me......... i think Santa do exist ? what do you think? :confused:
 

BobMcNobby

Senior Member
Just typed a great long reply (with code) and pressed the wrong button !!! grrrrr

Anyway I have sorted it out now thanks to SABorns bit of code, so now I have this that works

Code:
	SERRXD [1000,RX_Cont], ("$"), temp1, temp2		
	if temp1 = "L" and temp2 = "D" then LOAD_Command 
	if temp1 = "C" and temp2 = "L" then CLEAR_Command 
RX_Cont:
Thank you
 
Top