| ??? 06/19/07 14:10 Read: times |
#141015 - here is the code Responding to: ???'s previous message |
i dont know how to attatch the schematics here but the compiler is the 8051 ide and here is an example of the assembly code ( i got that code from 8052 website here and i simulated it on the 8051 ide also ) i think there is no problem with it ;*************************************************************** ;This is an example of polled transmit ;************************************************************** ; CR EQU 0DH LF EQU 0AH ; ORG 0 LJMP MAIN ; ORG 40H MAIN: LCALL SERINIT MOV DPTR,#HELLO LCALL TEXT_OUT MOV DPTR,#MSG1 LCALL TEXT_OUT MOV DPTR,#MSG2 LCALL TEXT_OUT LOOP: AJMP LOOP ;STOP HERE ;***************************************************************** ;Other Serial Messages ; HELLO: DB 'Hello World',CR,LF,0 MSG1: DB 'I am sending messages to my terminal!',CR,LF,0 MSG2: DB 'This is fun..',CR,LF,0 ;************************************************************** SERINIT: ;Initialize serial port CLR TR1 CLR TI CLR RI MOV SCON,#01011010B ;TI SET INDICATES TRANSMITTER READY. ;MODE 1 REN MOV TMOD,#00100001B ;TIMER 1 MODE 8 BIT AUTO RELOAD MOV TH1,#0FDH ;TIMER RELOAD VALUE SETB TR1 ;START TIMER MOV DPTR,#SINIT LCALL TEXT_OUT RET ; SINIT: DB CR,LF DB 'Serial Port Initialized! ' CRLF: DB CR,LF,0 ;************************************************************** TEXT_OUT: WT1: CLR A MOVC A,@A+DPTR INC DPTR JZ WT2 LCALL CHAR_OUT AJMP WT1 WT2: RET ;************************************************************** CHAR_OUT: CLR TI MOV SBUF,A JNB TI,$ CORET: RET ;************************************************************** i am most suspicious about the HW circuit of the (Max 232 cpe )because it becomes very hot when connecting the power to it.. |
| Topic | Author | Date |
| i am having serious problem with serial | 01/01/70 00:00 | |
| Show your working ! | 01/01/70 00:00 | |
| here is the code | 01/01/70 00:00 | |
| Code is from this... | 01/01/70 00:00 | |
| Posting schematics. | 01/01/70 00:00 | |
| here is the circuit | 01/01/70 00:00 | |
| Try this | 01/01/70 00:00 | |
| an earlier thread with similar problem | 01/01/70 00:00 | |
| i did that test | 01/01/70 00:00 | |
| my capacitors are electrolytics | 01/01/70 00:00 | |
| MAX232 uses 1uF caps not .1uF | 01/01/70 00:00 | |
| +5 is what i use | 01/01/70 00:00 | |
| DSUB = DB9 | 01/01/70 00:00 | |
| Jon ... You should know better! | 01/01/70 00:00 | |
Ouch... I will never do it again. | 01/01/70 00:00 | |
| CAUTION! | 01/01/70 00:00 | |
| expected errors | 01/01/70 00:00 | |
| Burden Caps. | 01/01/70 00:00 | |
| Code and schematic | 01/01/70 00:00 |



