Monitoring the UART RX signal

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Monitoring the UART RX signal

502 Views
RogerC52
Contributor I

I want to be able to read the logic level on the UART1 RX pin while the pin is assigned to the UART RX function (not as a GPIO). The SCI peripheral in the MC9S08 MCUs allows me to do this (the reference manual says so explicitly). I can't find any similar statement in the MCF5329 reference manual. If I set the PAR_U1RXD bits to 11 to map the pin to its RX function and clear the PDDR_UART bit for this pin to make it an input, will I get the pin's logic level when I read the PPDSDR_UART register? Thanks!

Labels (1)
0 Kudos
1 Reply

271 Views
TomE
Specialist II

 

13.3.3 Port Pin Data/Set Data Registers (PPDSDR_x)The PPDSDR registers reflect the current pin states and control thesetting of output pins when the pin is configured for GPIO.

That is ambiguous. It could be read as either:

 

(The PPDSDR registers reflect the current pin states and control the setting of output pins) when the pin is configured for GPIO.

 

Or

 

The PPDSDR registers reflect the current pin states and (control the setting of output pins when the pin is configured for GPIO).

 

Reading a PPDSDR_x register returns the current state of the port x pins.

 That implies it reads the pin all the time.

 

13.4 Functional Description13.4.1 OverviewReading a PPDSDR_x register returns the current state of the correspondingpins when configured as general purpose I/O, regardless of whether thepins are inputs or outputs.

13.4.2 Port Digital I/O Timing
Input data on all pins configured as general purpose input is synchronized to the rising edge of the bus
clock, FB_CLK, as shown in...

That implies you can only read GPIO pins.  It would help our understanding if this chapter had a circuit diagram like there is at the start of Chapter 15 for the EPORT module.

 

You'll just have to test it yourself. Please let us know what you find. You might have to parallel another GPIO pin with the UART RX pin in order to read the state.

 

If you want to detect whether the serial port is connected or not, read it as a GPIO until you see it driven, then program as a UART. Then when the UART detects a BREAK, program back to a GPIO and wait unitl it is driven again.

 

Tom

 

 

 

 

 

 

0 Kudos