Custom baud rate on 14M2 to read Renix-ECU.

iz3kxw

New Member
Hi guys,

here we are with a new question, I'm working to a new project, but before start to do something i must clarify a few things.
The project plans to read with a 14M2 picaxe the serial out of the main board of my car, and after processed the data show the value on a lcd display.
The car is a Jeep Cherokee xj 4.0 1989, the mainboard is Renix ECU and the serial protocol is 62500, N, 8, 1 bauds.
The baud rate is a not standard one, how can i read it with my picaxe?
Is any instruction to customize the serial baud rate?
Thank you for your help.
Andrea.
 

bpowell

Senior Member
Check out the hsersetup command in manual 2. There is a formula for calculating a custom baud rate.
 

hippy

Technical Support
Staff member
The HSERSETUP command allows the baud rate to be specified, eg B9600 and it is possible to calculate user defined baud rates. I believe the equation is -

N = ( ( MHz * 250000 ) / baud ) - 1

So for B62500_8, that would be -

N = ( ( 8 * 250000 ) / 62500 ) - 1 = 31

So -

Symbol B62500_8 = 31
HSerSetup B62500_8, ...

The PICAXE M2 chips only have limited background receive capability so you will probably need to use an X2 chip, and probably the 28X2 with 1024 bytes of background receive buffer rather than the 20X2 which only has 128.
 

iz3kxw

New Member
Hi Hippy,

I'm reading now the manual-2,
The HSERSETUP say:

n = (( Fosc / baud rate ) / 4 ) - 1

so at 4 Mhz, 62500 baud rate should be:

n= ((4000000/62500) / 4 ) - 1 = 15 isn't it?

correct me if I'm wrong.

Andrea.
 

Goeytex

Senior Member
Both are correct. hippy calculated for 8Mhz.

I am fairly sure that the higher the Picaxe clock frequency the more accurate the final baud rate will likely be. I would possibly clock the Picaxe at 16 Mhz and use a value of 63 or clock at 32 MHz and use a value of 127.
 

inglewoodpete

Senior Member
I'm with Goeytex on that one. If you need to receive more than 2 bytes at a time (very likely) then use the 20X2. I'd run the chip at its fastest rate: certainly faster than 8MHz.

If you are struggling for space (is that the reason for the 14M2?), then the 20X2 SMD is just a little smaller. I describe how I mounted a 20X2 SMD on a 14-pin DIL plug here.
 

iz3kxw

New Member
Hi Inglewoodpete, you are right, the 14M2 can receive in background 2 bytes at a time, and for my project is non enought.
i thought to use 14M2 just because i have some of those in my laboratory, I don't have problem of space, I can easily use the 20x2.
Thank's again for your help.

andrea.
 
Top