RF Preamble

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
BUTA_1301626
Level 4
Level 4
50 replies posted 25 replies posted 10 replies posted

I want to make RF communications.The RF device has a protocol. "TX : preamble + sencron + data1+.....+dataX"  5 bytes can be 0x55 or 0xAA. The times of sent 1 and 0 must be equal.The length of this bit directory may vary depending on the application requirements or constraints. 5 bytes 0x00 + 5 bytes can be 0xFF or the user can decide what will happen. The preamble is not observed on the RX side. Only the sencron is searched, then the data is read.

udea preamble.JPG

Pin Name:DIO

  DIO_Write(0x55); Preamble

    DIO_Write(0x55);Preamble

    DIO_Write(0x55);Preamble

    DIO_Write(0x55);Preamble

    DIO_Write(0x55);Preamble

    DIO_Write(0x00);Sencron

    DIO_Write(0x00);Sencron

    DIO_Write(0x00);Sencron

    DIO_Write(0x00);Sencron

    DIO_Write(0x00);Sencron

    DIO_Write(0xFF);Sencron

    DIO_Write(0xFF);Sencron

    DIO_Write(0xFF);Sencron

    DIO_Write(0xFF);Sencron

    DIO_Write(0xFF);Sencron

    DIO_Write(0xFE); DATA

is this code correct?  or should I put my cydelay together for every 1 and 0 using the for loop?

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.

I'm not sure I understood you correctly ...

You can use SPI:

test.png

View solution in original post

10 Replies
himam_31
Employee
Employee
50 likes received 25 likes received 10 likes received

Hello,

Are yo using a shift register for giving out data? If yes what is the clock for that? Can you please check the output waveform? Is it meeting the requirements as given by the specification?

Thanks,

Hima

0 Likes

I don't use shift register.I examined it with oscilloscope.I can not see the output waveform using the following commands.

Pin Name:DIO

  DIO_Write(0x55); Preamble

    DIO_Write(0x55);Preamble

    DIO_Write(0x55);Preamble

    DIO_Write(0x55);Preamble

    DIO_Write(0x55);Preamble

    DIO_Write(0x00);Sencron

    DIO_Write(0x00);Sencron

    DIO_Write(0x00);Sencron

    DIO_Write(0x00);Sencron

    DIO_Write(0x00);Sencron

    DIO_Write(0xFF);Sencron

    DIO_Write(0xFF);Sencron

    DIO_Write(0xFF);Sencron

    DIO_Write(0xFF);Sencron

    DIO_Write(0xFF);Sencron

    DIO_Write(0xFE); DATA

0 Likes

Writing data to a pin (as 0x55) will not result in a waveform. The pin will be set high when the written data is != 0 and low when 0 is written to. You will need a serial device which shifts out the required signal change. Your reqirement looks like a combination of a clock, a counter and a LUT or a shift register with some logic.

Bob

0 Likes
lock attach
Attachments are accessible only for community members.

I'm not sure I understood you correctly ...

You can use SPI:

test.png

Yes that is right. but I want to know how I can do it with the command.

0 Likes

Hello ,

Can you please elaborate your query. For generating the bit sequence you need fill the sequence inside SPI TX register or another shift register.

Thanks,

Hima

0 Likes

Hello;

If we don't want to use SPI in the project. I just want to send 0x55 bytes to 0x55 bytes, 5 bytes 0x55 to pin by typing C code, which command I would use. I want to check the information on the oscilloscope.

0 Likes

Hello,

If you do not want to use SPI/Shift register, you will need to implement bit banging. May be you can refer to this example project: https://www.hackster.io/vsrs/psoc4-bit-banging-1-wire-protocol-ds18b20-thermometer-ec7530

PSoC4: Bit Banging 1 Wire Protocol (DS18B20 Thermometer) - Hackster.io

Here bit banging is implemented for a different protocol. Please make sure that you are taking care of the timing specifications needed for your design.

Thanks,

Hima

Hi;

Is this image taken from the logic analyzer?

test.png

0 Likes

yes, for the project  Design01.zip

0 Likes