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.

how to interface micro-controller with encoder and decoder

Status
Not open for further replies.

microcontroller123

Junior Member level 1
Joined
Feb 15, 2011
Messages
17
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,472
i am trying to interface micro-controller with HT12E encoder. the problem i am facing is this that i am using all the 8 pins of micro-controller. however encoder data pins are only 4 pins.. i have an idea to use 74LS138 to encode 8 data pins into 3.. if my approach is wrong can you tell me that how can i interface micro-controller and HT12E
thanks..
its urgently needed plz...
 

i am trying to interface micro-controller with HT12E encoder. the problem i am facing is this that i am using all the 8 pins of micro-controller.
Interface µC to HT12E to achieve what?
You can only connect 4 data pins. Any kind of encoding, that a 138 can do can be also performed by the µC itself.

P.S.: I see, that you are re-scheduling the discussion that you have started in a previous thread. https://www.edaboard.com/threads/225205/

Well, the technical fact shaven't changed during the last four weeks. It has been already explained there in detail, why a HT12E encoder isn't suited for data transmission with acceptable speed. Apart from the said previous thread you'll find a rich choice of suggestions when searching for keyword HT12E at edaboard.
 
Last edited:

yeah i remember that one.. but one of my teachers need the reason so i want to show him that how could its not working actually.. secondly my issue is that i need to interface HT12E with uC.. i am using all the 8 pins of port1 of the uC then how can i interface the encoder with it.. which is having only 8 data inputs..

---------- Post added at 23:05 ---------- Previous post was at 23:04 ----------

even i have tried it using only rf transmitter and receiver with uC... but some times it start sending bugs.. thats why i need to clarify my problem to my instructor..

---------- Post added at 23:07 ---------- Previous post was at 23:05 ----------

in my last thread it was said that rf transmitter is having it own baud rate 2400.. but my teachers said that i can handle that by uC and can change it according to my own need...

---------- Post added at 23:10 ---------- Previous post was at 23:07 ----------

in my last thread it was said that rf transmitter is having it own baud rate 2400.. but my teachers said that i can handle that by uC and can change it according to my own need...
i am just trapped in it...
 

if you need to do please understand manchester encodeing and decoding. Then you can directly attach to the controller, without the decoder/encoder. Sometimes the teachers may be false.





"If you decided to run even you cannot stop."
 
  • Like
Reactions: FvM

    FvM

    Points: 2
    Helpful Answer Positive Rating
I reviewed the previous thread. It has detailed explanations about the problems occuring when transmitting unencoded UART signals by simple RF transmitters and also discusses the solutions. But it's based on assumptions because you never mentioned the exact transmitter/receiver type used in your project. For the time being, we'll have to stay with these assumptions.

I also noticed, that you have some problems with elementary µP programming (discussed in another thread). So strictly spoken, we can't be sure that the observed problems are actually related to RF data transmission, although this is still likely.
 

i am really thank ful to you all that you escorted me a lot.. i have used the RF modules JZ881 and i am successful in doing that :)
but now there is a problem in the synchronization.. the data i am receiving is a proper data.. but the transmitting data is continuously sending. i want to limit it not to receive continuously.. how can i done it.. i am displaying image of my problem and with code also..

IMAGE



TRANSMITTING CODE

org 0h
mov tmod,#20h
mov th1,#-3
mov scon,#50h
setb tr1
again:

mov a,#38h
acall command
acall delay
mov a,#0eh
acall command
acall delay
mov a,#01h
acall command
acall delay
mov a,#06h
acall command
acall delay
mov a,#84h
acall command
acall delay

mov a,#'U'
acall display
acall transmit
acall delay1

mov a,#'S'
acall display
acall transmit
acall delay1

mov a,#'A'
acall display
acall transmit
acall delay1

mov a,#'M'
acall display
acall transmit
acall delay1

mov a,#'A'
acall display
acall transmit
acall delay1

mov a,#'L'
acall display
acall transmit
acall delay1

mov a,#'A'
acall display
acall transmit
acall delay1

mov a,#'T'
acall display
acall transmit
acall delay1

mov a,#'I'
acall display
acall transmit
acall delay1

mov a,#'F'
acall display
acall transmit
acall delay1


mov a,#20h
acall transmit
sjmp again


transmit:
mov sbuf,a
aa:
jnb ti,aa
clr ti
ret

receive:
jnb ri,receive
mov a,sbuf
mov r0,a
clr ri
ret

command:
acall ready
mov p1,a
clr p2.0
clr p2.1
setb p2.2
acall delay
clr p2.2
ret

display:
acall ready
mov p1,a
setb p2.0
clr p2.1
setb p2.2
acall delay
clr p2.2
ret


delay:
mov r3,#50
label1:
mov r4,255
label:
djnz r4,label
djnz r3,label1
ret

ready:
setb p1.7
clr p2.0
setb p2.1
back:
clr p2.2
acall delay
setb p2.2
jb p1.7,back
ret

delay1:
mov r3,#150
label3:
mov r4,255
label2:
djnz r4,label2
djnz r3,label1
ret

end

RECEIVING CODE

org 0h
mov tmod,#20h
mov th1,#-3
mov scon,#50h
setb tr1
setb p2.3

mov r0,10
again:
clr a
mov a,#38h
acall command
acall delay
mov a,#0eh
acall command
acall delay
mov a,#01h
acall command
acall delay
mov a,#06h
acall command
acall delay
mov a,#84h
acall command
acall delay

bb:
acall receive
mov p1,a
acall delay
acall display
acall delay
djnz r0,bb
jb p2.3,again
clr p3.0




sjmp again

receive:
jnb ri,receive
mov a,sbuf
mov r0,a
clr ri
ret

transmit:
mov sbuf,a
aa:
jnb ti,aa
clr ti
ret

command:
mov p1,a
clr p2.0
clr p2.1
setb p2.2
acall delay
clr p2.2
ret

display:
mov p1,r0
setb p2.0
clr p2.1
setb p2.2
acall delay
clr p2.2
ret


delay:
mov r3,#50
label1:
mov r4,255
label:
djnz r4,label
djnz r3,label1
ret
move:
end
 

i am really thank ful to you all that you escorted me a lot.. i have used the RF modules JZ881 and i am successful in doing that :)
but now there is a problem in the synchronization.. the data i am receiving is a proper data.. but the transmitting data is continuously sending. i want to limit it not to receive continuously.. how can i done it.. i am displaying image of my problem and with code also..

IMAGE



TRANSMITTING CODE

org 0h
mov tmod,#20h
mov th1,#-3
mov scon,#50h
setb tr1
again:

mov a,#38h
acall command
acall delay
mov a,#0eh
acall command
acall delay
mov a,#01h
acall command
acall delay
mov a,#06h
acall command
acall delay
mov a,#84h
acall command
acall delay

mov a,#'U'
acall display
acall transmit
acall delay1

mov a,#'S'
acall display
acall transmit
acall delay1

mov a,#'A'
acall display
acall transmit
acall delay1

mov a,#'M'
acall display
acall transmit
acall delay1

mov a,#'A'
acall display
acall transmit
acall delay1

mov a,#'L'
acall display
acall transmit
acall delay1

mov a,#'A'
acall display
acall transmit
acall delay1

mov a,#'T'
acall display
acall transmit
acall delay1

mov a,#'I'
acall display
acall transmit
acall delay1

mov a,#'F'
acall display
acall transmit
acall delay1


mov a,#20h
acall transmit
sjmp again


transmit:
mov sbuf,a
aa:
jnb ti,aa
clr ti
ret

receive:
jnb ri,receive
mov a,sbuf
mov r0,a
clr ri
ret

command:
acall ready
mov p1,a
clr p2.0
clr p2.1
setb p2.2
acall delay
clr p2.2
ret

display:
acall ready
mov p1,a
setb p2.0
clr p2.1
setb p2.2
acall delay
clr p2.2
ret


delay:
mov r3,#50
label1:
mov r4,255
label:
djnz r4,label
djnz r3,label1
ret

ready:
setb p1.7
clr p2.0
setb p2.1
back:
clr p2.2
acall delay
setb p2.2
jb p1.7,back
ret

delay1:
mov r3,#150
label3:
mov r4,255
label2:
djnz r4,label2
djnz r3,label1
ret

end

RECEIVING CODE

org 0h
mov tmod,#20h
mov th1,#-3
mov scon,#50h
setb tr1
setb p2.3

mov r0,10
again:
clr a
mov a,#38h
acall command
acall delay
mov a,#0eh
acall command
acall delay
mov a,#01h
acall command
acall delay
mov a,#06h
acall command
acall delay
mov a,#84h
acall command
acall delay

bb:
acall receive
mov p1,a
acall delay
acall display
acall delay
djnz r0,bb
jb p2.3,again
clr p3.0




sjmp again

receive:
jnb ri,receive
mov a,sbuf
mov r0,a
clr ri
ret

transmit:
mov sbuf,a
aa:
jnb ti,aa
clr ti
ret

command:
mov p1,a
clr p2.0
clr p2.1
setb p2.2
acall delay
clr p2.2
ret

display:
mov p1,r0
setb p2.0
clr p2.1
setb p2.2
acall delay
clr p2.2
ret


delay:
mov r3,#50
label1:
mov r4,255
label:
djnz r4,label
djnz r3,label1
ret
move:
end
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top