RF Transmiter and Receiver FXTH87

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

RF Transmiter and Receiver FXTH87

2,016 Views
davidramirez
Contributor II

Hi.

I have a FXTH871511 Sensor but i want transmitt data to pin RF and receive this data in RFM69HW but don't work.

I need a special receiver for this sensor like CC1101 OR MKW01.

How can I can test my program trasmmited or see the frames?

Thanks if you hepls what RF receiver i can use RFM69HW or CC1101 OR MKW01 I suppose that i can use MKW01 but i dont know where i can buy that.

My code is the next in FXTH871511 and I put a inductance to 39nH to Vcc and Pin Rf and i have i my circuit a machine network to RF transmitt to 434Mhz.

#include <hidef.h> /* for EnableInterrupts macro */
#include "derivative.h" /* include peripheral declarations */


void RF_Setup(void);
void InitTPM1CH0(void);
void Send_RF_Datagram(void);
void Code_Manchester_Frame(unsigned char *ptr);
void MCU_Setup(void);
void delay(unsigned int);


void main(void) {
EnableInterrupts;
/* include your code here */
MCU_Setup();
RF_Setup();

for(;;) {
Send_RF_Datagram();
} /* loop forever */
/* please make sure that you never leave main */
}

void MCU_Setup(void)
{
PTBDD = 0X03;//Port B like Output
PTBD = 0X03;//Port B off
SIMOPT1 = 0X33;//Disable WDT, Enable Debug BDM, Stop Enable, RF Enable.
SIMOPT2 = 0X00; // Clock BUSCLK 4Mhz
/*BUSCLKS 00 bUS fREQUENCY = 4Mhz*/
}
void RF_Setup(void)
{
DisableInterrupts;

RFCR0 = 0X34; //9600 baud - Reset Value
RFCR1 = 0X78; //Set to 80 for 128 bits - largest frame
RFCR2 = 0X0E; // RF Transmission On - No EOM - Pout=5dbm 00001110
RFCR2 = 0X8E; // RF Transmission On - No EOM - Pout=5dbm 10001110
RFCR3 = 0X00; // RF Output Low -RF Power UP - One Frame Transmitted
RFCR4 = 0X01; //InterFrame timing set to 1
RFCR5 = 0X00; //No Pseudo-random number used
RFCR6 = 0X01; //VCO highest Power - Interframe timing
RFCR7 = 0X00; // RF Interrupt Disable - LVD Disable -RFM Not reset

PLLCR0 = 0XB0;
PLLCR1 = 0x63;
PLLCR2 = 0XB1;
PLLCR3 = 0X56;
EnableInterrupts;
}

void InitTPM1CH0(void)
{
TPM1SC = 0X08 | 0X02; //Clock TIMER = FBUS=8Mhz/128 - set Timer ON
TPM1C0SC = 0x00; //Configure in TBM , Interrupt Enable Address
TPM1MODH = 0XFF; //FF Fixed the OC every 1.13sec
TPM1MODL= 0XFF; //FF Fixed the OC every 1.13sec
}

void Send_RF_Datagram(void)
{
unsigned char i;
DisableInterrupts;
RFD0 = 0XFF;
RFD1 = 0XAA;
RFD2 = 0X9B;

RFD3 = 0XA1;
RFD4 = 0XB2;
RFD5 = 0XC3;
RFD6 = 0XD4;
RFD7 = 0X06;
RFD8 = 0XA1;
RFD9 = 0XA1;
RFD10 = 0XA1;
RFD11 = 0XC3;
RFD12 = 0XAA;
RFD13 = 0X90;
RFD14 = 0XBB;
InitTPM1CH0();
RFCR7_RFIACK=1;
delay(200);
Code_Manchester_Frame(&RFD0);
Code_Manchester_Frame(&RFD1);
Code_Manchester_Frame(&RFD2);
Code_Manchester_Frame(&RFD3);
Code_Manchester_Frame(&RFD4);
Code_Manchester_Frame(&RFD5);
Code_Manchester_Frame(&RFD6);
Code_Manchester_Frame(&RFD7);
Code_Manchester_Frame(&RFD8);
Code_Manchester_Frame(&RFD9);
Code_Manchester_Frame(&RFD10);
Code_Manchester_Frame(&RFD11);
Code_Manchester_Frame(&RFD12);
Code_Manchester_Frame(&RFD13);
Code_Manchester_Frame(&RFD14);

EnableInterrupts;

}

void Code_Manchester_Frame(unsigned char *ptr)
{
signed char ii;
for(ii=7;ii>-1;ii--)
{
if((*ptr)&(1<<ii))
{
RFCR3_DATA=1;
TPM1CNT=0;
while(TPM1CNT<37);
RFCR3_DATA=0;
TPM1CNT = 0;
while(TPM1CNT<41);

}
else{

RFCR3_DATA=0;
TPM1CNT=0;
while(TPM1CNT<41);
RFCR3_DATA=1;
TPM1CNT=0;
while(TPM1CNT<37);
}
}
}


void delay(unsigned int i)
{
unsigned int j;
for(j=0;j<=i;j++);
}

0 Kudos
6 Replies

1,201 Views
davidramirez
Contributor II

Thanks Dario.

I follow once step by found my mistake.

And i test TPMS_LFOCAL (); for test external clock for likely mistakes and when i debug sometimes return 0x80 in this moment i made i new board and i hope that is always fine i think that my problem is a design.

0 Kudos

1,201 Views
darioarias
NXP Employee
NXP Employee

Hi David,

Is your probe directly on the antenna? It should be directly on the antenna instead of the RF pin. Once it is in the antenna be careful, the voltage is very low. On my oscilloscope screenshot the unit is 500mV/unit so you should increase your resolution to have around 500mV/ unit for vertical and 10 or 100ms per unit for horizontal and depending on how the matching network is done, you may need to go to 50mV/unit for vertical resolution

When you debug this line TPMS_RF_SET_TX(120); It shows you "not source code available" because this is a function implemented in the firmware, so you cannot access to it.

The RF transmitter pin does not need any additional configuration in code, as long you follow the steps described in the guide: Using the Kinetis KW01 as the Receiver for the FXTH870 TPMS Sensor you have all the configuration that need to be done.

Yes, in buffer mode the 26 MHz crystal is automatically activated. According to the datasheet section 13.1.1 where it says: "Before the data can be transmitted the RFM control logic enables the external crystal oscillator and phase-locked-loop to initialize before the RF output stage can begin transmission... (the external crystal) provides the carrier frequency as well as the data rate clock needed for the data rates associated with the OOK or FSK modulation."

The code seems correct but I'll keep checking and also I'll share it with the product engineer of this technology to see if she has some ideas on what is causing the issues with the device.

Thanks for your patience,

Darío

0 Kudos

1,201 Views
darioarias
NXP Employee
NXP Employee

Hello David,

In order to probe that the module transmit you can place an oscilloscope probe on the RF antenna to watch the frames. It should not show you Vcc,  you should be able to see something like this

RF_frames.jpg

You can use an sniffer that is listening to make sure the module is transmitting

Darío

0 Kudos

1,201 Views
davidramirez
Contributor II

Hi Thanks for your interest in solve my problem.

I try to find my mistake because this sensor always is in 3.4V on antenna pin that is my Vcc.

I placed an osciloscope on RF antenna and always this pin is in Vcc.

And i have to RFM69HCW and i put this module on a promiscuous mode, and transmitter fxth87 i put a preamble and sync word (0xAA,0XAA,0XAA) like preamble and (0x01,0x01) and like show me all messages that is in the same network like a sniffer.

I attached my code.

When i debug this part show me not source available in codewarrior.
TPMS_RF_SET_TX(120);

There is something wrong in my code?

Rf trasmitter pin need some configuration add in code?

In buffer mode the crystal of 26MHz is activated automatically?

The init state RF pin is Vcc why cant I see the frames?

void enviarTrama(void)
{
/* Configure device for STOP4 - needed for measurement routines */
mediciones();
TPMS_RF_ENABLE(SET);
Init_RF();
ID_rueda();
RFCR7_RFIACK = SET; // Clear all Flags
Fill_RFBUFFER();
TPMS_RF_SET_TX(120);

}

void Init_RF(void) {
/* Turn module on in case it wasn't */
TPMS_RF_ENABLE (1);

/* In this example registers are configured by hand. Could also be */
/* done through TPMS_RF_CONFIG(). */
RFCR0 = 0x34; //Data sent to 9600bps
RFCR1 = 0x64; // set to 64 for 100 bits
RFCR2 = 0x14; // RF Transmission OFF - No EOM - Pout=5dBm - RPAGE=0 // 00001110
RFCR3 = 0x00; // RF Output Low - RF Power UP - One Frame Transmitted // 00000000
RFCR4 = 0x05; //Interframe timing set to 5
RFCR5 = 0x80; //No Pseudo-random number used VCO highest power consumption level
RFCR6 = 0x01; //VCO highest Power - interframe timing // was 00
RFCR7 = 0x18; // RF Interrupt Enabled - LVD Disable - RFM Not reset

// fDATA0=fXTAL x ((12 + 4 x CF) + AFREQ/8192)
// = 26MHz x((12 + 4 x 1) + 5644 (10110000 01100) /8192)
// = 433.9131

// fDATA1=fXTAL x ((12 + 4 x CF) + BFREQ/8192)
// = 26MHz x((12 + 4 x 1) + 5674 (1011000101010) /8192)
// = 434.0083

// 434.0083 - 433.9131 = 47.6kHz

/* 434MHz */
PLLCR0=0xB0;// 1011 0000
// AFREQ[12:5]
PLLCR1=0x60;// 01100 0 00
// AFREQ[4:0] POL CODE[1:0]
PLLCR2=0xB1;// 10110001
PLLCR3=0x56;// 01010 110 CF=1 434MHz MOD=1 FSK CKREF=0 DX signal not generated
//PLLCR3=0x54; // 01010 100 CF=1 434MHz MOD=0 OOK CKREF=0 DX signal not generated
return;
}

0 Kudos

1,201 Views
darioarias
NXP Employee
NXP Employee

Hi David,

I don't know why the RFM69HW does not work, I'm not familiar with that receiver, but the first step is to make sure that the FXTH87 is working correctly.

I would recommend using the MKW01 instead, we have a very detailed guide: Using the Kinetis KW01 as the Receiver for the FXTH870 TPMS Sensor, that explains how to properly configure both (receiver and transmitter) to make a successful communication, maybe you could use that document as a reference.

You can buy the part directly from our web page, the part number is MKW01Z128CHN, we also have the MRB-KW01 which is the evaluation board of this part.

pastedImage_1.png

Click the part number and then buy direct.

Darío

0 Kudos

1,201 Views
davidramirez
Contributor II

Hi Thanks for your reply Dario.

I'm running my code with the firmware in FxTH1502DT1, I read the registers for the acceleration, and other and works fine but if a want to transmit this data by RF i don't know how can i probe that  the module trasmitt? because is a high frecuency, and there is a inductor to Vcc for Pin RF and always show me Vcc for this Pin.

Is correctly that this pin always join to Vcc even when I transmit?

There is some tools for probe that trasnsmition is woking in module FXTH87?

0 Kudos