Hi, I am having trouble with the serial interface, using commands SERRXD and SERTXD through the PICAXE cable from a host pc. I am using the PICAXE 20M2, I have also tried the 20X2.
I am working on a prject to probe a pin to check the state. The host computer sends a command to the picaxe and and the picaxe sends back the relevent information. I have written the code and all works fine throught the serial terminal from the picaxe editor. When I try to send commands to the serial from a python script the picaxe or pc seems to drop a number from the command being sent to the picaxe.
so I wrote a small script to recieve a command through the serial in, as a number i.e 99, then send the recieved command back to the host pc. As i said beofore the serial terminal from the picaxe editor works perfectly, but as soon as i send the command from a python script it seems to drop the a number from the command and recieves 9 not 99 intermitantly (sometimes I get 99 and others I get 9)
One of the things that really confuses me is that sometimes the picaxe will recieve the correct command and act accordingly but most of the time it will drop a digit from the command. It really seems random weather it recieves the command or drops a digit.
I have added the python results as well as the picaxe editor serial terminal results. Through the editor I always get the correct responce but from python its random
I have a PICAXE 18M2 that i have tried the same code with and the command seems to work with no problem from python (i still need to test again but seems fine). Does anyone know why there is a difference between the PICAXE 20 chips and the 18 chips serial in? Also i would rather not redesign my circuit for the 18M2 and would like to get the 20M2 working if possible. If anyone can help i would appriciate it greatly.
Thanks in advance.
I am working on a prject to probe a pin to check the state. The host computer sends a command to the picaxe and and the picaxe sends back the relevent information. I have written the code and all works fine throught the serial terminal from the picaxe editor. When I try to send commands to the serial from a python script the picaxe or pc seems to drop a number from the command being sent to the picaxe.
so I wrote a small script to recieve a command through the serial in, as a number i.e 99, then send the recieved command back to the host pc. As i said beofore the serial terminal from the picaxe editor works perfectly, but as soon as i send the command from a python script it seems to drop the a number from the command and recieves 9 not 99 intermitantly (sometimes I get 99 and others I get 9)
Code:
pause 3000
disconnect
symbol CMD = w11
main:
serrxd[2000, main], #CMD
sertxd("Recieved: ",#CMD,cr,lf)
goto main
I have added the python results as well as the picaxe editor serial terminal results. Through the editor I always get the correct responce but from python its random
I have a PICAXE 18M2 that i have tried the same code with and the command seems to work with no problem from python (i still need to test again but seems fine). Does anyone know why there is a difference between the PICAXE 20 chips and the 18 chips serial in? Also i would rather not redesign my circuit for the 18M2 and would like to get the 20M2 working if possible. If anyone can help i would appriciate it greatly.
Thanks in advance.