Use Output of HT12E as input

Discussion about projects that used PIC Microcontroller, Hardware Interface, Programming Algorithm and etc......

Use Output of HT12E as input

Postby E11022 » Sat Dec 10, 2011 7:19 pm

Is that possible that the output data of HT12E is directly used as input without using serial programming?

I am doing Remote control Circuit to on/off alarm .
When the sensor is triggered, the alarm sounds and we can off it manually (using a reset button in PIC ) or using remote control.

The TX part of the remote is connected like this :
TWS module to HT12E to 2 switches

The RX part of the remote is connected like this:
RWS module to HT12D to PIC PORT B to Alarm

I am thinking just program the PIC when Port B is high, Alarm will off. Is this possible ? i doubt it as the data from HT12E is serial data right? or any other simple programming to deal with this situation??

Thanks
E11022
Novice
 
Posts: 27
Joined: Tue Nov 15, 2011 10:13 pm

Re: Use Output of HT12E as input

Postby ABSF » Sun Dec 11, 2011 4:48 pm

E11022 WROTE:Is that possible that the output data of HT12E is directly used as input without using serial programming?

Yes, it should be possible.
E11022 WROTE:The TX part of the remote is connected like this :
TWS module to HT12E to 2 switches

The RX part of the remote is connected like this:
RWS module to HT12D to PIC PORT B to Alarm


Actually you can connect 4 inputs to HT12E, be them 4 switches or 4 output pins of the PIC. On the HT12D, it will get back the same logic levels of H or L on the 4 data output of the chip. The connection should be like this.

4 switches -> AD8~AD11 ->HT12E ->DOUT -> TX module ..........RF on AIR ..........RX module -> DIN -> HT12D -> AD8~AD11-> 4 LEDs.

The parallel data is converted to serial data by the encoder chip, coming out of DOUT and receive by DIN of the decoder and converted back to parallel data on AD8 to AD11 again.

If you cannot get these chips you can also buy PT2262 and PT2272 locally. They have almost the same functions.
http://www.escol.com.my/Datasheets_specs/pt2262_1.pdf
http://www.escol.com.my/Datasheets_specs/pt2272_1.pdf

Allen
The next war will determine NOT who is right BUT what is left.
User avatar
ABSF
Professional
 
Posts: 810
Joined: Wed Nov 10, 2010 9:32 am
Location: E Malaysia

Re: Use Output of HT12E as input

Postby E11022 » Sun Dec 11, 2011 4:54 pm

4 switches -> AD8~AD11 ->HT12E ->DOUT -> TX module ..........RF on AIR ..........RX module -> DIN -> HT12D -> AD8~AD11-> 4 LEDs.

But i connected the AD8-AD11 of HT12D to Port A2 and A3 of my PIC16f877a, and write the command if A2 is high, buzzer will off.
the circuit is not responding.
E11022
Novice
 
Posts: 27
Joined: Tue Nov 15, 2011 10:13 pm

Re: Use Output of HT12E as input

Postby ABSF » Sun Dec 11, 2011 5:13 pm

E11022 WROTE:But i connected the AD8-AD11 of HT12D to Port A2 and A3 of my PIC16f877a, and write the command if A2 is high, buzzer will off.
the circuit is not responding.


If you have a meter, what's the voltage on AD8-AD11 on the HT12D? Do they agree with the voltages on the 4 switches at HT12E? You can even connect directly from DOUT to DIN without going thru the RF module. May be you need 10K pull-ups at the TX side.

I have bought the PT2262 and PT2272 few weeks ago. I can try them out on my breadboard if necessary.

Allen
The next war will determine NOT who is right BUT what is left.
User avatar
ABSF
Professional
 
Posts: 810
Joined: Wed Nov 10, 2010 9:32 am
Location: E Malaysia

Re: Use Output of HT12E as input

Postby E11022 » Sun Dec 11, 2011 8:36 pm

If you have a meter, what's the voltage on AD8-AD11 on the HT12D? Do they agree with the voltages on the 4 switches at HT12E? You can even connect directly from DOUT to DIN without going thru the RF module. May be you need 10K pull-ups at the TX side.

I have bought the PT2262 and PT2272 few weeks ago. I can try them out on my breadboard if necessary.

Allen[/quote]

The voltage on Ad8-AD11 is 1.8V. If you are free, you can try it out and see is it not working too. thanks :)
below is my code which i use it together with HT12D.

#include <pic.h>
__CONFIG(0x3F32);

#define sensor RA0
#define sw RA1
#define buzzer RC5
#define led RC4
#define disarm_r RA2 //off alarm remotely
#define arm_r RA3 //on alarm for emergency


void initial(void);

void initial()
{
ADCON1 = 0x06;
TRISA=0b11111111;
TRISC=0b00000000;

buzzer=0;
sensor=0;
sw=0;
led=0;
disarm_r =0;
arm_r =0;

}

void main (void)
{
initial();
while(1)
{
//condition//
if ((sensor == 1) && (sw ==0))
{
led=1,buzzer=1;
}
else if ((sensor == 0) && (sw ==1))
{ led=0,buzzer=0;
}
else if (disarm_r==1)
{buzzer=0;}
else if (arm_r==1)
{buzzer=0;}

else {
led =0,buzzer =0;

}
}
}
E11022
Novice
 
Posts: 27
Joined: Tue Nov 15, 2011 10:13 pm

Re: Use Output of HT12E as input

Postby royalstorm7 » Wed Dec 14, 2011 11:55 pm

hi E11022 ...
try to test the system part by part....make sure Tx and Rx comms firts...u can look at the valid transmission led (if u apply)....then only u connect to the PIC....these Holtek and Princeton Technology ICs is very stable (i'm quite fam' with them)...yes, u can connect direct to pic..

tq

roslan
royalstorm7@yahoo.com
find me in facebook
royalstorm7
Apprentice
 
Posts: 52
Joined: Sat Sep 04, 2010 1:37 pm


Return to PIC Microcontroller

Who is online

Users browsing this forum: No registered users and 2 guests

cron