Serial Connector (9 way D)



Output via serial

The following program will output serial data at 2400 baud which reports the incrementing value of the byte variable 'b0' every second. As the serial signal goes directly to a 9-way D the polarity of the serial is 'normal' so an 'n2400' baud rate is used. Because an 8-bit byte variable is used, after the number reaches 255, the next increment will take its value to zero.

Code Example:
main:	serout B.1, n2400, ( #b0, CR, LF )	; Output a number value
	pause 1000				; Wait for 1 second
	b0 = b0 + 1				; Next number to output
	goto main				; Output the next number
Copy Code Submit an Example

Create Module

No Image Selected

Bill of Materials

9-way D socket ( right angle PCB mounting, female ) CON025 1 Buy Now
10k resistor (pack 100) RES10K 1 Buy Now
22k resistor (pack 100) RES22K 1 Buy Now


No Image Selected

Submit Your Own Code!

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