Maximum serial baud rate?

TheChief

Senior Member
I can't seem to find any info in the docs about the maximum baud rates for chips.
If anyone could point me in the right direction?
More specifically I need to know do any chips support 5700bps serial.
If not is it possible to get some buffer device to mesh them?
 

srnet

Senior Member
Look at Manual 2, the 'hersout' and 'serout' commands.

Does that provide the information you require ?
 

TheChief

Senior Member
So for a 08m2 I would need to doyble the clock speed to 8MHz but can I still set arbitrary speeds ie 5700?
 

TheChief

Senior Member
So for a 08m2 I would need to double the clock speed to 8MHz but can I still set arbitrary speeds ie 5700?
 

srnet

Senior Member
Manual 2 page 93 onwards

hserout
Polarity and baud rate are defined by the hsersetup command, which must be
issued before this command can be used.

hsersetup
Advanced Technical Information:
Users may choose to create their own ‘baud_setup’ setting for a specific desired
baud rate. ‘baud_setup’ must be a word value, and can be calculated from the
following equation (where ‘n’ is the baud_setup value)
 

AllyCat

Senior Member
More specifically I need to know do any chips support 5700bps serial.
Hi,

Do you mean 57,600 baud?

Basically, the PICaxe (software) serial commands operate at 4800 baud and "powers of 2" multiples and divisors (within certain limits, which can extended by changing the clock frequency). So I don't believe that that a 57xxx baud rate can be done directly (except perhaps by using an external oscillator/crystal on devices which can use one).

However, the hardware serial comms on most PICaxe chips can be set more flexibly, so I think that you should be able to use the hserout command (but may have to use pokesfrs to set the frequency if you really do mean 5700 baud).

Cheers, Alan.
 

TheChief

Senior Member
Thanks for your reply Alan.
Yes it's 57600bps, 8N1.
The device in question is an embedded device which will be running Linux. I have not really thought this whole end to end process through but I will probably try and use a Python based script to listen on the uart dev on the embedded device. Maybe. This will allow me to set a baud rate on the receiving device. This will be a wireless setup so I plan on using zigbee devices in the middle.
 

Goeytex

Senior Member
Serout & serin are limited to 38400 with all M2 parts. Picaxe Software serial ( serout/ serin) does not support baud rates that are multiples of 14400 ( 14400,28800,57600). However hardware serial can go as high as 115200 with the built in settings and can be set to a user configured baud rate by using the formula provided in Manual 2 page 95.

The problem with hardware serial on the M2 parts is the lack of a scratchpad buffer for background serial receive. All you get is a two byte circular buffer, that means you must process the serial data after every two bytes received. If hserin is used with an M2 part an Hserin command MUST be used for every byte received. This means that whatever is sending the data must put an added delay between every byte sent to compensate for the Picaxe command overhead.

You would be well advised to consider an X2 Picaxe for doing high speed two-way serial comms. However if you are only sending data, the M2 using hserout will work fine at 57600.
 

TheChief

Senior Member
Thanks Goeytex.
So the only way to do this would be to use the hard ware serial I/o if it transpires that I need the 57600, and by using for eg. the 20x I would be able to send x amount of data without the need to worry about concatenating it? This I think would be necessary as I will need some sort of checksum returned from the receiver so it would be near impossible to do this if data was sent byte by byte.
 

hippy

Ex-Staff (retired)
The device in question is an embedded device which will be running Linux. I have not really thought this whole end to end process through but I will probably try and use a Python based script to listen on the uart dev on the embedded device. Maybe.
How you're actually intending to use the PICAXE may affect which is best to use; any can easily communicate with Linux / PC but it may be easier to use an X2 if communicating from Linux / PC to the PICAXE.

It should be possible to set the Linux device to whatever is needed to communicate with the PICAXE but any M2 or X2 can communicate at any arbitrary baud rates using HSEROUT.
 

TheChief

Senior Member
Thanks hippy

I probably should not have asked the initial question but in any case thank you to all for your responses. It's true that you can set the baud rate via a console eg. Minicom so there should be no technical reason why this can't be done via a Python module. In any case I have learned one or two things
Thanks to all of you for your time and knowlege.
 
Top