Program CMPS 14 per Hippy

John Todd

Member
;From PicAxe Forum viasHippy"
;Latest Iteration @ 19-11-019
#Picaxe 08M2
#Terminal 4800
#No_Data
Symbol TX_PIN = C.1
Symbol RX_PIN = C.2
Symbol direction = w1 ; b3:b2
Symbol dir.lsb = b2
Symbol dir.msb = b3
PowerOnReset:
Pause 2000
SerTxd( "Started", CR, LF )
MainLoop:
Do
High TX_PIN
SetFreq M32
Pause 100
SerOut TX_PIN, T9600_32, ( $13 ); Get Bearing CMPS Code 0x13
SerIn [16000,Timedout], RX_PIN, T9600_32, dir.msb, dir.lsb
SetFreq MDEFAULT
Pause 100
SerTxd( "Direction=", #direction, CR, LF )
Pause 1000
Loop
Timedout:
SetFreq MDEFAULT
Pause 100
SerTxd( "Timed out", CR, LF )
Goto MainLoop
;Hippy results of Test
;Terminal says Started and from there On says TimedOut
 

hippy

Technical Support
Staff member
;Hippy results of Test
;Terminal says Started and from there On says TimedOut
That indicates the SERIN command is not receiving anything so has timed out after a couple of seconds.

There three main possibilities for that are the CMPS14 isn't working, isn't wired correctly, possibly has its TX and RX reversed, my reading of the datasheet has been wrong.

Can you take a photograph of what you have and post that to the forum ? That will allow the wiring to be checked.

I'll have a read of the datasheet to see if there is anything useful which might help with diagnosing the problem.

Unfortunately neither me nor anyone else seems to have used a CMPS14 with a PICAXE so you are out front as a pioneer, which may mean getting things working is more difficult than usual.

Added : Just spotted your other posts, where it seems things are now working.
 
Top