Society of Robots - Robot Forum

Software => Software => Topic started by: strat321 on February 22, 2014, 06:30:38 PM

Title: UART settings
Post by: strat321 on February 22, 2014, 06:30:38 PM
I need to set the UART protocol on the Axon II to
Baudrate:115200
8 bits
1 stop bit
Even parity
Does Webbot lib support this?
Title: Re: UART settings
Post by: Gertlex on February 22, 2014, 11:43:07 PM
Those are all the defaults, except maybe the Baudrate.  Create your project in Project Designer (or WebbotLib Studio) for an Axon 2, add a UART to your project, and it will prompt you to select the baud rate of choice.

So far, I've yet to ever work with UART where I had to worry about anything other than setting the Baudrate.

Hope that helps.
Title: Re: UART settings
Post by: Webbot on February 23, 2014, 10:19:13 AM
WebbotLib supports lots of baud rates but currently one supports 8 data bits, NO parity, and 1 stop bit. Mainly coz I've never found anything needing settings of than this. So 'are you sure you need EVEN parity'.

If so - then also PM me as I'll need to ask you more questions like: WebbotLib Version, using C or C++ etc
Title: Re: UART settings
Post by: Webbot on February 25, 2014, 01:13:42 PM
Ok - got your PM and indeed you do need to have even parity. To do this is a larger job then you may believe! Partly because if I'm going to allow the parity to be set then I should also allow stop bits etc to be configured.

This is fine for raw UARTs.

The complexity comes in Project Designer when using a device that uses a UART. eg the  Blackfin camera, GPS etc etc all allow you to change the uart number being used - but, unlike the raw UART, should not allow parity etc to be changed as this is part of the protocol for the device.  So I'll have to change every device that uses a UART to say whether parity/stopbits can be changed and make sure they are backward compatible with old projects where the user never expressed a preference (ie default to parity=none, stop=1).

This will therefore mean a new release of everything: board designer, project designer, webbotlib, and then all repeated for Studio variants....

So it aint gonna be quick! But I guess I should bite the bullet now.
Title: Re: UART settings
Post by: strat321 on February 27, 2014, 11:24:58 AM
So if in theory I would need even parity in the next month. .. I should look elsewhere?  Raspberry pi etc.?
Title: Re: UART settings
Post by: Webbot on March 02, 2014, 11:33:48 AM
That's up to you. But am close to a new release of Studio - see http://webbot.org.uk/iPoint/50.page (http://webbot.org.uk/iPoint/50.page) - or subscribe to the news feed if you want to know when its available.

Probably wont get around to doing it in non-Studio versions - as its old code. Suggest you download and use Studio - of course - if you prefer to edit files etc in the editor of your choice then its no different to the old WebbotLib + Project Designer. ie Studio has its own built in editors but you don't have to use them.
Title: Re: UART settings
Post by: Webbot on March 09, 2014, 06:45:46 PM
Latest release of Studio now allows you set the parity (none,even,odd), data bits (5, 6, 7 or 8) and stop bits (1 or 2)
Title: Re: UART settings
Post by: knossos on March 17, 2014, 03:32:13 AM
I've always wanted to  be able to set my UART to  8) data bits!
Title: Re: UART settings
Post by: strat321 on March 30, 2014, 12:26:06 PM
Thanks Webbot.