Basic serial comms configuration question

stobby256

New Member
Hi All,

I have a 28X2 and a couple of 14M2s that will be communicating over a serial link at 9600B.

The question I have probably has a simple answer - When configuing serout, the spec gives me this: -

For all other parts (e.g. all X1, X2, M2 parts)

4MHz 8MHz 16MHz 32MHz 64MHz
T600_4 T1200_4 T2400_16 T4800_32 T9600_64
T1200_4 T2400_8 T4800_16 T9600_32 T19200_64
T2400_4 T4800_8 T9600_16 T19200_32 T38400_64
So, for example, if all my chips are all running at 16MHz (set freq m16) - do I use T9600_16?
 

Goeytex

Senior Member
Yes

Alternatively all the chips could use N9600_16 where the Serial line idles low instead high.

One reason to use N9600_16 might be to prevent one device from ghost powering another device through the serin pin. With "T" (Idle High), when not transmitting, the sending device puts a high signal on the receiving device's input pin. This high then goes though the internal ESD diode to the internal positive rail, thus "ghost powering" the receiving Picaxe, even when its power is removed. This may or may not matter in your application.
 

lbenson

Senior Member
As Goeytex states, on certain pins, certain picaxes will be "phantom powered" on RX pins (serial in) which idle high (e.g., with T9600_16). This can be very confusing for debugging, when your program doesn't restart when you power cycle.

Where you can control what is sent, "idle low" (e.g., with N9600_16) will prevent that. With devices where you can't control the "true/inverted" state, I have found that an in-series 10K resistor will suffice to keep the picaxe from being phantom powered on an RX pin. YMMV
 

stobby256

New Member
Thanks guys, Idle Low N9600_16 it will be !

It was just that the explanation on the Picaxe site explaining BAUD_XX did not exist - I was checking its correct use!
 
Top