I have made a setup using UNO (Sender) and NANO (Receiver) in which the UNO sends the frame 1010 11000111 and the NANO receives the frame correctly. The bit period of 1 ms has been generated using Timer-1 of the MCU. The UNO sends the test frame at 5-sec interval. Check that the codes could be useful for you.
Well done Mostafa. However, as you can see from my shot, it detects the string, then it kind off compares it with each bit passing through. This shot was taken after I've touched the test button once. The binary string 11000111 is sometimes displayed as 11000011 so instead of time-constrained detection, a rising/falling edge detection could be implemented better. But regards, this is a great approach so far.
@Robin2 There is no document. Like I was saying, this system was made by someone else (3rd party). I'm trying to gather more information from him as we speak.
PS. My attachment is in this reply, i haven't figured out how to post them inline.
alexceltare2:
PS. My attachment is in this reply, i haven't figured out how to post them inline.
You can place your image inline along with your post. The procedures are:
Attache the file.
Save your post.
Go to your post. Place the cursor on the save file. Click right button and 'copy link address.'
Open your post in the More-->Modify mode.
Place the cursor at a place (on your post) where you want to place your image.
Place the cursor on the 'Insert a link' icon of toolbar and left click. A small window will pop-up. Place the cursor in the inputbox. Press Cntrl-V and then click OK.
Save the post and observe that the image has appeared inline along with your post.
alexceltare2:
Thanks. One last thing though for Mr. @GolamMostafa. instead of the timers, can't i just use delay() instead?
I tried first with delay(); but, it did not work due to timing synchronization. The delay() function works on interrupt using Timer-0, and there are time gaps when return is considered. The use of dedicated Timer-1 is free from all these unwanted complications and we get exact timings for both the receiver and transmitter; there is a fantastic synchronization.
GolamMostafa:
I tried first with delay(); but, it did not work due to timing synchronization. The delay() function works on interrupt using Timer-0, and there are time gaps when return is considered. The use of dedicated Timer-1 is free from all these unwanted complications and we get exact timings for both the receiver and transmitter; there is a fantastic synchronization.
I got it. Thanks for that. The reason I'm asking is because I'm trying to replicate the same thing on another chip, namely the TI CC430F5137 using panStamp API for Arduino. There are a few variable differences and classes but your help is greatly appreciated and will make things faster.