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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/09/02 02:02
Read: times


 
#19587 - RE: Using Timer 2 as Serial port baud rate?


George Ricketts wrote:
-------------------------------
Hi,

I need to use timer 2 to generate the baud rate for the serial port on the OKI 80C154.
I need to know what to set the RCLK and TCLK values to - whether I set them both to 1, or whether I set TCLK to 1 (and RCLK to 0) before sending and RCLK to 1 (and TCLK to 0) before receiving.
I think I just need set them both to 1, but i'm not 100% sure.
--- Set both to 1. If you do not set them both to 1, then one of them will use another source for baud rate. This is sometimes useful when receive/send is different baud.

Also, due to my assembler not recognising Timer 2, to access T2CON do I just do a:

MOV 0C8h,#XXX
--- Yes, but this is bad practise, so use an equate:
-- T2CON EQU 0C8h ; define SFR

and for independantly accessing TCLK and RCLK is it:

SETB 0C8h.4
CLR 0C8h.5
-- the right idea, but whether this works depends on your assembler, and you will want them both set
-- it might be SETB T2CON+4 ; enable T2 for Txd clock

-- but you can do 2 bits at once:
-- ORL T2CON, 30H ; Enable Timer 2 for Rxd + Txd clock - much better

I'm very new to assembly, so any help would be appreciated.

George

List of 16 messages in thread
TopicAuthorDate
Using Timer 2 as Serial port baud rate?            01/01/70 00:00      
RE: Using Timer 2 as Serial port baud rate?            01/01/70 00:00      
RE: Using Timer 2 as Serial port baud rate?            01/01/70 00:00      
RE: Using Timer 2 as Serial port baud rate?            01/01/70 00:00      
RE: Using Timer 2 as Serial port baud rate?            01/01/70 00:00      
RE: Using Timer 2 as Serial port baud rate?            01/01/70 00:00      
RE: Using Timer 2 as Serial port baud rate?            01/01/70 00:00      
RE: Using Timer 2 as Serial port baud rate?            01/01/70 00:00      
RE: Using Timer 2 as Serial port baud rate?            01/01/70 00:00      
RE: Using Timer 2 as Serial port baud rate?            01/01/70 00:00      
RE: Using Timer 2 as Serial port baud rate?            01/01/70 00:00      
RE: Using Timer 2 as Serial port baud rate?            01/01/70 00:00      
RE: Using Timer 2 as Serial port baud rate?            01/01/70 00:00      
RE: Using Timer 2 as Serial port baud rate?            01/01/70 00:00      
RE: Using Timer 2 as Serial port baud rate?            01/01/70 00:00      
RE: Using Timer 2 as Serial port baud rate?            01/01/70 00:00      

Back to Subject List