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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/13/10 21:50
Read: times


 
#173135 - problems programming the P89V51
I am trying to program ports on this chip with this simple program that reads the port 2.0 and outputs to port 2.7 but its not working, I am including the code but how can I insert schematics since its asking for a url for insert image ?
can you see where iam going wrong? I have left the EA, ALE, PSEN pins unconnected.
I have connected the crystal and the RST pin exactly as shown in manual .

$MOD51
;
; The processor clock speed is 11.059MHz
; Cycle time is 1.1ms

	input_port  equ p2.0
	output_port equ p2.7

	org	00
	ljmp	main

	org 100h
main:

; Initialize the SFRs first
;
	mov	scon,#50H 		;mode 1, recv enable
	mov 	tmod,#70H		;timer 1 in auto reload
	mov	pcon,#80H		;double baud rate
	mov 	th1,#0FDH		;19,200 baud at 11.059MHz
	mov	tcon,#40H		;start timer 1
	clr 	ti			; clear for Xmitting

	setb	input_port		;prepare p2.0 for input
loop:	mov   	c,input_port		;read the state of p2.0 and
					;store in the carry flag
	cpl	c			;compliment the input
	mov	output_port, c		;transfer p2.0 status to p2.7
	sjmp 	loop




 



List of 5 messages in thread
TopicAuthorDate
problems programming the P89V51            01/01/70 00:00      
   here is the schematic I am following            01/01/70 00:00      
      EA            01/01/70 00:00      
         tied EA high still no luck            01/01/70 00:00      
   PROBLEM FIXED - Working now            01/01/70 00:00      

Back to Subject List