We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi i have got code for an assembler software UART in c51. normally putchar() is of type unsigned char but with the assembler code how do i do this?
void putc() { #pragma asm * Transmit character in A via TXD line * putc CLR TXD Drop line for start bit MOV R0,#BITTIM Wait full bit-time DJNZ R0,* For START bit MOV R1,#8 Send 8 bits putc1 RRC A Move next bit into carry MOV TXD,C Write next bit MOV R0,#BITTIM Wait full bit-time DJNZ R0,* For DATA bit DJNZ R1,putc1 write 8 bits SETB TXD Set line high RRC A Restore ACC contents MOV R0,#BITTIM Wait full bit-time DJNZ R0,* For STOP bit RET * #pragma endasm }
"im using the max232"
You're using a MAX232 and you've still managed to blow up the UART?!
The MAX232 should protect against most abuse - so if you've blown the UART you must have done something pretty drastic!!
:-0
If that's the case, it's even less likely that the rest of the chip is undamaged...
An excellent method of killing a UART despite the use of a MAX232 is to kill it _with_ the MAX232 - just reverse inputs and outputs on the MAX232 ;)
You must have a very twisted mind...
I think the reverse