Sertxt problem

binary1248

Senior Member
When I use sertxt in this program, the first two ascii charcters are messed up.
But if I create a simple program to test the sertxt at the same baud rate it works ok.
I have tried many variations, but the first two characters are messed up.
This is what comes out on the terminal display:
I have a large delay between sertxt occurances.
.
Code:
[00]u[B4]e Value of B10 is==> 14 Var_out is==> 121
[00]u[B4]e Value of B10 is==> 16 Var_out is==> 122
[00]u[B4]e Value of B10 is==> 18 Var_out is==> 123
[00]u[B4]e Value of B10 is==> 20 Var_out is==> 124
[00]u[B4]e Value of B10 is==> 22 Var_out is==> 125
[00]u[B4]e Value of B10 is==> 24 Var_out is==> 126
[00]u[B4]e Value of B10 is==> 26 Var_out is==> 127
[00]u[B4]e Value of B10 is==> 2 Var_out is==> 55
[00]u[B4]e Value of B10 is==> 4 Var_out is==> 55
[00]u[B4]e Value of B10 is==> 6 Var_out is==> 55
Here is the code:

Code:
#rem
Speed test for read byte from table (eeprom) and write byte to port b
c\users\paul\desktop\
Feb 21 2017   PEH
  Make b.0 thru b.7 output byte port
 
#endrem

#picaxe	20X2
;setfreq	m64	'64mhz, 
'#no_data   'save some load time for now
;#no_table
#terminal 9600

symbol clk0=C.0	 ;pin 10 on chip, strobe DAC load pin
symbol var_out=b0	'	 byte to recieve data from eeprom

'
let dirsB = %11111111 ; 7 tru 0 as outputs
let dirsA = %00000001	;also port a for control signals out
let dirsC = %11111111	;and port c
;	HORZ is upper left screen, 255 ,255 is lower right, first digits of pair is  VERT, 2nd digit is HORZ
TABLE 0,(1,55,1,55,1,55,1,55,1,55,120,120,121,121,122,122,123,123,124,124,125,125,126,126,127,127,128,128,129,129,130,130,131,131,132,132)

	
	let pinsc = %10000001  ;preset write pin high and set HV on (C.7) 

repeat_all:
	let B10=0	;set intial location adx
notdone:  
       low A.0	;select DAC a, X2 signal, Horz

	  readtable B10,var_out ;read a byte to send to DAC, first byte of two
		
	let pinsb=var_out   ;......bit 0 is b.0,bit 1 is b.1 etc , write vertical DAC
	pulsout C.0,1 ; send a 500 ns pulse out of pin B.1 (cause we are at 64mhz)
	
	high A.0		;select DAC B, y2 signal, Vertical
  	inc B10
	readtable B10,var_out 
	let pinsb=var_out   ;......bit 0 is b.0,bit 1 is b.1 etc , write Horz DAC
	pulsout C.0,1 ; send a 500 ns pulse out of pin B.1 (cause we are at 64mhz)
	inc B10
	;
	'Hit F8 to bring up text screen
	sertxd ("The Value of B10 is==> ",#B10," Var_out is==> ",#var_out,13,10) ;In serial term window set baud rate to compensate for 64mHz later
	
	pause 1000   'slow to read values
	if B10>24 then goto repeat_all
	
 	goto notdone
 

AllyCat

Senior Member
Hi,

high A.0 ;select DAC B, y2 signal, Vertical
inc B10
readtable B10,var_out
let pinsb=var_out ;......bit 0 is b.0,bit 1 is b.1 etc , write Horz DAC
pulsout C.0,1 ; send a 500 ns pulse out of pin B.1 (cause we are at 64mhz)
inc B10
;
'Hit F8 to bring up text screen
sertxd ("The Value of B10 is==> ",#B10," Var_out is==> ",#var_out,13,10)
A.0 and SerOut are the same pin. You're leaving A.0 high whilst SERTXD needs to begin with the pin having been low for some time (High start pulse).

Cheers, Alan.
 

inglewoodpete

Senior Member
I notice that you are toggling A.0 in your code. On a 20X2 chip this is the SerOut pin, used for logging to the PE terminal via SerTxd command.

Edit: Beaten by a few seconds! Aren't you supposed to be in bed Alan?
 

binary1248

Senior Member
WOW, you all are brilliant, fixed the problem so I get clean output of sertxt. Thanks again.
.
I could have lived with the problem as sertxt is only used for debugging, but I wanted to know and now I do.

Paul
 

binary1248

Senior Member
It's a good thing the PICAXE editor has syntax checking!
Boy, isn't that he truth. Years ago I worked with a 3 pass compiler that you did your editing with a standard text editor, thus no syntax checking until you tried to compile. Fortunately I had a cute little secretary who learned to proof read my text for syntax error and she was good at about 95% error free corrected text.
For those wondering about a 3 pass assy. (Paper tape days)
Pass 1 => Creates internal symbol/address table. (Because during this pass it doesn't know the forward label references yet)
Pass 2 ==> creates printable listing for copy/debugging/markup
Pass 3 ==> Creates binary downloadable code
 
Last edited:

stan74

Senior Member
headache? take nothing, because nothing acts faster than Sertx...availiable in your pharmacist or any good chemists.
 
Top