Shop OBEX P1 Docs P2 Docs Learn Events
RS232 With MAX232 Circuit? — Parallax Forums

RS232 With MAX232 Circuit?

soshimososhimo Posts: 215
edited 2008-12-22 02:49 in Propeller 1
I'm currently trying to get the FullDuplexSerial object to work on pins other than 30 and 31 which I have connected to the prop plug. What I need is the ability to read from one com port and write out the other - a data logger. I can read and write fine out COM3, which is connected to the usb cable connected to my prop plug. When I attempt to hook up an rs232 breakout board I have that works with other devices (PIC, Arduino, etc) I get nada. I don't have an oscope right now (it's busted and I'm to cheap and/or lazy to get it fixed and can't afford a new one) so I can't see what signals are comming into the pins, but as I said, it should be a black box since it works fine for translating rs232 to ttl/cmos for other hardware (I did even tried reversing rx/tx - still nada). I'm trying to read/write p16 and p17. Here is my code:

CON
    _clkmode = xtal1 + pll16x                           
    _xinfreq = 5_000_000                                'Note Clock Speed for your setup!!

    COM1_RX = 16
    COM1_TX = 17

    COM3_RX = 31
    COM3_TX = 30

    BAUD_RATE = 19200
    
VAR
    
OBJ
  uart1     : "FullDuplexSerial"
  uart2     : "FullDuplexSerial"


PUB DMXLogger

    uart2.start(COM1_RX, COM1_TX, 0, BAUD_RATE)
    uart1.start(COM3_RX, COM3_TX, 0, BAUD_RATE)

    uart2.str(string("Data Logger v.1"))
    uart2.tx(10) ' cr/lf
    uart2.tx(13)

    ' echo everything out
    repeat
      uart2.tx( uart1.rx )





Thanks in advance!

Comments

  • kwinnkwinn Posts: 8,697
    edited 2008-12-22 01:27
    Have you tried connecting pins 16-30 and 17-31 to see if that works?
  • grasshoppergrasshopper Posts: 438
    edited 2008-12-22 01:33
    Have you tried different configurations ?

     uart2.start(COM1_RX, COM1_TX, 1, BAUD_RATE)
    
    


    or
     uart2.start(COM1_RX, COM1_TX, 2, BAUD_RATE)
    
    


    or
     uart2.start(COM1_RX, COM1_TX, 3, BAUD_RATE)
    
    
  • soshimososhimo Posts: 215
    edited 2008-12-22 01:33
    It seems as if pins 16 and 17 are special purpose, either that or I had my head up... well you know where. I switched to p15/p14 and problem went away. Thanks!
  • CannibalRoboticsCannibalRobotics Posts: 535
    edited 2008-12-22 01:40
    Have you tried testing both of the uart1 & uart2 signals on the known working serial port?
    Do you know for sure they are both working?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Signature space for rent, only $1.
    Send cash and signature to CannibalRobotics.
  • soshimososhimo Posts: 215
    edited 2008-12-22 02:49
    @canibal - I actually got it working on another set of pins. I did try on 30/31 but stupid me - DOH moment comming - used the "Find Hardware" function of the prop tools to test it. I'm using 2 wire rs232 (no hardware flow control) and the "Find Hardware" function requires a reset of the device off pin 4 I believe (not sure and too lazy to look it up). Without the reset the chip will never enter the boot sequence which talks to the spin tool software so I thought it wasn't working. Yeah, I'm stupid, but I was getting frustrated.

    My biggest concern was vcc for the max232 chip. I didn't want to mix logic with different vcc (IANAEE so I don't really know - maybe that's okay but it sounds prone to problems) so I powered the breakout board with 3.3vdc which is the logic supply for the chip. The datasheet says that the working voltage for vcc is -.3vdc to 6vdc so I figured I'd be fine - and the output levels on the ttl side are withing .5v of vcc which satisfies the logic levels for the chip (according to the data sheet). I found a chart at the bottom of the Propeller Protoboard Designs for the Beginner document that says p16 - p19 are used for video out on the protoboard. I'm not sure if that's because the DAC voltage divider circuit is there or if there is something specific about those pins. I guess I need to go back to the data sheet.
Sign In or Register to comment.