RS232 output from SX-48; Step-by-step?
Joshua Siegel
Posts: 51
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.
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
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.
·
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
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).
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
Have you soldered anything to the board or is it 'new out of the bag'?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Mike
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
·
·· 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
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
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
·
·· 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