HSEROUT break, ({#}data,{#}data...)

Break - is a variable/constant (0 or1) which indicates whether to send a 'break' (wake-up) signal before the data is sent.

Data - are variables/constants (0-255) which provide the data to be output. Optional #'s are for outputting ASCII decimal numbers, rather than raw characters. Text can be enclosed in speech marks ("Hello")


Transmit serial data via the hardware serial output pin (8 data bits, no parity, 1 stop bit).

The hserout command is used to transmit serial data from the fixed hardware serial output pin of the microcontroller.  Polarity and baud rate are defined by the hsersetup command, which must be issued before this command can be used.

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 byte '126'.

On the PICAXE-08M2 and 14M2; the 'hserout' pin is the same as the download serial out pin. This means 'hserout' can be used to send data back to the PC through the download cable in a similar way to using sertxd commands. When 'hserout' output is enabled on the 08M2 and 14M2 any 'sertxd' commands will have no effect, will not output any data.

On other PICAXE devices the 'hserout' pin is separate to the download serial out pin so, to send data back to the PC through the download cable, the sertxd command should be used.

Applies To:
08M2, 14M2, 18M2, 20M2, 20X2, 28X1, 28X2, 40X1, 40X2
See Also:
Related Create:

Read EEPROM data and transmit it via serial

Transfer the values stored in EEPROM location 0 to 63 to a serial LCD at 2400 baud

Code Example:
	hsersetup B2400_4, %10	; 2400 baud, inverted polarity

main:	for b0 = 0 to 63	; start a loop
	  read b0,b1		; read value into b1
	  hserout 0,(b1)	; transmit value to serial LCD
	next b0			; next loop
Copy Code Submit an Example

Submit Your Own Code!

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