- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes that is right. but I want to know how I can do it with the command.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi;
Is this image taken from the logic analyzer?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yes, for the project Design01.zip