| ??? 01/16/02 01:08 Read: times |
#18734 - RE: software uart problems in atmel 89c52 |
i am sorry, i am new to asm, to get the software uart, i compiled my c to generate asm, and just inserted the software uart asm and shown below.
thanks in advance d9600 equ 48 nfbit equ d9600 nhbit equ d9600/2 nqbit equ d9600/4 ; 1/4 ntbit equ nhbit + nqbit ; 3/4 putc: push 1 push 6 push 7 CLR TPIN ;Drop line for start bit call fulbit MOV R1,#8 ;Send 8 bits putc1: RRC A ;Move next bit into carry MOV TPIN,C ;Write next bit call fulbit djnz r1,putc1 SETB TPIN ;Set line high for stop bit rrc a call fulbit pop 7 pop 6 pop 1 RET tfhbit: mov r6,#low Ntbit mov r7,#high Ntbit or 1 ; at least 1 sjmp hofb hafbit: mov r6,#low Nhbit mov r7,#high Nhbit or 1 ; at least 1 sjmp hofb fulbit: mov r6,#low Nfbit ; 1 mov r7,#high Nfbit or 1 ; at least 1 hofb: djnz r6,hofb ; 2 djnz r7,hofb ; 2 ; if 1 then exit nobit: ret ; 2 |
| Topic | Author | Date |
| software uart problems in atmel 89c52 | 01/01/70 00:00 | |
| RE: software uart problems in atmel 89c52 | 01/01/70 00:00 | |
| RE: software uart problems in atmel 89c52 | 01/01/70 00:00 | |
| RE: software uart problems in atmel 89c52 | 01/01/70 00:00 | |
| RE: software uart problems in atmel 89c52 | 01/01/70 00:00 | |
| RE: software uart problems in atmel 89c52 | 01/01/70 00:00 | |
| RE: software uart problems in atmel 89c52 | 01/01/70 00:00 | |
| RE: software uart problems in atmel 89c52 | 01/01/70 00:00 | |
| RE: software uart problems in atmel 89c52 | 01/01/70 00:00 | |
| RE: software uart problems in atmel 89c52 | 01/01/70 00:00 | |
| RE: software uart problems in atmel 89c52 | 01/01/70 00:00 | |
| RE: software uart problems in atmel 89c52 | 01/01/70 00:00 | |
RE: software uart problems in atmel 89c52 | 01/01/70 00:00 |



