Serial communication between two picaxe via serrxd and sertxd

I am using serrxd and sertxd to communicate between a picaxe (08m2) and a pc program to change some parameters of the picaxe program, which are strored in the eeprom of the pic. The picaxe subprogram for the communication is called only one time at the very beginning of the program. To open the communication at any time at first I send at serial message from the pc to the picaxe, which causes that the picaxe will restart and then do the special programmed communication in the subprogram. That all works very well.
The picaxe project is a control line flight timer, which controls the ESC for a electric motor via servo and servopos. Because I wanted to change the parameters of the timer on the airfield without using a laptop, I build a little programming box with a picaxe 08m2, which makes the same communication with the timer just like the pc program. I built several of this boxes which all performed as mentioned. But since a while new exemplars of the timer built with the same pcb and picaxe chips bought a short time ago do not longer make a restart, when I send a serial message from the progbox to the timer, for which reason the following communication to change the parameters of the timer fails.
Because I did not made any change neither in the program of the timer nor in the program of the programming box I have no idea, what could be the reason, especially not, because the pc program furthermore works. Unfortunately I have no more of the older timers, because I sold them all.
Has anyone a idea?
 

srnet

Senior Member
You stand a far better chance of getting help if you post the circuit diagram and code.

And are you absolutely sure there have been no changes, to code, wiring, components or construction, even minor changes that one might assume are of no consequence ?
 
Code snip from timer program:
Code:
'******************** Konfiguration an PC ausgeben und von PC lesen *****************************

konfig:
	disconnect													'zwecks Eröffnen der seriellen Kommunikation"
konfig_eingabe:
  serrxd [1000, timeout],b0,b1,b2			'maximal 1 Sekunde auf serielle Kommunikation warten
  select case b0
    case "l"													'PC will Konfig lesen
      'pause 100
      sertxd ("Konfig:")							'Prefix ausgeben
    for bptr = 14 to 26
  	    sertxd (#@bptr, ",")					'Werte ausgeben
  	  next
  	  sertxd (13,10)									'cr + lf ausgeben
		case "s"													'PC will Konfig schreiben
	    gosub lesen_konfig							'Konfiguration vom PC abholen
 		 	gosub lesen_speicher						'Speicherwerte in Variablen übernehmen
	    pause 50
    	sertxd ("o.k.",13,10)						'o,k. Quittung an PC senden
		case "r"													'Progbox will Konfig lesen
    	pause 100
    	sertxd ("Konfig:")
    	for bptr = 14 to 26							'Ausgabe Direktwert
      	sertxd (@bptr)
    	next
    case "w"													'Progbox will Konfig schreiben
			serrxd b14,b15,b16,b17,b18,b19,b20,b21,b22,b23,b24,b25,b26
			gosub schreiben_speicher
      pause 50
    	sertxd ("o.k.")									'o,k. Quittung an Progbox schicken  
		case "q" 
      pause 200
      sertxd ("com quit", 13,10)      'Abschlussquittung an PC senden
    else
      pause 200
    	sertxd ("err", 13,10)						'Fehlerquittung an PC senden
	endselect
  goto konfig_eingabe

timeout:
	reconnect														'Serielle Kommunikation beenden	Programmdownload wieder möglich  
	return

'***************** Serielles Lesen der Konfiguratiosdaten *************************

lesen_konfig:
  for b0 = 0 to 12			'12 Einzelwerte inkl. CR + LF
		serrxd b1,b2,b3			'vom PC lesen (Inhalt siehe oben)
    write b0,b1					'und in den nicht flüchtigen Speicher schreiben
	next
	return

'**************** Daten aus nichtflüchtigem Speicher in Variablen übernehmen

lesen_speicher:
  bptr = 14														'Adresspointer auf Variable b14
  for b0 = 0 to 12
  	read b0,@bptr											'Speicherwerte für späteren Gebrauch in Variablen übernehmen
    bptr = bptr + 1										'Adresspointer erhöhen
  next
	return

'**************** Daten aus den Variablen in den nichtflüchtigen Speicher übernehmen

schreiben_speicher:
	bptr = 14
	for b0 = 0 to 12
    write b0,@bptr
    bptr = bptr + 1
  next
return
Code snip from programming box:

Code:
up_lesen:
  poke 30,disp_select
  disconnect
  gosub cld
  serout tx_display,tx_speed, (1,"suche FFS",2,"bitte warten")
  'pause 1000
  sertxd ("r",13,10)
  pause 100
  sertxd ("r",13,10)
  pause 100
  sertxd ("r",13,10)
  pause 100
  sertxd ("r",13,10)

#rem
Das Lesen funktioniert nur in der u.a. Form. Eine Schleife mit Adresspointer führt leider
nicht zum Ziel. Hängt wohl mit der zeitlichen Synchronisation zusammen
#endrem

  serrxd [2000,up_lesen_timeout], ("Konfig:"), b14,b15,b16,b17,b18,b19,b20,b21,b22,b23,b24,b25,b26
  reconnect
  pstat = ps_motor_min
  pstat_alt = ps_haupt_menue	'Falls 2 x hintereinander Lesen gedrückt wird, wird ohne diesen Befehl im 
															'up_soll_rpm kein Statuswechsel erkannt und damit kein Text ausgegeben.
  goto up_lesen_ret
  
up_lesen_timeout:
  gosub cld
  serout tx_display,tx_speed, (1, "kein FFS",2,"gefunden")
  pause 5000
  pstat = ps_haupt_menue
up_lesen_ret:
  reconnect
  return
Not shown in the circuit diagram of the timer is a tantal 22 uF cap between + and - of the picaxe, which was necassary after using m2 parts.
I dont have a circuit diagram of the programmer box, but only the design of the circuit board.
 

Attachments

Last edited:
Top