Hi Skimask,
I had the simple data tx/rx working ok over wireless on the internal clock, I could try it on crystals (once I order some). Does the code look ok apart from that? Have not used serin/out much.
regards Nick
Hi Skimask,
I had the simple data tx/rx working ok over wireless on the internal clock, I could try it on crystals (once I order some). Does the code look ok apart from that? Have not used serin/out much.
regards Nick
I'll take a better look at the code later on...(heading out the door)...
I think the fact that it was working and now it's not working is just luck. Internal freq varies with temp, voltage, humidity, sun spot cycle, color of pants, you name it, it varies because of it...ok maybe not everything
Moral of the story, usually internal osc's are hit/miss when using serial.
SerOut txout, n2400, [ $aa,Manch ] is only sending $aa followed by the low byte of Manch.
SerOut txout, n2400, [ $aa,Manch.LowByte,Manch.HighByte] will send both bytes of Manch.
Modify the receive routine also. SerIn rxin, n2400, [$aa], Manch.LowByte,Manch.HighByte.
Hi Bruce,
Thanks for that, was not 100% sure if I could send a word out in a single statement, just looked at the serout command in the manual and found the answer on the 2nd line.
I will modify the code later tonight and see what happens.
regards Nick
If anyone uses the code I have posted you need to change-- Manch var byte--to--Manch var word---in the Tx code. This have me stumped for 10 mins..lol.
Last edited by Agent36; - 26th May 2008 at 17:58.
Hi Skimask and Bruce,
Thanks for the info, I now have my project up and running. The only other changes I had to make apart from the ones already listed, was to change the variables used in the ADC result and PWM output.
regards Nick
If your system loses or gains half a bit time due to noise, clock slip, whatever, then Manchester goes out of sync and stays out for the rest of the message. BiPhase on the other hand is brought back into sync with the arrival of the very next '1' bit. BiPhase does not propagate errors. The code for biphase is virtually identical to manchester. Manchester needs very high accuracy clocks at both ends. BiPhase is much more tolerant of clock differences. The downside of biphase is that the channel needs a somewhat wider bandwidth.
Search for biphase code in the forum. I have posted on it before.
HTH
BrianT
Hi Brian,
Thanks for the info, I have just searched biphase and found a couple of posts. How do you encode and decode in laymans terms?
This is as far as I have got with my rf;
I can toggle the output of a pic by sending a set of 0's and 1's to balance the data slicer, followed by a data byte. The rf modules I am using are AM and are supplied from RF solutions.
My next step was the code posted above, the aim of this was to control the speed of a motor using the rf modules and pics. By encoding the adc result and out putting it in the form of pwm.
Once I had the code working on the breadboard I transfered it to the Tx/Rx, at this moment in time I can control the motor at a 4 meter range, I have not tried any further as I have not had the time. This has all been acheived using the internal clock set at 8meg, I have taken skimasks advice and ordered some crystals to improve the timing errors. Any other improvements I can make would be an advantage.
Kind regards Nick
Bookmarks