My question is about the USART module in the LPC8xx series microcontrollers. If the USART is transmitting in synchronous mode, does the signal transition on the rising or falling edge of SCLK, i.e. should the receiver sample it on the falling or rising edge of SCLK? I can't find this information in the User's Guide. The guide mentions CLKPOL (bit 12 in the USART config register), which determines the clock edge used by the receiver. Does this bit also affect the transmitter, or is there some other way to select the edge? If CLKPOL also affects the transmitter, I would assume the signal transition would happen on the opposite edge, so that similarly configured devices could communicate with each other.
Hi Johan Myréen,
TIC
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Well, to be precise, a bit will not occupy the complete period of SCLK: it is not valid for a period of time around the clock edge when the output changes state (transitions). It is not made clear in the User Manual which edge polarity should be used, but I can see now from the diagram above that a bit should be sampled on the rising edge of SCLK if CLKPOL = 1. The User Manual only mentions "received data" in the description of CLKPOL, maybe the manual should be edited to mention that it also affects how sent data is clocked out?