Serial mode 9600 bps, no parity, 2 stop bits

westaust55

Moderator
While not a guarantee, I would suggest that there is every possibility that the PICAXE can communicate successfully.

While the PICAXE parts nominally communicate as 8 bits, no parity and 1 stop bit, for transmissions there is a pause between each byte that is roughly the same duration as a stop bit.

I posted on this forum about my project for a model railway accessory controller to use with the NCE CABBus where 2 stop bits are specified.
My project using a 20X2 works perfectly well. See here: http://www.picaxeforum.co.uk/showthread.php?28444

The pertinent part extracted from the manual provided in that thread is as follows:

The NCE Cab-Bus protocol has the data transmission as 9600 baud rate with 8 data, No parity and 2 Stop bits whereas the PICAXE serial communications commands are based upon 8 data, no parity and 1 stop bits.

Fortunately, the inter-byte period for PICAXE serial transmissions is approximately 108 μsec which is the same duration as 1 bit at 9600 baud (104 μsec). Thus the idle state between each transmitted
byte is accepted by the NCE DCC command station as the second stop bit. As the PICAXE microcontrollers only expect 1 stop bit this presents no problem in receiving data from
the NCE Cab-Bus and in fact results in some additional time for switching between receive and transmit modes.
 

coparu67

Senior Member
Thank you westaust55
I have made some different tries and this code works fine for me
I don't know why! :)


Code:
;CHI035 / PICAXE-18M2
;C.0 <- Tx (without R-pull-down)
;C.1 -> Rx (without R-pull-down)
;CMPS11

SYMBOL CMPS11_Angle16bits = $13         ;  0-3600 
setfreq m8
do  
       serout C.1, T9600_8, (CMPS11_Angle16bits)       
       serin C.0, T9600_8, b1,b0;          
       debug
loop
 
Top