Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

microcontrller 8051 coding

Status
Not open for further replies.

pnm

Junior Member level 1
Joined
Sep 2, 2010
Messages
19
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,409
can u help me in writing code for microcontroller interfaced to the decoder?
 

we hav used HT-12D decoder ,v need to write code to provide address for the decoder
 

this will help you get started.
Code:
;***********************************************************************
;receiver code for RLP434A module
;this one works with Holtek decoder 12D
;
$mod51
;port 3 pinouts
LED 		equ	p3.5	;
BUZZ		equ	p3.6	;buzzer
VT		equ	p3.2  ;if high, valid byte rec'd

count1	equ	09h		;
count		equ	08h		;
;----------------------------------------------------
org	00000h
Reset:
	sjmp	Start			; reset vector
Start:
	MOV   SP,#30h          	; Set up stack pointer
	mov	a,#0FFh		; 
	mov	p1,a			;
	mov	p3,a			;
;----------------------------------------------	
Main:	
	mov	p1,#0FFh		;P1 = input
	setb	LED			;LED OFF
	setb	VT			;VT = input

;wait here until VT goes high	
Main1:
	jnb	VT,$			;if VT = high, valid byte rec'd
;----------------------------------------------
	mov	a,P1			;read P1
	xrl	a,#0F0h		;only need low nibble
	CJNE	a,#05h,Main1	;received a "5" ring buzzer
					;else, discard byte and wait for another
;----------------------------------------------
	clr	LED			;LED ON
RX_OK:	
	mov	count1,#5		;ring buzzer 5 times

WaitLp:
	clr	BUZZ			;buzzer on
	lcall	Delay250		;wait 1/4 second
	setb	BUZZ			;buzzer off
	lcall	wait			;wait 1 second

	djnz	count1,WaitLp
;----------------------------------------------
stop:
	sjmp	stop			;wait until hardware reset
;----------------------------------------------	
;1 sec delay @11.0592MHz
wait:	
	mov	count,#4	
wait1:
	lcall	Delay250
	djnz	count,wait1
	ret
;----------------------------------------------	
; 250mS @11.0592MHz
Delay250:
	MOV   R3,#2
      MOV   R2,#194
      MOV   R1,#56
Del250:
	DJNZ  R1,Del250
      DJNZ  R2,Del250
      DJNZ  R3,Del250
      RET
;----------------------------------------------
end
 

can i work on keil for dis code?
 

when you ask for help you should always specify the type of code you are working with either C or assembly.
 

can u plz help me v hav designed a ckt n its working fine with one transmitor n one receiver but wen v r using many transmitter for one receiver its not working.
v hav used ht12e encoder and one transmitter module for transmission n at the receiver side v hav one decoder ht12d decoder n receiving module , for the receiver decoder v hav attached 89c51 mc so that the address is given to the pins of decoder foe different transmitter but here v r facing problem.plz help us
 

The code given above could be compiled in MPLAB IDE for PIC or i think in PINNACLE for 8051.
Regards,
Jerin.
 

v hav written code for generating 256 address with the help of above code
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top