Serin on X2

Jeremy Leach

Senior Member
I'm assuming you can use any pin for serin on an X2, and that new constants are available for the baudrates ??? e.g ...
Code:
Serin B.3,T19200_64,b0
Is this correct? Thanks.
 

Technical

Technical Support
Staff member
Yes, but at very clocks like 64Mhz some baud rates like 4800 are not available (PICAXE is going toooo fast!). Solution then is to just drop down to a slower speed.
 

Jeremy Leach

Senior Member
Thanks. Could you possibly clarify exactly what is/isn't available @64MHz on an X2? Basically I want my master to have a VERY curt conversation with my slave, so quicker the better :)
 

eclectic

Moderator
@Jeremy

I've just tried two 28X2 3V @64 MHz each

Code:
#picaxe 28X2
let dirsB = %11111111
let adcsetup = 0

setfreq eM64

main:
Serin B.3,T19200_64,b0
sertxd (#b0,"  ")
goto main


#rem

#picaxe 28x2 ;sender
let dirsB = %11111111
let adcsetup = 0

setfreq em64

main:
for b0 = 0 to 255

serout B.7,T19200_64,(b0)

pause 500
next
goto main
e
 

Attachments

hippy

Ex-Staff (retired)
Interesting you got 76800 baud working on the PC - It's not a standard baud rate and some PC's do not accept that. Would I be right in assuming COM4 goes via a USB-to-serial ?
 

eclectic

Moderator
Interesting you got 76800 baud working on the PC - It's not a standard baud rate and some PC's do not accept that. Would I be right in assuming COM4 goes via a USB-to-serial ?
Yes: AXE027 on Com4, using your terminal prog.

e
 

hippy

Ex-Staff (retired)
Thanks. Could you possibly clarify exactly what is/isn't available @64MHz on an X2?
There are four standard baud rates for all X2 SERIN / SEROUT at default 8MHz operating speed - 1200, 2400, 4800 and 9600 baud. Those scale up and down according to actual frequency used ...

Code:
 4MHz    8MHz     16MHz     32MHz     64MHz

 600_4  1200_8   2400_16   4800_32   9600_64
1200_4  2400_8   4800_16   9600_32  19200_64
2400_4  4800_8   9600_16  19200_32  38400_64
4800_4  9600_8  19200_16  38400_32  76800_64
Windows asks the device drivers if a particular baud rate is supported or not and that's the message one gets when it isn't. That's common with hardware COM ports ( though some may accept it ). What baud rates are accepted depends on hardware, Windows OS variant and device drivers.
 
Last edited:
Top