Help Required re Ports

John Todd

On Sept. 11th I posted for -Software to read CMPS14 Compass Data for
which I am very grateful?
I have been back in hospital and have just now returned to this project.
with short term memory loss?
The code I was given at the time has me a little confused
I am using 08M2
and the software given at the time, on lines 13 &14 your code given to me
has the option ?? to pick the port for Symbol TX-Pin
?? to pick the port for Symbol RX-Pin
Could you please give me some guidance :-
I am unsure as to which ports I should use ??
I have the AXE 027 cable plugged into Port C.5 Serial In and Port C.0 Serial Out functioning OK
Could I prevail upon you to Suggest which Ports I should use for the line 13 and 14 Code
Thanks for any Help, much appreciated


Senior Member
Hi John, Because your query relates directly to your earlier thread, it would have been better to add this query to that thread. No matter, I have referenced the thread here.

You will see that the symbols (partly) defined in lines 13 and 14 as TX-Pin and RX-Pin are referenced in the SerOut and SerIn commands, later in the code. So the syntax is described in the command manuals for SerOut and SerIn. You will need to select which pins you want to connect the outbound and inbound serial data streams to on your 08M2. On the 08M2 there are a couple of constraints for the selections on which pins to use, since pin C.3 is input-only and C.0 is output-only.

Which pins should you select? This will depend on whether there are other I/O requirements for your project but I try to choose pins that make the wiring as simple or direct as possible.

Finally, you will see that hippy has included #Terminal and SerTxd directives/commands in his example code, which allows the direction data to be logged to the Programming Editor's terminal window. SerTxd is dedicated to the return leg of the programming cable, when connected (Pin C.0), which means that you need to use a different pin for SerOut.


Technical Support
Staff member
I am unsure as to which ports I should use ??
The pins to use would be whichever you have connected your CMPS14 to.

If you haven't wired the CMPS14 to your 08M2 yet, we would suggest -

CMPS14 SDA/TX to PICAXE-08M2 leg 5, C.2
CMPS14 SCL/RX to PICAXE-08M2 leg 6, C.1

Then setting -

Symbol TX_PIN = C.2
Symbol RX_PIN = C.1

This will allow the CMPS14 module to be used serially as proposed, but will also allow it to be used via I2C if that proves to be a better way of interfacing.