Shop OBEX P1 Docs P2 Docs Learn Events
Control of Compass — Parallax Forums

Control of Compass

BladesBlades Posts: 3
edited 2007-07-06 18:22 in BASIC Stamp
I just recently bought a compass from www.ocean-server.com·and i am unable to communicate to the Basic Stamp 2 P40. The compass is the 3500

Comments

  • pwillardpwillard Posts: 321
    edited 2007-07-03 17:31
    I am assuming that you want the Compass to speak RS232 to the STAMP,since that is an option with the 3x00··,and have the appropriate RS232 Cable interfaced with the Stamp from the Compass.

    Since it will be communicating in standard NMEA type sentences in RS232, wouldn't the code used to intrerface with the Parallax GPS unit be a good starting place?· (Actually, I have to admit here that I don't know anything about the Parallax unit... yet.)· The GPS·speaks serial NMEA, right?

    http://www.parallax.com/dl/docs/article/GPSReadings.pdf

    You might want to pick some PINS to assign to RS232 communication and use a MAX232 (or similar) level converter for TX and RX.
  • BladesBlades Posts: 3
    edited 2007-07-03 18:07
    We have considered using the RS232 to comunicate to with the compass but wouldn't we have to have the RS232 commuicating with the computer in order to ensure that it is working? What we have been trying to do is plug it directly into the board, however we can't get the board to recieve data from the compass.

    Is it possible to connect the wires from the compass used to assemble a serial plug to the board?

    If it is unable to be connected directly to the board do you belive that if we were to aquire a serial that splits would programing the basic stamp foul up the compass?

    The compass is going to be used inside of a submarine for a competition. So we were hopeing to be able to have the serial port connected to the outside of the hull for quick modification of the program.

    One possable solution thought of was the I^2C IN command.

    We haven't don't have a large ammount of experiance programming.
  • pwillardpwillard Posts: 321
    edited 2007-07-03 20:04
    My intent was to say that the Compass would be talking to the Stamp using SerialIn SerialOut commands. You don't HAVE to use a MAX232 and true RS232 levels, I just assumed that they would not be right next to each other. You centainly could directly connect the TTL levels, as the manual states. You would need to make sure that you set the serial pins to use Inverted logic. As a rule, I personally try to avoid using the programming pins for anything other than programming.

    The PDF I attached in my post above showed how to deal with NMEA sentences on the Stamp. Since the Compass natively supports Serial Communications and the Stamp can talk Serial In/Out on any pins, this does seem to be the best approach to me.

    You should be able to use pins 5 (XMT),6 (GND),7(RCV) on the 3x00 10 pin connector and use say pins P14 & P15 on the Stamp for Serial in and Serial out but like I said... pay attention to the need to invert the signal if you don't use a level converter and that you need to cross-over the signals (XMT --> RCV, etc).
  • BladesBlades Posts: 3
    edited 2007-07-06 18:22
    Thank you for the help. there a couple last questions that we have.

    First, how would we invert the signal or what would be a good level converter to use? Which method would be easier and quicker to apply?

    Second, we have seen the term cross-over used in different situations all meaning a different thing each time, just wondering exactly what you mean.

    Finally, if you are using wires 5,6, and 7; are wires 2,3, and 4 are left out the the system?
Sign In or Register to comment.