



















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




















Dept. of Electrical & Computer Engineering University of Houston
Let’s take the example of transmitting a byte of data:
Communications can be:
-3 to -15 v +3 to +15 v -3 to -15 v +3 to +15 v RS-232-C voltage levels Bit 0 follows the start bit.
E.g., MAX3232 Line Driver/Receiver
serial in/ out
Drivers written in C:
; File: sci_driver.asm ECE 4436ECE 4436 INCLUDE "sci.inc“ ; port definitions ; Initialize SCI to 1 start, 8 data and 1 stop ; bit, no parity and 9600 Baud. ; Inputs: None ; Outputs: None ;*************************************** XDEF init_sci, initsci init_sci: initsci: pshd ; Save D reg ; Set 1 start, 8 data and 1 stop bit bclr SCICR1,MODE ; Disable parity for no parity bclr SCICR1,PE ; Enable transmitter and receiver bset SCICR2,TE|RE ; Set Baud rate ldd #B std SCIBDH puld ; Restore D rts
; Put char to SCI ; Send data to SCI ; Inputs: B register = data to send ; Outputs: None ;*************************************** XDEF put_sci, putchar put_sci: putchar: ; Wait until the transmit data reg is empty spin_put: brclr SCISR1,TDRE,spin_put ; Output the data and reset TDRE stab SCIDRL rts