Shop OBEX P1 Docs P2 Docs Learn Events
RS232 output from SX-48; Step-by-step? — Parallax Forums

RS232 output from SX-48; Step-by-step?

Joshua SiegelJoshua Siegel Posts: 51
edited 2006-10-11 20:08 in General Discussion
Hi everybody,

I'm just starting to get involved in a robotics project I've been planning for awhile, and came up with a little roadmap of how to get to where I need to be.

The first step is serial communications, from the SX to the computer. I will be using the SX48 as a data relaying device, but would like to start by sending integer values, characters, or similar (ideally, a string like 050A999B000C, etc., to convey a sensor name and it's value).

I've tried Jon William's sample code, and the code of other's on this board, to no avail. The two issues I figured it might be were the internal resonator, but I've been using an external 4mhz, and the line level. To resolve this, I got an Acroname Brainstem, which in theory does TTL to RS232 and vise versa. Simply wiring in the output from the board to the RX of the Brainstem, I got a bunch of garbage (in multiple different terminal programs).
I've also tried wiring straight out of the board, with pin 5 to ground, pins 1, 4, and 6 linked, and pin 2 out from the board with no luck (I believe I found this schematic on here, somewhere in one of Jon's threads).
That didn't work, either.

So what do I do? Would anyone be able to do a reasonable step-by-step, with sample code and a schematic, verbal or drawn?
Thanks!
Josh

P.S., has anyone tried something like 7d) on this FAQ: http://www.maxbotix.com/MaxSonar-EZ1__FAQ.php ? I know I talked to pjv about this awhile back, but this seems a bit different, given that it's only a single IO for every sonar. This is what I'd like to output to the computer, eventually.

Comments

  • BeanBean Posts: 8,129
    edited 2006-10-05 22:32
    Joshua,
    What are your DEVICE settings in your program ? If you have OSC4MHZ the sx will use the internal osc not matter what to connect to the OSC pins.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com

    Don't mistake experience for intelligence. And vis-vera.
    ·
  • Joshua SiegelJoshua Siegel Posts: 51
    edited 2006-10-05 22:44
    I don't have the code in front of me and must admit to being new to the SX platform, but it was copied directly from Jon's sample code with string output. I'd assume that it is correct, but can't be 100% sure. I will look to see what I have later tonight.
  • Joshua SiegelJoshua Siegel Posts: 51
    edited 2006-10-07 00:09
    Well, the code I had was for the SX28, and used the external oscillator. I didn't try the serial communications on that again yet, instead, I wanted to start with my SX48 (since I will be using the 48 anyway). I changed the device parameter, and it wont program - when I verify, it fails at checking the Flash. This board has never been programmed, as far as I know. Any thoughts?
  • Mike CookMike Cook Posts: 829
    edited 2006-10-07 00:31

    Try the attached program, it works on the SX52 Proto Board (discontinued, Parallax or one of their distributors my still have some) or the SX48 Proto Board.

    You will need to do the following:

    1. Install a 20MHz resonator in socket X2

    2. Make up a DB9 connector with PIN 2 (RS-232) to RA.0, (RS-232 PIN 5) to VSS on the Proto Board

    3. Would be a good idea to add a 1M resistor across the resonator. Easily done by taking a 1/4 watt 1M resistor, trim the leads to .25" and insert into X1, this is optional.

    4. Open the program and change:

    DEVICE SX52, OSCXT2, BOR42

    to

    DEVICE SX48, OSCXT2, BOR42

    I use this 'template' as a starting point for most of my projects and I know it works.

    Hope this helps,

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike
  • Joshua SiegelJoshua Siegel Posts: 51
    edited 2006-10-07 02:51
    Thanks Mike, that looks like just what I want. My problem now, I guess, is getting this board to program!
    I have no resonator in it, I've set MCLR to Vdd, and I've tried programming it on two different computers. It's never been coded before; does anyone have a suggestion on how to get the code to download? Verify fails at flash (either E2 or E3, depending on switch position).
  • Mike CookMike Cook Posts: 829
    edited 2006-10-07 03:06

    Joshua,

    If your using a SX48 Proto Board MCLR is already pulled up to VDD, so I would delete that connection.

    As for programming it without a resonator, it should program. I just tried with my·Blitz and SXKey and had no problems, however it would not output any RS-232 (as expected).

    Do you have any 3 pin resonators (4, 20, 50 MHz)?


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike
  • Joshua SiegelJoshua Siegel Posts: 51
    edited 2006-10-07 03:23
    I have a 20mhz 3-pin resonator, but the issue is programming with it in/out versus running with it in/out. In any case, I think my board may have an issue? Your code compiles fine, so that's a non-issue.
  • Mike CookMike Cook Posts: 829
    edited 2006-10-07 03:56
    What are you powering the SX48 Proto Board with?

    Have you soldered anything to the board or is it 'new out of the bag'?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike
  • Joshua SiegelJoshua Siegel Posts: 51
    edited 2006-10-07 13:01
    I'm using the parallax provided wall wart. I've read about putting a capacitor between Vss and Vdd, but didnt have any 22uF's laying around to try. I have soldered two connectors, one to RA.0 and one to Vss. My DB9 connector is "jumped" (according to the diagram I mentioned earlier - 1, 4, and 6 tied, and 7 and 8 tied), so could that be doing it? I don't see how, since none of those pins connect on the SX side of things.
  • Joshua SiegelJoshua Siegel Posts: 51
    edited 2006-10-09 00:57
    I've updated my SXB on this computer and my laptop, and neither work. I've tried with SK-Key 3.2 and 3.0. Any other suggestions? I'd love to get this working ASAP, so I can (hopefully) have some sensory data being fed into the PC by next weekend.
  • Joshua SiegelJoshua Siegel Posts: 51
    edited 2006-10-10 20:23
    I've desoldered the RS232 connector, and tried 3.0, 3.2, and 3.2.3 on two computers. Nothing works - is my board borked?
  • Sparks-R-FunSparks-R-Fun Posts: 388
    edited 2006-10-10 20:48
    Joshua,

    I am a bit confused as to whether you are having a serial port problem or a program transfer problem. Are you able to download a program to the SX successfully?

    - Sparks
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-10-10 20:55
    Joshua,
    ·
    ·· When asked which power supply you answered, “One from Parallax”, however it is important to know that you have the recommended power supply, which is 7.5V @ 1A.· Also, is anything connected to any pins or the power bus during your attempts to program.· At one point you said you tied MCLR to Vdd, which would definitely be a problem.· Have you tried removing your resonator during programming?· What happens if you now try to program an SX28 with the same Key/Blitz?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • Joshua SiegelJoshua Siegel Posts: 51
    edited 2006-10-10 20:55
    I can download to my SX28 tech board, but not to the sx48. The serial ports on both computers are fine, so the issue lies in either my particular SX48 or a conflict between my systems and all sx48's.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-10-11 00:29
    The problem may very well be with your SX48 Proto Board, but do you have the recommended power supply?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • Joshua SiegelJoshua Siegel Posts: 51
    edited 2006-10-11 00:50
    The supply is a Sceptre PS-6016AW PL05
    Output is 6V @ 1.6A max. I bought this from the link on the SX48 page, so I assumed it was correct. Will this work? I was under the impression a stable supply over 5V would be sufficent.
    The Mclr to Vdd was just as a quick reset, I did not try to code with it in this mode. I have tried with and without the resonators installed.

    edit: I looked at my invoice again, and I ordered the 7.5V supply, but this is what was in my box. Either the wrong one was shipped somehow, or I misplaced the original supply (though I've opened the box once since I got it). I'm off to look now.

    edit 2: Still haven't found the parallax supply - what does it say on the label? In any case, I tried a 9V, positive center, 2A supply and it still wouldn't take code.

    Post Edited (Joshua Siegel) : 10/11/2006 1:11:06 AM GMT
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-10-11 20:08
    Joshua,
    ·
    ·· The Sceptre 6V Power Supply you received is the correct one.· It’s actually a better supply.· It would seem like your SX48 is quite possible damaged.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
Sign In or Register to comment.