RS232 With MAX232 Circuit?
soshimo
Posts: 215
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:
Thanks in advance!
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
or
or
Do you know for sure they are both working?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Signature space for rent, only $1.
Send cash and signature to CannibalRobotics.
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.