Author Topic: Can RFM69HW transmit without PREAMBLE and SYNC? [solution]  (Read 1397 times)

biter

  • NewMember
  • *
  • Posts: 3
  • Country: pl
Hi,
Is it possible to transmit a data but without PREAMBLE AND SYNC? What I want to do is transmit a buffer which will be contain all these bytes. For example my buffer
is [0xAA,0xAA,0xAA,sync1,sync2, data[0],data[1],data[2]...]

Could someone post here a pseudocode? I mean:
1.set this registers
2.set buffer
3.maybe set size of buffer
4.set something to go

I was trying different ways but still not working  and I am a little confused now.
I don't care about receiver. It's other transceiver and only what i want it's to send some data to this transceiver.
« Last Edit: May 31, 2016, 01:25:44 PM by Felix »

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: Can RFM69HW transmit without PREAMBLE and SYNC?
« Reply #1 on: May 30, 2016, 09:13:54 AM »
Maybe, but not with my library by default. You might have to set some registers manually.
Check the datasheet, perhaps the non packet mode allows something like that although any transmission might need a preamble.
« Last Edit: May 31, 2016, 01:25:32 PM by Felix »

biter

  • NewMember
  • *
  • Posts: 3
  • Country: pl
Re: Can RFM69HW transmit without PREAMBLE and SYNC?
« Reply #2 on: May 30, 2016, 10:16:00 AM »
Thank you.
Maybe you can help me with this. I am trying to send:
PREAMBLE | SYNC  | DATA (manchester)

6 bytes of PREAMBLE:
/* 0x2C */ { REG_PREAMBLEMSB, 0x00 },
/* 0x2D */ { REG_PREAMBLELSB, 0x06 },

3 bytes of SYNC:
/* 0x2E */ { REG_SYNCCONFIG, RF_SYNC_ON | RF_SYNC_FIFOFILL_AUTO | RF_SYNC_SIZE_3 | RF_SYNC_TOL_0 },
/* 0x2F */ { REG_SYNCVALUE1, 0xBB },     
/* 0x30 */ { REG_SYNCVALUE2, 0xBC },
/* 0x31 */ { REG_SYNCVALUE3, 0xBD },

32 bytes of DATA - Manchester coding:
/* 0x37 */ { REG_PACKETCONFIG1, RF_PACKET1_FORMAT_VARIABLE | RF_PACKET1_DCFREE_MANCHESTER | RF_PACKET1_CRC_OFF | RF_PACKET1_CRCAUTOCLEAR_ON | RF_PACKET1_ADRSFILTERING_OFF },
/* 0x38 */ { REG_PAYLOADLENGTH, 32 },

data[0] = 0x1F;
....

I don't need to send these bytes:
SPI.transfer(REG_FIFO | 0x80);
SPI.transfer(bufferSize + 3);
SPI.transfer(toAddress);
SPI.transfer(_address);
SPI.transfer(CTLbyte);

What I need is sending byte data[0] - 0x1f after sync 0xBD. I was trying to change a sendFrame function but no success and I don't understand this first line
SPI.transfer(REG_FIFO | 0x80) - this one bit is very important and for me there is no place for that.







biter

  • NewMember
  • *
  • Posts: 3
  • Country: pl
Re: Can RFM69HW transmit without PREAMBLE and SYNC?
« Reply #3 on: May 31, 2016, 08:48:42 AM »
Hi. We can close this post.
I was trying to implement a wireless mbus protocol using your library. I can confirm that everything works fine. The problem was with my data buffer.

SPI.transfer(REG_FIFO | 0x80);
SPI.transfer(data);

I needed also change RF_PACKET1_DCFREE_MANCHESTER to RF_PACKET1_DCFREE_OFF and encode data manually.