Reading smart motor data with db9 through max232
mechqueen
Posts: 3
Hello,
I am not doing so well with this yet. I have a PTP
http://www.rayslogic.com/propeller/Products/PTP/PTP_Schematics.htm
And all I want to do is read velocity from a smart motor rs232 output.
The smart motor db9 is connected into a max32.
I have the gnd and 5v of out of the max232 coming into the board with the Q44 Propeller Parallax chip on it
going to V5 and Gnd. I also have the TX going to P4 and Rx Going to P5 on this board because my usb from my computer
is inserted into the board, so that takes care of my onboard tx rx going directly to the Q44 chip.
I have tried different UART commands. And this is my code for now which all it does is display the velocity text but I want to
know what is coming out of the tx of my db9, and read it back to the display for velocity.
Here is the code so far. Maybe over kill but a co-worker gave me quite a bit of code to start with which included
Xbee functions and numchuck info which I took out. I only want to read the velocity value coming out of of the db9 Tx port.
I just do not know what to do next. Any help steering me in the right direction would be helpful.
Thank you
I am not doing so well with this yet. I have a PTP
http://www.rayslogic.com/propeller/Products/PTP/PTP_Schematics.htm
And all I want to do is read velocity from a smart motor rs232 output.
The smart motor db9 is connected into a max32.
I have the gnd and 5v of out of the max232 coming into the board with the Q44 Propeller Parallax chip on it
going to V5 and Gnd. I also have the TX going to P4 and Rx Going to P5 on this board because my usb from my computer
is inserted into the board, so that takes care of my onboard tx rx going directly to the Q44 chip.
I have tried different UART commands. And this is my code for now which all it does is display the velocity text but I want to
know what is coming out of the tx of my db9, and read it back to the display for velocity.
Here is the code so far. Maybe over kill but a co-worker gave me quite a bit of code to start with which included
Xbee functions and numchuck info which I took out. I only want to read the velocity value coming out of of the db9 Tx port.
I just do not know what to do next. Any help steering me in the right direction would be helpful.
Thank you
Comments
I haven't looked at the code yet but I wanted to warn you about using 5V logic signals with the Propeller. You need at least a 3.3K resistor in series on the rx line from the MAX232 chip.
I'll take a look at the code a bit later if no one else beats me to it.
I still haven't tested the code but this version has a better chance of working.
I do hope you are using 3V3 on the propeller chip???
I see the schematic shows all 4 sets of power and ground are connected and with bypass capacitors. I presume you have a propplug to program your propeller (It appeared to be a separate connector on the schematic. If you build your own propplug you will need the transistor reset circuit. I like a 10K pullup on the prop RST pin as it helps to prevent noise causing an unwanted reset.
Is there any difference between using a modern MAX232 variants vs the older ones. The new ones all point to a datasheet that is over 20 years old! see attached PDF file. I'm guessing it's just to conform to RoHS.
You probably should use a max3232, which is made for 3.3v instead of 5v.