I have made a rover robot and it worked ok on a 40x. Converting to 40X2 I have run into timing problems with servo and ultrasonic. I think the 40X was a little less perdantic
It seems that my SRF05 is having trouble running at 8 mhz
40X code runs OK
main:
for counter = 1 to 20
low 6 ' Set output pin low
pulsout 6,1 ' Send a pulse to start the ranging
pulsin 0,1,w1 ' Recieve timed pulse from SRF05/04
w3=w1*10 ' Calculate distance
w3=w3/58
'debug w3
pause 10
next counter ' Wait before next pulse
return
Now the code will run on a 40X2 will run OK if I use the "setfreq m4" however the X2 conversion looks like this and I do not see a W1 or W3 values in debug.
main:
for counter = 1 to 20
low 6 ' Set output pin low
pulsout B.6,2 ' Send a pulse to start the ranging
pulsin D.0,2,w1 ' Recieve timed pulse from SRF05/04
w3=w1*10 ' Calculate distance
w3=w3/58
debug w3
pause 10
next counter ' Wait before next pulse
return
ANy assistance appreciated.
rob
It seems that my SRF05 is having trouble running at 8 mhz
40X code runs OK
main:
for counter = 1 to 20
low 6 ' Set output pin low
pulsout 6,1 ' Send a pulse to start the ranging
pulsin 0,1,w1 ' Recieve timed pulse from SRF05/04
w3=w1*10 ' Calculate distance
w3=w3/58
'debug w3
pause 10
next counter ' Wait before next pulse
return
Now the code will run on a 40X2 will run OK if I use the "setfreq m4" however the X2 conversion looks like this and I do not see a W1 or W3 values in debug.
main:
for counter = 1 to 20
low 6 ' Set output pin low
pulsout B.6,2 ' Send a pulse to start the ranging
pulsin D.0,2,w1 ' Recieve timed pulse from SRF05/04
w3=w1*10 ' Calculate distance
w3=w3/58
debug w3
pause 10
next counter ' Wait before next pulse
return
ANy assistance appreciated.
rob