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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
Tejas H S
08/02/11 10:13
  08/02/11 10:29

Read: 1126 times

#183147 - bit banging program touble
i have been trying to make a program to communicate with PC using bit banging..
using P89v51RD2 but i have been unsuccessful. on reset i dont receive anything in the PC terminal and some time i receive a few junk characters....
i cant make out whats wrong...
the hardware is the usual TXD and RXD connected to PC through MAX 232 and its working if i use the hardware uart so there might not be any problem with the hardware...
can any one guide me through this...
here is my program

// bit banging to transmit at 1200 baud rate
// crystal freq is 11.0592MHz		
		org 00h
		jmp main

		org 0Bh
		rlc A
		mov P3^1,C
		inc R1

		org 100h
main:	setb P3^1
		;mov A,#'A'
		mov IE,#82h
		mov TH0,#0E8h 
		mov TL0,#0E8h
		mov TMOD,#02h

		mov R0,#100
		setb TR0
repeat: mov A,#0x00	 		;Start bit
		mov R1,#00
wait1: 	cjne R1,#01,wait1

		mov R1,#0
		mov A,#'A'		   	;send the character
		clr c
wait2: 	cjne R1,#7,wait2

		mov A,#0x80			;send stop bit
		mov R1,#00
wait3: 	cjne R1,#01,wait3

		djnz R0,repeat
		clr TR0
over:	jmp over

List of 30 messages in thread
bit banging program touble      Tejas H S      08/02/11 10:13      
   why?      Erik Malund      08/02/11 10:43      
      i need a second serial port      Tejas H S      08/02/11 11:40      
         something like this , without any warranty :      Stefan KAnev      08/03/11 03:20      
         a good start would be ...      Erik Malund      08/03/11 05:45      
            only 3 'U's are commingout of 100      Tejas H S      08/03/11 06:42      
               Separate the characters and look with scope      Per Westermark      08/03/11 08:02      
                  finally it worked      Tejas H S      08/03/11 11:09      
                     uart receiver in software      Juergen Christoph      08/03/11 13:16      
   No I/O or No Timing      Michael Karas      08/02/11 11:40      
      "No I/O or No Timing"      Tejas H S      08/02/11 11:46      
   Someday you will learn...      Michael Karas      08/02/11 14:33      
      this isnt the actual code      Tejas H S      08/02/11 18:57      
         Well then another lesson to learn...      Michael Karas      08/02/11 19:53      
   Assembler Manual will help you      Ashok Kumar      08/02/11 18:55      
      assembler manual?      Tejas H S      08/02/11 19:04      
   Data is 8 Bit??      Ashok Kumar      08/02/11 19:18      
   Bit width timing and timer TH0,TL0 Values      Ashok Kumar      08/02/11 23:23      
      checked values for TH0 and TL0      Tejas H S      08/03/11 01:48      
         keil baud rate Calculator not for bit bang      Ashok Kumar      08/03/11 06:40      
   LSB first      Maarten Brock      08/03/11 04:06      
   now reception....      Tejas H S      08/04/11 07:56      
      1) din = din >> 1      Stefan KAnev      08/04/11 13:13      
         working at 1200 baud      Tejas H S      08/05/11 05:42      
            delayRS()      Stefan KAnev      08/05/11 06:20      
               why do i have to sample stop bit      Tejas H S      08/05/11 06:49      
                  Need not, but should      Per Westermark      08/05/11 07:13      
                  because      Stefan KAnev      08/05/11 07:15      
                     Much to a real UART      Per Westermark      08/05/11 08:15      
                  1.5 bit delay      Maarten Brock      08/07/11 02:52      

Back to Subject List