Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/10/05 10:17
Read: times


 
#84633 - UART mode 0
Responding to: ???'s previous message
hi,

Jan Waclawek said:
Mode 0 is in fact SPI;


No, it is not.
It is very similar as I have already said here: http://www.8052.com/forum/read.phtml?id=72516

However it is different. The main difference is that SPI defines that a data bit is put on data line at the one edge of SCK and latched at the opposite edge. Then data bit is still kept on data line until the next "shift" edge comes in.

UART mode 0 called "shift register" works with another way. It defines that a data bit is clocked in/out at the same edge. In fact, classic 8051 MCU shifts data in some time before rising edge (-2T) and shifts data out in some time after rising edge (+2T), where 12T is the shift period of a bit.

The situation goes worse from the fact that the classic 8051 does not allow us to variable shift clock frequency for UART mode 0. It is defined as OSC/32 or OSC/64 depend on bit SMOD of PCON register. It is not fatal when you use classic 8051 with low OSC frequency but goes nightmare with high-speed modern MCUs connected to slow SPI devices via UART mode 0. I have tested it myself and even it works for me, anyway I do suggest to check all timings strongly before use such connection.

Regards,
Oleg

List of 6 messages in thread
TopicAuthorDate
serial communication between two ATC51            01/01/70 00:00      
   'Mode 0' uses RxD and TxD differntly!            01/01/70 00:00      
      no slave in mode 0            01/01/70 00:00      
         UART mode 0            01/01/70 00:00      
            Call it serial            01/01/70 00:00      
               indeed, it is osc/12            01/01/70 00:00      

Back to Subject List