PIC Auto-baud detection

Status
Not open for further replies.

dman776

New Member
I'm looking for suggestions on how to implement an auto-baud detection scheme in an PIC MCU using PicBasic Pro?
 
I doubt you could do it in PIC BASIC?, you would probably need to use assembler routines - but you first need to decide on your scheme for doing the auto-detection. Usually, this requires a specific known character being sent - I don't see any way of reliably auto-detecting random characters.
 
Look here...

I personally think that it could be done in any BASIC for PICs but suspect that it's going to be a quite convoluted piece of code! Or at least too long.

I don't know if you work in Assembler (what I would use) but for the algorithm itself, look here. Ii is simply and clearly explained.

And of course, base it on a known character!

Agustín Tomás
 
auto baud

I don't mind doing it in assembler. I want to target either the 16F88 or 16F628A. Are there code samples on the board here? I haven't found any for this task.

thanks for the help.

Darryl
 
Re: auto baud

dman776 said:
I don't mind doing it in assembler. I want to target either the 16F88 or 16F628A. Are there code samples on the board here? I haven't found any for this task.

No, I don't think there are any code samples here.

Why are you actually wanting to do this?, it's always struck me as a waste of effort! - you need to have a specific known character as the first one in order to auto-detect the baudrate. If your link is that specific, you should already know the baud rate of it anyway?.

But all you need to do is measure the length of the start bit, then delay half that time to read the middle of the next bit, then delay the full start bit length to read the rest of the bits. In order to do this it's ESSENTIAL that the first bit after the start bit is the opposite polarity to the start bit, otherwise you're measuring multiples of the bit time.
 
Search for the pic16/pic18 bootloader application note from microchip.
It includes autobaud.
 
Implementing AutoBaud for 16F in BASIC will be prety interesting... I can advise you to switch to 18F1320 PIC, beause it has AatoBaud integrated in Hardware. Using it is really easy.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…