how to declare a baud rate 56000 on 14m2 or 18

paco556

New Member
Traying to monitor a serial signal on 56000 bauds on oled serial display.
I am really new in this world have read there is a number that needs to be calculated in order to get this 56000 can any body type how is the code to make a oled serial display works as ecco monitor for thiis device that has that 56000 baud rate communication? any help will be appreciated.
Thanks in advance.
Greetings
 

hippy

Technical Support
Staff member
Welcome to the PICAXE forum.

The solution for what you want to do is probably to use a PICAXE-28X2 and use the High-Speed Serial background receive.

Details on how to calculate a divisor for the HSERSETUP command can be found here -

http://www.picaxe.com/BASIC-Commands/Serial-RS232-Interfacing/hsersetup

SERIN allows only baud rates which are power-of-two multiples of 2400 baud so 56000 baud would not be achievable with SERIN.
 

AllyCat

Senior Member
Hi,

...I am really new in this...
As hippy implies, that's not at all easy with an M2 (and may be impossible), depending for example on the polarity of the serial data and whether the data format uses fixed (or at least known) -length character strings. Definitely not for a beginner because it must use the serial hardware (HSERIN) or more probably direct access using POKE/PEEKSFR commands.

But if you really want to try, I can point you to two (of my) posts that outline some of the issues.

Cheers, Alan.
 

paco556

New Member
thks what about with an x2 can be acompplish, yes I need to try point me to your posts I will be pleased to try.
 

AllyCat

Senior Member
Hi,

... it may be impossible ...
Firstly, you can only use the HSERIN pin and the signal polarity can be only "idle high" with M2s. Also you must use a 32 MHz clock (only the X2s can work up to 64 MHz). For 51k baud, you may have to receive more than 5 bytes per millisecond.

In this thread I discussed how to decode serial input data (to display on an OLED) as fast as possible. But for 51k baud you will probably need to just "grab" the bytes into a buffer (@BPTRINC) and decode them later. That is why it may be important to know how many bytes are being received.

My other thread describes problems that I encountered when using HSERIN with an M2. I was also using interrupts but they will very probably be too slow. My conclusion was that PEEKSFR RCREG was more "reliable" (error-free) than HSERIN, but ultimately it might lock-up (which is difficult to recover from).

Good luck ! ;)

Alan.
 

Goeytex

Senior Member
The simplest and most reliable way would be to use an X2 chip (20X2 0r 28X2) ,and background receive.
 

Flenser

Senior Member
paco556,

Can you give us the make and model number of the ecco monitor or a link to the documentation for the serial comms protocol that it uses?

If we have the technical details of the 56000 baud serial comms protocol that you want to process it should help the forum to better give you advice on what is possible. This will apply to our recommendations for both the M2 and X2 chips.
 
Top