Name:
sertxd
Syntax:

SERTXD ({#}data,{#}data...)

Data - are variables/constants (0-255) which provide the data to be output.

Description:

Serial output via the serout programming pin (baud 4800, 8 data, no parity, 1 stop).

The sertxd command is similar to the serout command, but acts via the serial output pin rather than a general output pin, and at a fixed baud rate. This allows data to be sent back to the computer via the programming cable. This can be useful whilst debugging data - view the uploaded data in the PICAXE>Terminal window.

There is an option within View>Options>Options to automatically open the Terminal windows after a download. The baud rate is fixed at 4800,n,8,1 (9600,n,8,1 on X2 parts)

The # symbol allows ASCII output. Therefore #b1, when b1 contains the data 126, will output the ascii characters "1" "2" "6" rather than the raw data 126. The # symbol can also be used with word, bit and input pin variables.

Effect of Increased Clock Speed

Increasing the clock speed increases the serial baud rate as shown below (non X2 parts).

4MHz 4800
8MHz 9600
16MHz 19200
32MHz 38400
64MHz 76800
Applies To:
All (except 08, 18, 28, 28A)
See Also:
Related Create:
Share:
Print:

Send serial data to a computer

Send the value of b1 in ascii format to a computer connected to the programming connector

Code Example:
main:	for b1 = 0 to 63				; start a loop
	  sertxd("The value of b1 is ",#b1,13,10)
	  pause 1000
	next b1						; next loop
Copy Code Submit an Example

Submit Your Own Code!

You must be logged in to submit code examples. Login now.

Comments

  • Login to leave a comment.