Hi Titanvision,
For PDS questions, go to --> http://www.picbasic.org/forum
Cheers.
Ok I've got to ask the question...
How would one go about providing automatic baud rate detection with PBP?
I did a quick search of the forums, but did not find anything on this topic. If someone does know of an example, can you please post a link here. Or perhaps we can do some tinkering with it here, and come up with some code that'll work. I'll be doing some more research into this. So stay tuned...
Well i think... just a thought, that is feasable and accurate if the Serial data that comes to the PIC have a Special kind of header like at least 2 bytes wide. Let's say the Master will send $55 as header
$55= %0101 0101
you measure the gaps between 1 and zero with internal timer or whatever else method and once it's done, you calculate the baudrate.
So, my assumption should be correct if the master send few $55 or $AA + some kind of special Synchro character.
at the end you have a pseudo code like
- 1. Measure incoming $aa $55 pulse width
- 2. calculate and set according baudrate
- 3. Waiting for synchro byte... bytes or string
- 4. Get serial data with according baudrate
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Thanks you all, is there a codes samples can be offered?
As I mentioned I am beginner with proton development suite and pic basic pro compiler,
Mister e was given some good high light,
somehow my points is my target X device baud rate unknown, device it might be even or odd parity, I want to build a baud trace function for that, when I get correct handshake with target device I take that result in temporary variable as a my default baud rate for communicate with that device..
If I made connection to another X device process routines will be same,
Baud rates range can be 150 ~ 115000 it doesn’t matter what baud rate is come or generated from X device, for example it can be 9900.
So far I get some information from Other forms and manual of compilers what I am using for instance 1000000 / baud rate – 20 gives decimal numbers set up my device sufficient, if I know my target X device will communicate with baud rate for example 9600 above mentioned calculation formula result Hex format should be 54h .
It might be there is some limitation with micro controller according the clock rate however my theory I do not want to depend on micro controller serial port pins it can be shifted any I/O pin get a freedom of max usage of such a micro controller.
Regards
Joe
Joe,Originally Posted by titanvision
You are asking too much.
Start small.
Think about how this could be solved.
Steve's approach is something you could start with.
Let's assume the "unknown" device sends out a (more or less) continous datastream
at unknown Baudrate, Parity etc. and there is now way to influence that Datastream.
So there will be no $55 or $AA Pattern you could sync to.
It will be a challenge to detect the comms parameters.
Even worse if the "unknown" device sends out data on request only.
Again,
start small, let your PC transmit data and try to detect it on your PIC.
(and you'll soon see what I mean)
regards
Ralph
_______________________________________________
There are only 10 types of people:
Those who understand binary, and those who don't ...
_______________________________________________
Thank you Ralph,Originally Posted by NavMicroSystems
I understand what you mean; somehow I have short of experience with PDS and PBP compilers. Anyway your advice still appreciates
Regards,
Joe
Bookmarks