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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
Igor Hurban
02/07/13 12:59
Read: 989 times
Skalica
Slovakia


 
#189328 - c8051f040
Responding to: Andy Neil's previous message
good day!

I apologize for the late reply a question.
I read the datasheet.
I tried to send No.5 through the serial port UART1.
It is not clear to me how to assign pins to rx1 and tx1.
When assigns p0.0 or p0.1 or P1.0 etc.
It is according to priorities? (datasheet page 205)
I attach a sample program.
I tried it in the IDE development tools SiLabs, a there writing
mov sbuf1,a did not want to write a value from accumulator
into Register sbuf1.

again apologize for the question

$include(cf040.inc)


;external 25MHz krystal, 57600Bd	
;vysielanie cez seriovy port UART1



	
		org	0h


		mov   	WDTCN, #0deh	;disable
		mov     WDTCN, #0ADh	;watchdog
		
		mov	sfrpage,#00h
		mov	rstsrc,#04h
		mov	tmod,#20h	;8-bit,auto reload
		mov	th1,#27h	;reload value (table22.2, page 284 datasheet)
		mov	ckcon,#10h	;system clock

		mov	sfrpage,#01h
		mov	scon1,#10h	;mode 0
		
		mov	sfrpage,#0fh
		mov	oscxcn,#0e7h
		mov	clksel,#01h
		mov	xbr0,#0h
		mov	xbr1,#0h
		mov	xbr2,#42h	;crossbare enable, uart1 enable, weak pullup enable

		mov	p1mdout,#00h	;???
		mov	p0mdout,#00h	;???

		mov	sfrpage,#00h
		setb	tr1		;start timer1

		mov	sfrpage,#01h

		
start:		call	delay
		
		clr	ti1
		mov	a,#35h
		mov	sbuf1,a        ;this writing not working
		jnb	ti1,$
		clr	ti1		
		jmp	start

delay:		
		mov	r6,#0
s2:		call	ms
		call	ms
		call	ms
		call	ms
		call	ms
		call	ms
		call	ms		
		djnz	r6,s2
		ret	
	
ms:		
		mov	r7,#00H
		djnz	r7,$
		mov	r7,#00H
		djnz	r7,$
		mov	r7,#00H
		djnz	r7,$
		mov	r7,#00H
		djnz	r7,$
		mov	r7,#00H
		djnz	r7,$
		mov	r7,#00H
		djnz	r7,$
		mov	r7,#00H
		djnz	r7,$
		mov	r7,#00H
		djnz	r7,$
		ret

		end

 




List of 5 messages in thread
TopicAuthorDate
c8051f040      Igor Hurban      02/01/13 11:58      
   different UARTs      Erik Malund      02/01/13 12:14      
   So what have you tried?        Andy Neil      02/01/13 16:06      
      c8051f040      Igor Hurban      02/07/13 12:59      
         c8051f040      Igor Hurban      02/07/13 13:15      

Back to Subject List