Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Thread Tools Display Modes
Old 19th December 2007, 09:49 AM   (permalink)
Default serial communication code,whats wrong in this?

org 000h

mov A,pcon
setb acc.7
mov pcon,A
mov tmod,#20h
mov th1,#-3
mov scon,#50h
setb tr1

mov DPTR,#rfid

h_1: clr a
movc A,@a+dptr
jz b_z
acall send
inc dptr
sjmp h_1
b_z:lcall b_1
send:mov sbuf,A
h_2:jnb ti, h_2
clr ti
ret

org 0300h
rfid: DB "re364 acknwlge",0
b_1:
end

i am checking its output on hyperterminal, and its sending me the data continously

what am i doing wrong here??
i just want it to send me "re364 acknwlge" once
baftab is offline  
Reply With Quote
Old 19th December 2007, 04:02 PM   (permalink)
Default

Please use Code tags when posting code. Simply click on the # in the menu above the text entry box before pasting your code. Makes it look like this:
Code:
	org	000h

	mov	A,pcon
	setb	acc.7
	mov	pcon,A
	mov	tmod,#20h
	mov	th1,#-3
	mov	scon,#50h
	setb	tr1

	mov	DPTR,#rfid

h_1:	clr	a
	movc	A,@a+dptr
	jz	b_z
	acall	send
	inc	dptr
	sjmp	h_1
b_z:	lcall	b_1
send:	mov	sbuf,A
h_2:	jnb	ti, h_2
	clr	ti
	ret

	org	0300h
rfid:	DB	"re364 acknwlge",0
b_1:
	end
__________________
=========================
Futz's Microcontrollers & Robotics
=========================
futz is online now  
Reply With Quote
Old 19th December 2007, 08:19 PM   (permalink)
Default

Which micro this is written for? It looks like 8051 but I'm not sure.
felis is offline  
Reply With Quote
Old 19th December 2007, 10:23 PM   (permalink)
Default

yeh at89c51
baftab is offline  
Reply With Quote
Old 20th December 2007, 01:02 AM   (permalink)
Default

You LCALL to b_1 but you have no code there. The processor doesn't just stop at the end statement, you need a loop there because the program counter will continue to run.
Brevor is offline  
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Latest
serial communication in Atmel 89c51 Peter Nabil Micro Controllers 9 4th August 2008 12:17 PM
Need help badly on Inchworm and MPLAB thushy Micro Controllers 14 11th March 2007 06:05 PM
serial communication jaikanth General Electronics Chat 1 12th December 2004 03:42 PM
Serial Communication with mobile phone remi Micro Controllers 0 31st March 2004 04:21 PM
Serial communication problem tbrown Micro Controllers 12 13th February 2004 10:32 AM



All times are GMT. The time now is 06:22 AM.


Electronic Circuits  |  Electronics Wiki
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.