Difference between revisions of "UART RX"

From SpecNext official Wiki
Jump to: navigation, search
m
(fixing the port function description by text from current "ports.txt")
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
{{Port
 
{{Port
 
|Number=$143B
 
|Number=$143B
 +
|NumberDec=5179
 +
|PortMask=%0001 0100 0011 1011
 
|ShortDesc=Reads data from serial port, write sets the baudrate
 
|ShortDesc=Reads data from serial port, write sets the baudrate
 
|Readable=Yes
 
|Readable=Yes
 
|Writable=Yes
 
|Writable=Yes
 
|Subsystem=UART
 
|Subsystem=UART
|PortMask=%0001 0100 0011 1011
 
 
}}
 
}}
Reads data from serial port. Write to this port sets the speed of serial communication, see the table:
+
Read a byte from the receive buffer.  If the buffer is empty, 0 is returned.
 +
 
 +
Writes the lower 14-bits of the UART's prescalar value that determines baud rate
 +
: If bit 7 = 1
 +
::  bits 6:0 = upper 7-bits of the 14-bit prescalar value
 +
: If bit 7 = 0
 +
::  bits 6:0 = lower 7-bits of the 14-bit prescalar value
 +
 
 +
The UART's baud rate is determined by the prescalar according to this formula:
 +
: prescalar = Fsys / baudrate ; Fsys = system clock from {{NextRegNo|$11}}
  
0 = 115200 (default at reset)
+
Eg: If the system is HDMI, nextreg 0x11 indicates that Fsys = 27000000.  The prescalar for a baud rate of 115200 is 27000000 / 115200 = 234.
1 = 57600
 
2 = 38400
 
3 = 19200
 
4 = 9600
 
5 = 4800
 
6 = 2400
 

Latest revision as of 12:08, 4 May 2020

Number $143B
Decimal 5179
Short desc. Reads data from serial port, write sets the baudrate
Bit Mask %0001 0100 0011 1011
Readable Yes
Writable Yes
Subsystem UART

Read a byte from the receive buffer. If the buffer is empty, 0 is returned.

Writes the lower 14-bits of the UART's prescalar value that determines baud rate

If bit 7 = 1
bits 6:0 = upper 7-bits of the 14-bit prescalar value
If bit 7 = 0
bits 6:0 = lower 7-bits of the 14-bit prescalar value

The UART's baud rate is determined by the prescalar according to this formula:

prescalar = Fsys / baudrate ; Fsys = system clock from Video Timing Register ($11)

Eg: If the system is HDMI, nextreg 0x11 indicates that Fsys = 27000000. The prescalar for a baud rate of 115200 is 27000000 / 115200 = 234.