PDA

View Full Version : Question about sending data serially



FromTheCockpit
- 31st July 2011, 13:44
Hi, I have two RF modules from Linx - HP3 series. They can be programmed serially. I would like to know how? I have never used synchronous way of sending data upto now.
can someone provide a little insight into how to perform the function as mentioned in the attachment please.
5810

Thanks in advance.

Szczepaniec
- 31st July 2011, 20:51
I am hoping somebody that really knows what they are talking about comes buy and sets you in the exact direction you need to be going but this should at least get you going in the general direction until somebody comes along and really saves you. The data line is just High or Low (1 or 0). You set the data pin high for a 1 and low for 0. The clock line is
just to let the Linx part know when you are sending a bit because otherwise it would not know whether a 1 is just a long bit for two successive 1s and the converse for 0. The easiest way to set this up that has worked in the past for me is to just have the clock pin alternate between high and low with a pause 1 for each (it is slow but it works). Every time the clock pin is high also set the data pin to the appropriate high or low. If you wanted to send a binary 01011 you would do the following.

Portx.x var clock
portx.x var data

pause 1
high clock
pause 1
low clock
pause 1
high data
high clock
pause 1
low data
low clock
pause 1
high clock
pause 1
low clock
pause 1
high data
high clock
pause 1
low clock
pause 1
high clock
(data was left high from last "1")

This is the longest most drawn out way to do this but probably the simplest to understand. I hope it helps.

mackrackit
- 1st August 2011, 00:03
I have not looked at the data sheet for your part but i will guess the SHIFTOUT command will work.

Szczepaniec
- 1st August 2011, 00:59
I have not looked at the data sheet for your part but i will guess the SHIFTOUT command will work.

Wow. They have a feature that includes all of that. That looks even easier.

mackrackit
- 1st August 2011, 01:21
http://www.picbasic.co.uk/forum/content.php?r=165-Serial-EEPROM-Part-1
May help a little... Should be the same concept.