Shop OBEX P1 Docs P2 Docs Learn Events
Getting Serial output from MOBO 2PE — Parallax Forums

Getting Serial output from MOBO 2PE

edited 2012-06-28 07:04 in BASIC Stamp
Question, I am trying to pull RGB values from a Taos color sensor connected to a MOBO 2PE via serial 232. I see that the prototyping board is probably the best route short of sticking wires into the daughterboard sockets. Are the SCL and SDA ports the serail command ports or am I missing something? Also, I have searched the manuals high and low and I do not see any where that it explains such a command to send the data. Any help would be appreciated.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2012-06-27 07:48
    Serial I/O is done with the SEROUT and SERIN statements. These can use any I/O pins not used for something else. By specifying pin #16, you can also use the USB programming port (also used for DEBUG and DEBUGIN). There are special I/O statements in PBasic for managing I2C devices and these work with I/O pins 0/1 and 8/9, so the I/O pins are labelled for this use. If you're not using these statements, the I/O pins are available for other uses. There are pullup resistors on these pins because of the I2C use.
  • edited 2012-06-27 10:24
    Thanks Mike,
    I tried to find a example of someone using the serin/out codes, is there a link to any sample projects that actually works? every time I click on the sample projects link it takes me to a lost screen. I would really benefit from a working example.
  • Mike GreenMike Green Posts: 23,101
    edited 2012-06-27 11:14
    The Taos sensor is not a serial device. How do you have it connected to your MOBO2pe?
  • edited 2012-06-27 14:24
    Mike, I have made some good progress, I am able to communicate everything perfectly via the USB cable to the terminal window. now I would like to send those same commands through a true serial 232 cable db9. The Taos is in slot A of the Mobo. Is it as simple as connecting 2 wires to 2 pins on socket b and assigning them as serial?
  • Mike GreenMike Green Posts: 23,101
    edited 2012-06-27 16:57
    The software side is as simple as using the SEROUT and SERIN statements with the pin numbers you want. You will need some kind of voltage translation though. If you want RS232 voltage levels, you'll need to use something like a MAX232 or equivalent chip. Do keep in mind that the Stamp cannot receive and send at the same time. If it's sending or doing some other operation (like handling the Taos sensor), it will ignore anything sent to the Stamp at the same time.
  • edited 2012-06-28 03:35
    Ok, I am following so far. I did some research on the max232. It looks like I would need three 1uf capacitors as well. I am suppose it would be easiest to install these four parts to the prototyping board ? As a separate thought....I was wondering if it was possible to convert the usb cable back to a standard db9? the plug now on the mobo is usb, in actuality though we are sending the data via a usb to com port. Is there a way to just convert the cable right there back to a db9 and skip the max232?
  • Mike GreenMike Green Posts: 23,101
    edited 2012-06-28 07:04
    As I mentioned in post #2, you can either use the DEBUG and DEBUGIN statements or you can use use SEROUT and SERIN with I/O pin #16 to send data to a PC via the USB programming port. If you still want to use RS232 using regular I/O pins, there are other devices similar to the MAX232 that do not need the 1uF capacitors. The MAX233A is one example of this.
Sign In or Register to comment.