electronics forum

Rules | Recent posts | topic RSS | Search | Register  | Log in

RF Receiver Interface to AT89c52


Goto page 1, 2  Next
Post new topic  Reply to topic    EDAboard.com Forum Index -> Microcontrollers -> RF Receiver Interface to AT89c52
Author Message
Help



Joined: 15 Feb 2005
Posts: 560
Helped: 4


Post18 Jan 2007 3:05   

rf reciver


Hi,

Can we direct interfacing the receiver output to uC? withou connet any decoder IC.

I have one RF transmitter and receiver car remote control. I don't have oscilloscope to measure the incoming receiver. So, i try to write the decode coding and RS232 coding in my uC for simulate. I assumed the receiver generate 16bits output signal, then i will decoded it to 8bits then display the result via RS232.

But the problem is i can't get very actual result and it generate all differents signal.
May i know the receiver output signal will the signal be at a constant bit rate ? and
will the data to be received start will a known start pattern ?

What can i do for my next step?

Thank You.
Back to top
IanP



Joined: 05 Oct 2004
Posts: 6492
Helped: 1542
Location: West Coast


Post18 Jan 2007 3:55   

kxdjs2024


Which modules do you have?

If you have something like this:
http://www.ozitronics.com/data/rws3716c.pdf
then whatever is comming to data in pin of the transmitter is repeated on data output pin of the receiver ..

Regards,
IanP
Back to top
Help



Joined: 15 Feb 2005
Posts: 560
Helped: 4


Post18 Jan 2007 4:08   

manchester encoding +code


Hi,

Ya, you are right. something like yours. but my only got 4 pin which is Out, Ant, Vcc and Gnd.

So what are the following step i need to do?

Thank You.
Back to top
IanP



Joined: 05 Oct 2004
Posts: 6492
Helped: 1542
Location: West Coast


Post18 Jan 2007 4:20   

at89s52 int0 button


At transmitter end connect one micro's TX pin to Data In, and at the receiver end connect receiver Data Out to another microcontroller RX pin, set baud rate to 300 (max 1200) and try to send a byte ..

Regards,
IanP
Back to top
budhy



Joined: 21 Oct 2006
Posts: 836
Helped: 185
Location: Indonesia


Post18 Jan 2007 4:34   

rc cars using at89c52


1. Make sure the OUT is a TTL level signal, if you don't sure use conection as diagram below
2. Connect the OUT pin to uC and measure the '0' and '1' duration on certain periode (ie 1 second) while the transmitter transmit data
3. The recorded data can be use to recognize the signal

RF Receiver Interface to AT89c52
Back to top
Help



Joined: 15 Feb 2005
Posts: 560
Helped: 4


Post18 Jan 2007 5:30   

at89c52 remote control car


Hi,

I don't know where is the transmitter output because i bought the Car Remote Control which is made-ready one. The pcb alot of SMD IC and with 2 big button (i think it builded in with encoded). Latter i will post my transceiver photo. I try to find the output 1st.


IanP wrote:
At transmitter end connect one micro's TX pin to Data In, and at the receiver end connect receiver Data Out to another microcontroller RX pin, set baud rate to 300 (max 1200) and try to send a byte ..


"We try to send a byte" means we press the transmitter button then it will send a byte. My microcrontroller will received the data from receiver then how/where can i know the simulate the result through LED display, LCD or PC-Interface but uC only have one RS232. The data will be very fast.

Thank You.

Added after 16 minutes:

Hi,

budhy wrote:
Make sure the OUT is a TTL level signal, if you don't sure use conection.
I got but a 7404 between the receiver and uC port.

budhy wrote:
Connect the OUT pin to uC and measure the '0' and '1' duration on certain periode (ie 1 second) while the transmitter transmit data

I try this before. I connect the receiver out to T2EX and set to counter-mode to count the transition every 0.5Sec then show it on LCD. It quite stable.
Is it what you mean?

Thank You.
Back to top
budhy



Joined: 21 Oct 2006
Posts: 836
Helped: 185
Location: Indonesia


Post18 Jan 2007 6:40   

th0 tl0 10000


Quote:
I try this before. I connect the receiver out to T2EX and set to counter-mode to count the transition every 0.5Sec then show it on LCD. It quite stable.
Is it what you mean?

No, not like that.
The signal is combination of '0' & '1' stream with difference pulse width, so you have to measure the each pulse. Because we don't know how length the stream is, so measure it at certain of periode (ie 0,5 second)
Back to top
Help



Joined: 15 Feb 2005
Posts: 560
Helped: 4


Post18 Jan 2007 8:13   

interrupt in at89c52


Do you mean we have to measure the '0' time and the '1' time then store each in the Buffer itself. After 0.5Sec we check the time '0' buffer and '1' buffer was taken. Am i rite?

Thank You.
Back to top
budhy



Joined: 21 Oct 2006
Posts: 836
Helped: 185
Location: Indonesia


Post18 Jan 2007 8:41   

at89c52 rf


Yes!
At a periode of 0,5 second, we'll get many set of signal stream, then we have to select a complete set of steam visually.
Back to top
Help



Joined: 15 Feb 2005
Posts: 560
Helped: 4


Post20 Jan 2007 9:45   

rf receiver dataout


Hi,

budhy wrote:
Yes!
At a periode of 0,5 second, we'll get many set of signal stream, then we have to select a complete set of steam visually.


I already done the testing that we discuss early.
1) Wrote a Manchester Encoding code.

2) Set Timer0 T0 in mode 1, 16-bit Timer

3) While enter the INT0 Interrupt Service Routine (falling edge) - store TL0 value in Buffer1 then reset TL0 run the TR0 again for raising edge time.

4) While enter the INT1 Interrupt Service Routine (raising edge) - store TL0 value in Buffer2 then reselt TL0, run the TR0 again for falling edge time.

5) If the incoming signal is falling edge 2 times, the Buffer1 store 2 time and the Buffer2 store "0" (entry time). Raising 2 times, Buffer2 store 2times Buffer1 store "0".

I already probe out the graph. There are two type of graphs "transmitter without transmit data" and "transmitter transmit data" but i can't make any conclusion. Please can you check it for me?

Thank You.



Sorry, but you need login in to view this attachment



Last edited by Help on 20 Jan 2007 10:31; edited 1 time in total
Back to top
budhy



Joined: 21 Oct 2006
Posts: 836
Helped: 185
Location: Indonesia


Post20 Jan 2007 10:03   

Re: RF Receiver Interface to AT89c52


Could you tell me your description is for a Manchester Encoding of for RF control signal capturing?

Quote:
Please can you check it for me?

Can you send me the capturing data?
Back to top
Google
AdSense
Google Adsense




Post20 Jan 2007 10:03   

Ads




Back to top
syrax



Joined: 15 Sep 2005
Posts: 176
Helped: 8


Post20 Jan 2007 10:10   

Re: RF Receiver Interface to AT89c52


whi u don't use decoder
i think it will be more easy, i make remote conreol for my car , and i buy a china RF moduls for central locking door (car) , after that i remove the original MCU and connect to 8051 with buffer and after that just reading the buttons Smile)

regards SYRAX
Back to top
Help



Joined: 15 Feb 2005
Posts: 560
Helped: 4


Post20 Jan 2007 11:18   

Re: RF Receiver Interface to AT89c52


budhy wrote:
Could you tell me your description is for a Manchester Encoding of for RF control signal capturing?

The code is same as yous but i only add Measure Time and Record for the recording data.

That is another post that you helped me before. This is in assamble language:
Code:
State   bit   0
;
    ORG   0x0000
    AJMP  Start
;
;*** INT0 Interrupt Service Routine
;
    ORG   0x0003
    SETB  State         ; it is '1'
    SETB  EXF2          ; transition occured
    RETI
;
;*** INT1 Interrupt Service Routine
;
    ORG   0x0013
    CLR   State         ; it is '0'
    SETB  EXF2          ; transition occured
    RETI
;
;*** Transition detected (Timer 2 Interrupt Service Routine)
;
    ORG   0x0023
;   do some thing here
    CLR   EXF2
    RETI
;
;*** Main Program
;
Start:
    SETB  EX0
    SETB  EX1
    SETB  ET2
    SETB  EA
Here:
    SJMP  Here


And this is my C language:
Code:
void Interrupt_INT0_Routine(void) interrupt INTERRUPT_EXTERNAL_0 
   {
//_______________ Measure Time and Record ________________
   TR0=0;
   Buf0[c0++]=TL0;

   if(pulse_state)
   {
      Buf1[c1++]=0;
   }
   else
      pulse_state=1;

    TH0 = 0; 
    TL0 = 0;
   TF0 = 0;          // clear overflow flag
   TR0 = 1;          // start timer 0
//_____________________________________________________

   edge = RISING; // 1
   EXF2 = 1;
   }   

void Interrupt_INT1_Routine(void) interrupt INTERRUPT_EXTERNAL_1
   {
//_______________ Measure Time and Record ________________
   TR0=0;
   Buf1[c1++]=TL0;

   if(!pulse_state)
   {
      Buf0[c0++]=0;
   }
   else
      pulse_state=0;

    TH0 = 0; 
    TL0 = 0;
   TF0 = 0;          // clear overflow flag
   TR0 = 1;          // start timer 0
//_____________________________________________________


   edge = FALLING; // 0
   EXF2 = 1;
   }   

void Interrupt_T2EX_Routine(void) interrupt INTERRUPT_Timer_2_Overflow
   {

   EXF2 = 0; // Clear the flag
 
//_______________ Measure Time and Record ________________
   if(c0+c1 >= (Bf0+Bf1))
   {
      EX0 = 0; // ***ON External0 interrupt
      EX1 = 0; // ***ON External0 interrupt
   }
//_____________________________________________________
   }   

Initail Interrupt Routine:
Code:
void Interrupt_Routine_Init(void)
   {
    WRITE_TMOD_T0(1); // Set required T0 in mode 1, 16-bit Timer

   ET0 = 0;  // No interupts
   ET1 = 0;  // No interupts


   IT0 = 1; // set(1) 1-to-0 transition
   IE0 = 0; // set the init transition to "0", waiting 1-to-0. Clear the flag 
   EX0 = 1; // ***ON External0 interrupt

   IT1 = 1; // set(1) 1-to-0 transition
   IE1 = 0; // set the init transition to "0", waiting 1-to-0. Clear the flag 
   EX1 = 1; // ***ON External1 interrupt

   ET2 = 1; // ***ON External2 interrupt

   EA = 1; // ***ON
   }

Do i right?

Thank You.

Added after 1 minutes:



syrax wrote:
connect to 8051 with buffer and after that just reading the buttons

What you mean? Can you show me your circuity connection and explain how you wrote your code?

Thank You.


Last edited by Help on 20 Jan 2007 11:22; edited 1 time in total
Back to top
budhy



Joined: 21 Oct 2006
Posts: 836
Helped: 185
Location: Indonesia


Post20 Jan 2007 11:20   

Re: RF Receiver Interface to AT89c52


Try this:
Code:
char time[20];

void capture_idle_1(void){
char i;
     while (IT0) ;
     
     i = 0;
     while (i<20){
            TH0=0; TL0=0; TR0 = 1;
            while (!IT0); TR0 = 0;
            time[i++] = TL0;
           
            TH0=0; TL0=0; TR0 = 1;
            while (IT0);  TR0 = 0;
            time[i++] = TL0;
     }     
}

void capture_idle_0(void){
char i;
     while (!IT0) ;
     
     i = 0;
     while (i<20){
            TH0=0; TL0=0; TR0 = 1;
            while (IT0);  TR0 = 0;
            time[i++] = TL0;
           
            TH0=0; TL0=0; TR0 = 1;
            while (!IT0); TR0 = 0;
            time[i++] = TL0;
     }     
}

void main(void){
     TMOD = 0x01;
     capture_idle_0(); // if the idle state on IT0 is '0'
     capture_idle_1(); // if the idle state on IT0 is '1'
}


Connect OUT signal to IT0
Back to top
Help



Joined: 15 Feb 2005
Posts: 560
Helped: 4


Post20 Jan 2007 18:37   

Re: RF Receiver Interface to AT89c52


Hi,

Thank for your sample code. I learn new thing with you. We can't use IT0 for knowing the incoming signal, i think is because for setting perpose (set "0" invert incoming signal, set "1" 1-to-0 transition). So, i change it to IE0. Then connect the OUT signal to INT0.

But i still can conclude again from the graphs. Crying or Very sad Is it the we use TL0 to measure is too accurate. So we can't conclude it.

Code:
#define time0 71
#define time1 71

idata char time_idle_0[time0], time_idle_1[time1], i;

void capture_idle_1(void){
     while (IE0) ;
     i = 0;
     while (i<(time1-1)){
            TH0=0; TL0=0; TR0 = 1;
            while (!IE0); TR0 = 0;
            time_idle_1[++i] = TL0;
           
            TH0=0; TL0=0; TR0 = 1;
            while (IE0);  TR0 = 0;
            time_idle_1[++i] = TL0;
     }

}
void capture_idle_0(void){
     while (!IE0) ;
     i = 0;
     while (i<(time0-1)){
            TH0=0; TL0=0; TR0 = 1;
            while (IE0);  TR0 = 0;
            time_idle_0[++i] = TL0;
           
            TH0=0; TL0=0; TR0 = 1;
            while (!IE0); TR0 = 0;
            time_idle_0[++i] = TL0;
     }   
     return;
}

void main(void){

     TMOD = 0x01;
    IT0 = 0;

    while(1)
    {
       capture_idle_0();
       capture_idle_1();
   }
}


One more thing, i discover one thing. I have Frequency meter. I measure the Receiver OUT the signal unstable(in Hz). And i try to find the Transmitter OUT but i'm not sure whether that's the output not.. because i have to press the Switch then got frequency is ~550Hz and it make the Receiver stable in ~550Hz also.

I wanna to say Thank you again.

Thank You.



Sorry, but you need login in to view this attachment

Back to top
budhy



Joined: 21 Oct 2006
Posts: 836
Helped: 185
Location: Indonesia


Post20 Jan 2007 19:02   

Re: RF Receiver Interface to AT89c52


Quote:
We can't use IT0 for knowing the incoming signal, i think is because for setting perpose (set "0" invert incoming signal, set "1" 1-to-0 transition). So, i change it to IE0. Then connect the OUT signal to INT0.

This time I don't use inverter, just direct connect OUT signal to INT0, and use polling technique to measure signal 'space'/'mark' duration!
Beside that you have to measure the idle (no RF signal) voltage at IT0, then decide use time_idle_0 or time_idle_1, I mean you don't need the 2 function together, but choice 1 according the idle volate at IT0.

When I'm playing IR remote control signal, normally the 'space'/'mark' duration is smaller than 200 micro second, so I only use TL0.

Sorry I make a mistake, not IT0 but INT0

Code:

#define size 70
idata char time[size];

void capture_idle_1(void){
char i;
     while (INT0) ;
     
     i = 0;
     while (i<=size){
            TH0=0; TL0=0;  TR0 = 1;
            while (!INT0); TR0 = 0;
            time[i++] = TL0;
           
            TH0=0; TL0=0; TR0 = 1;
            while (INT0); TR0 = 0;
            time[i++] = TL0;
     }     
}

void capture_idle_0(void){
char i;
     while (!INT0) ;
     
     i = 0;
     while (i<=size){
            TH0=0; TL0=0; TR0 = 1;
            while (INT0); TR0 = 0;
            time[i++] = TL0;
           
            TH0=0; TL0=0; TR0 = 1;
            while (!INT0);TR0 = 0;
            time[i++] = TL0;
     }     
}

void main(void){
     TMOD = 0x01;
     IT0  = 0;
     
     // choice one only, capture_idle_0() or capture_idle_1()
     capture_idle_0(); // if the idle state on INT0 is '0'
     capture_idle_1(); // if the idle state on INT0 is '1'
}



What is the part number of the RF Receiver chip?
Back to top
Help



Joined: 15 Feb 2005
Posts: 560
Helped: 4


Post21 Jan 2007 5:16   

Re: RF Receiver Interface to AT89c52


Hi,

budhy wrote:

This time I don't use inverter, just direct connect OUT signal to INT0, and use polling technique to measure signal 'space'/'mark' duration!

Is it we set IT0=0 then the uC will know we are using Inverter? If we no use IT0 function then can we use other port pin?
Yes, your measure signal 'space' & 'mark' duration is work. Good.

Finally the graph comeout with standard pattern already ha.. But what we can know from the graph?

I wonder why i have to capture_idle_1 then get the result when Switch is press, please can you explain to me? what you mean measure the idle voltage IT0, how to measure IT0, is it measure the INT0 pin without connecting Receiver Signal? If initial is Hi then we select capture_idle_1?
If our code select capture_idle_0, the result all the time is the same.

I don't know the RF Reciver part number but it states KXDJS2024 15.04.2005 there. Is it tht's what you wan? The RF Reciver is from the Central Locking Car, i thought from China.

So, what's the next step we have to do?

Thank You.



Sorry, but you need login in to view this attachment

Back to top
budhy



Joined: 21 Oct 2006
Posts: 836
Helped: 185
Location: Indonesia


Post21 Jan 2007 10:31   

Re: RF Receiver Interface to AT89c52


Quote:
Is it we set IT0=0 then the uC will know we are using Inverter?

No, doesn't like that
Set IT0=0 mean we'll monitoring INT0 pin as logic level ('0' or '1')
Set IT0=1 mean we'll monitoring INT0 pin as logic transsition ('1' to '0')
In our case, IT0 doesn't take any effect

Quote:
If we no use IT0 function then can we use other port pin?

IT0 just define how to trigger IE0 flip flop, no other function

Quote:
I wonder why i have to capture_idle_1 then get the result when Switch is press, please can you explain to me?

I hope this illustration can give you a clear situation
RF Receiver Interface to AT89c52

Quote:
what you mean measure the idle voltage IT0, how to measure IT0, is it measure the INT0 pin without connecting Receiver Signal? If initial is Hi then we select capture_idle_1?
If our code select capture_idle_0, the result all the time is the same.

Use voltmeter to measure the voltage at INT0 pin when no key pressed, the '0' or '1' of INT0 at that condition determine whether you need time_idle-0 or time_idle_1.

Quote:
Finally the graph comeout with standard pattern already ha.. But what we can know from the graph?

We don't need graph, but the number (periode of 'Space'/'mark'). Each key has it own unique 'Space'/'mark' number, it is the what we recoqnize which is the key pressed.

Please re-capturing the 'Space'/'mark' number of each key, and send itu to me.
(do it once for each key)
Back to top
Help



Joined: 15 Feb 2005
Posts: 560
Helped: 4


Post21 Jan 2007 14:42   

Re: RF Receiver Interface to AT89c52


Hi,

Thank for your good explanation. It very helpfull for me.

What your mean re-capture the 'Space'/'mark' number of each key?
I already done it. Is it any problem in Graph2?
- Test1 and Test2 in Blue color graph is for Switch 1.
- Test3 and Test4 in Green color graph is for Switch 2.
- Test5 and Test6 in Yellow color graph is for Switch 3.

I capture 2 times for each key/Switch for us to do comparison.
If wan to re-capature the 3 key again, please let me know again. I will like to do it again.

Thank You.



Sorry, but you need login in to view this attachment

Back to top
budhy



Joined: 21 Oct 2006
Posts: 836
Helped: 185
Location: Indonesia


Post22 Jan 2007 3:58   

Re: RF Receiver Interface to AT89c52


Some question:
1. You use idle_1, it mean when no key pressed the voltage at INT0 is '1'. But why there is idel_1 no data graph? Does it mean without any key pressed there are still a pulses stream on OUT pin?
At this case I think you have to use osciloscope to make sure
2. What is the meaning of CYCLE (blue bar)?

Beside the graph, would you like to send the raw data too?
Back to top
Help



Joined: 15 Feb 2005
Posts: 560
Helped: 4


Post22 Jan 2007 5:28   

Re: RF Receiver Interface to AT89c52


Hi,

budhy wrote:

1. You use idle_1, it mean when no key pressed the voltage at INT0 is '1'. But why there is idel_1 no data graph? Does it mean without any key pressed there are still a pulses stream on OUT pin?

We only can use idle_1 but i am sure the INT0 is '1' when we never connecting the OUT because i got measure it (between the OUT and INT0 i have add one driver Gate 7404, i think from there we already invert the signal already.). Now i also worry whether the OUT signal is stable on Hi/Lo not when no key pressed. If not the 7404 will hap-logic(sometime Hi, sometime Lo). May be because of that we get the idel_1 no data graph. I confirm it again then let you know.

If the OUT signal couse the 7404 signal not stable, what can i do?

budhy wrote:

2. What is the meaning of CYCLE (blue bar)?

The CYCLE(blue bar) is nothing, it just let us know the number Buffer data. We have 70 data in buffer.

Please check the graph that you wan? If not please me know again.

Thank You.



Sorry, but you need login in to view this attachment



Last edited by Help on 22 Jan 2007 16:14; edited 1 time in total
Back to top
Help



Joined: 15 Feb 2005
Posts: 560
Helped: 4


Post22 Jan 2007 11:29   

Re: RF Receiver Interface to AT89c52


Hi,

I already check the result. I think the Receiver signal is not so stable.



Sorry, but you need login in to view this attachment

Back to top
Help



Joined: 15 Feb 2005
Posts: 560
Helped: 4


Post23 Jan 2007 11:46   

Re: RF Receiver Interface to AT89c52


Hi,

Here is the actual waveform from Oscilloscope for Transmitter and Receiver.
Please have a look. If anyone know how to solve my problem please help me.

Thank You.
Back to top
budhy



Joined: 21 Oct 2006
Posts: 836
Helped: 185
Location: Indonesia


Post24 Jan 2007 10:28   

Re: RF Receiver Interface to AT89c52


Assume the waveform at INT0 as :
RF Receiver Interface to AT89c52

try this
Code:
#define size 70
idata char time[size];

void capture_idle_0(void){
char i,wait;
     do {
         TH0=0; TL0=0; TR0 = 1;
         while (!INT0) ;
         wait = ((256*TH0)+TL0<10000);
         if wait while (!INT0) ;
         ) while wait;
     
     i = 0;
     while (i<=size){
            TH0=0; TL0=0; TR0 = 1;
            while (INT0); TR0 = 0;
            time[i++] = TL0;
           
            TH0=0; TL0=0; TR0 = 1;
            while (!INT0);TR0 = 0;
            time[i++] = TL0;
     }     
}

void main(void){
     TMOD = 0x01;
     IT0  = 0;
     
     capture_idle_0(); // if the idle state on INT0 is '0'
}
Back to top
Help



Joined: 15 Feb 2005
Posts: 560
Helped: 4


Post25 Jan 2007 5:53   

Re: RF Receiver Interface to AT89c52


Hi,

I already capture the waveform for Receiver Signal Driver Output(7404) - INT0 Signal please have a look.

RF Receiver Interface to AT89c52

The signal to INT0 is not stable will couse the captured Idle_1 time is different. When i doing the experiment, i alway receive data.

I use Idle_1 to capture. Because i got add a driver between OUT and INT0.

I recorded the result on Graph4.
The Key1_pressed more easy to capture.
Key2_pressed and Key3_pressed difficult to capture. Sometime we can't get actual pattern result and sometime i was pressing the key quite sometime then can be capture the result but still can't get accurate result.
I have add the LEDs and use Oscilloscope to measure the result.
Code:
void capture_idle_1(void){
char i,wait;
     do {
        P1_0 = 0;

         TH0=0; TL0=0; TR0 = 1;
         while (INT0);

         wait = ((256*TH0)+TL0<10000);

         if(wait)
       {
          while(INT0);
       }
         }while(wait);

     P1_0 = 1;
     i = 0;
     while (i<=(time0-1)){
   
          P1_1 = 0;

            TH0=0; TL0=0; TR0 = 1;
            while (!INT0); TR0 = 0;
            time_idle_1[i++] = TL0;
 
         P1_1 = 1;
           
            TH0=0; TL0=0; TR0 = 1;
            while (INT0);TR0 = 0;
            time_idle_1[i++] = TL0;

         P1_1 = 0;
     }
     
         P1_1 = 1;

}



Sorry, but you need login in to view this attachment

Back to top
budhy



Joined: 21 Oct 2006
Posts: 836
Helped: 185
Location: Indonesia


Post25 Jan 2007 6:12   

Re: RF Receiver Interface to AT89c52


Sorry, there is a mistake, the right one is:
Code:
     do {
         TH0=0; TL0=0; TR0 = 1;
         while (!INT0) ;
         wait = ((256*TH0)+TL0<10000);
         if wait while (INT0) ;
         ) while wait;

if you can't capture anything, then try this
Code:
void capture_idle_1(void){
char i,wait;
     do {
         TH0=0; TL0=0; TR0 = 1;
         while (INT0) ;
         wait = ((256*TH0)+TL0<10000);
         if wait while (!INT0) ;
         ) while wait;
     
     i = 0;
     while (i<=size){
            TH0=0; TL0=0; TR0 = 1;
            while (!INT0); TR0 = 0;
            time[i++] = TL0;
           
            TH0=0; TL0=0; TR0 = 1;
            while (INT0);TR0 = 0;
            time[i++] = TL0;
     }     
}
Back to top
Help



Joined: 15 Feb 2005
Posts: 560
Helped: 4


Post25 Jan 2007 6:46   

Re: RF Receiver Interface to AT89c52


Hi,

This code can't work. If the Key is pressed there are no data capture after release the Key then can be capture.
Code:
     do {
         TH0=0; TL0=0; TR0 = 1;
         while (!INT0) ;
         wait = ((256*TH0)+TL0<10000);
         if wait while (INT0) ;
         ) while wait;


This code working fiine and better then early. No Key hang.
Code:
void capture_idle_1(void){
char i,wait;
     do {
         TH0=0; TL0=0; TR0 = 1;
         while (INT0) ;
         wait = ((256*TH0)+TL0<10000);
         if wait while (!INT0) ;
         ) while wait;
     
     i = 0;
     while (i<=size){
            TH0=0; TL0=0; TR0 = 1;
            while (!INT0); TR0 = 0;
            time[i++] = TL0;
           
            TH0=0; TL0=0; TR0 = 1;
            while (INT0);TR0 = 0;
            time[i++] = TL0;
     }     
}


But how can we conclude the result? At this state the result can acceptable?

Thank You.



Sorry, but you need login in to view this attachment

Back to top
budhy



Joined: 21 Oct 2006
Posts: 836
Helped: 185
Location: Indonesia


Post25 Jan 2007 6:54   

Re: RF Receiver Interface to AT89c52


You'll get a unique space/mark period table for each key, use this unique data to identify which key is pressed
Back to top
Help



Joined: 15 Feb 2005
Posts: 560
Helped: 4


Post25 Jan 2007 17:57   

Re: RF Receiver Interface to AT89c52


Hi,

You mean unique space/mark period table = time[] buffer ? If yes, the OUT data is not constant how can we do comparison?

Thank You.
Back to top
budhy



Joined: 21 Oct 2006
Posts: 836
Helped: 185
Location: Indonesia


Post25 Jan 2007 18:26   

Re: RF Receiver Interface to AT89c52


Quote:
You mean unique space/mark period table = time[] buffer ?

Yes! Make a table from each Key!

From your latest Excel file, I see the OUT signal is stable!

if the OUT data is really not stable as you say, then we can't recognize the transmitted signal.
Back to top
Arabic versionBulgarian versionCatalan versionCzech versionDanish versionGerman versionGreek versionEnglish versionSpanish versionFinnish versionFrench versionHindi versionCroatian versionIndonesian versionItalian versionHebrew versionJapanese versionKorean versionLithuanian versionLatvian versionDutch versionNorwegian versionPolish versionPortuguese versionRomanian versionRussian versionSlovak versionSlovenian versionSerbian versionSwedish versionTagalog versionUkrainian versionVietnamese versionChinese version
Post new topic  Reply to topic    EDAboard.com Forum Index -> Microcontrollers -> RF Receiver Interface to AT89c52
Page 1 of 2 All times are GMT + 1 Hour
Goto page 1, 2  Next
Similar topics:
PCF8570 (xRAM) interface to AT89C52 (6)
LCD 4-bits Interface to AT89C52 (11)
schematic and interface nokia 8250 to at89c52 (1)
interface DS-1558(REAL TIME CLOCK) with AT89C52 (2)
interface the AT89C52 to the serial EEPROM AT24C04 (7)
AT89C52 (14)
at89c52 (2)
AT89C52 Prog (2)
Help me on AT89c52 (4)
AT89C52 EVALUATION BOARD (1)


Abuse || Administrator || Moderators || Support us || sitemap
topic RSS