Mar 17, 2009 #1 J johannf Newbie level 1 Joined Mar 17, 2009 Messages 1 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,281 Activity points 1,286 sending via uart hey guyz, i need to send this via 8051 uart 0xF5 0x0C 0 0 0 0 0x0C 0xF5 can someone help me with the codes?......... asm or c is welcome.......
sending via uart hey guyz, i need to send this via 8051 uart 0xF5 0x0C 0 0 0 0 0x0C 0xF5 can someone help me with the codes?......... asm or c is welcome.......
Mar 18, 2009 #2 saeed_pk Full Member level 4 Joined May 20, 2006 Messages 237 Helped 35 Reputation 68 Reaction score 28 Trophy points 1,308 Location Islamabad, Pakistan Activity points 2,655 sending via uart make a serial port routine like 'TransmitChar(uchar); and transmit every Character.
Mar 18, 2009 #3 S stefanSK Junior Member level 1 Joined Jun 23, 2006 Messages 15 Helped 3 Reputation 6 Reaction score 1 Trophy points 1,283 Location Slovakia Activity points 1,352 Re: sending via uart example: msg: db 0F5h,0Ch,0,0,0,0,0Ch,0F5H msglen equ $-msg+1 ; 8 . . . start: mov sp,#SP_START mov TL1,#0FDh ; baude mov TH1,TL1 ; mov TMOD,#21h ; T1 mode 2 setb tr1 ; start timer mov SCON,#50h ; clr ea . . . mov dptr,#msg mov r1,#msglen setb ti acall send . . . . . send: clr a movc a,a+@dptr jnb $ ; wait end transmit clr ti mov sbuf,a inc dptr djnz r1, send ret
Re: sending via uart example: msg: db 0F5h,0Ch,0,0,0,0,0Ch,0F5H msglen equ $-msg+1 ; 8 . . . start: mov sp,#SP_START mov TL1,#0FDh ; baude mov TH1,TL1 ; mov TMOD,#21h ; T1 mode 2 setb tr1 ; start timer mov SCON,#50h ; clr ea . . . mov dptr,#msg mov r1,#msglen setb ti acall send . . . . . send: clr a movc a,a+@dptr jnb $ ; wait end transmit clr ti mov sbuf,a inc dptr djnz r1, send ret