Shop OBEX P1 Docs P2 Docs Learn Events
We could really use some RS-232 DCE help — Parallax Forums

We could really use some RS-232 DCE help

anitabillanitabill Posts: 6
edited 2008-09-19 04:31 in General Discussion
Me and my friend are working on a project that will look at cells in excel and display the values on a LCD it also lights LED’s based on one cell value. We have the PDB a BS2px and PLX-DAQ and we have everything working perfectly. We are planning on making several, so we decided to use a SX chip. Wow it is a lot harder then we imagined.
·
We started with a basic LED program to make sure the chip worked and it did. But for some strange reason I can not get the chip to talk to the PLX-DAQ correctly. I’m not sure if I’m doing something wrong in my program or if I have the wires wrong on the PDB. On my board I have two Leeds connected to the RS-232 DCE one leads from RA.0 to TX and one form RA.1 to RX. There are two other connection on the X13 RTS and CTS. Do those need to be connected to anything?
·
I’m attaching the BS2px code that is working and the SX code that is not. If anyone can help us with this it would be greatly appreciated.

Comments

  • JonnyMacJonnyMac Posts: 9,214
    edited 2008-09-18 15:03
    You're attempting to use SERIN syntax that is not supported by SX/B. SX/B's SERIN works with just one character at a time and you'll have to create a custom function for receiving a decimal value as a string.
  • ladianladian Posts: 3
    edited 2008-09-18 15:18
    thank you for the quick reply.

    Can you please explain how we can do this ?

    as anitabill explained, we are both new to the SX world.......

    besides serin. what would be a better way to go ?
  • JonnyMacJonnyMac Posts: 9,214
    edited 2008-09-18 18:31
    These forums are filled with examples, by myself and others, demonstrating hwo to use SX/Bs SERIN and SEROUT functions to duplicate BASIC Stamp type functions. Being new doesn't mean you can't spend a little time reading....
  • anitabillanitabill Posts: 6
    edited 2008-09-18 19:01
    Thanks JohnnyMac
    ·
    You are correct about the forum there are a ton of helpful people and a lot of good info. I did spend hours on the forum looking for the answer, but I guess the problem was I’m such a newbie I didn’t know what I was searching for. Thanks a ton for pointing us in the right direction. I’m almost afraid to ask but do you think my wiring is correct for the RS-232 DCE? I did do a search and looked at the specs.
    ·
    Again my apologies if it appeared as if I was taking the lazy why out.
  • JonnyMacJonnyMac Posts: 9,214
    edited 2008-09-18 19:47
    Consider yourself spoon-fed -- burp yourself. tongue.gif The last part of that little joke means that since I've taken the time to write you a demo, you owe it to me and yourself to spend the time studying it so that I don't have to explain it to you line-by-line (I won't). The demo has subroutines and functions that work (as is, don't "fix" them), as well as demonstrations in the Main loop of each one of them. After you've run this code to see that it works, study it, them move the routines you need into your own programs.

    Post Edited (JonnyMac) : 9/18/2008 10:43:25 PM GMT
  • anitabillanitabill Posts: 6
    edited 2008-09-18 20:11
    Thanks again Johnny.

    I will give it a whirl and I really do appreciate you taking the time to share your knowledge and code. I absolutely was not looking to be spoon fed, but the minute I get home I will put on my bib and look at the code smilewinkgrin.gif.

    Bill
  • JonnyMacJonnyMac Posts: 9,214
    edited 2008-09-18 22:42
    You're welcome, and have fun with it. I try to write code that is fairly obvious and easy to move from one app to another. BTW, I found that I neglected to implement a feature in RX_DEC (limiting the input to five digits). I've replace the file (above) with the corrected listing.
  • ladianladian Posts: 3
    edited 2008-09-19 03:37
    Thank you JonnyMac.

    It doesn't seem to be working for me. I've studied the code, RA.0=RX, and RA.1=TX.· then launced the PLX-DAQ sheet. I didn't noticed anything. added a few cell data, and nothing. Looks like the baud is set to 56k, so i set it to that in PLX-DAQ as well, and nothing.

    any ideas ?



    little side note.
    I'm anitabills partner in crime, we are working together on this.
    when i first started going through your program, i was like huh ?!?!
    all we needed was a program to turn a led on or off depending of the value of·one cell.
    then I think I started to get your message.
    While he may be spoon feeding,·he still want us to figure out on our own what we need to do with some editing.
    Which in the long run will help us out.
    As Anitabill said, we are new, but·we should be able to figure out most of what you wrote.
    And i think from searching the forum, we found a program which lead us down the wrong path.

    thanks.
  • JonnyMacJonnyMac Posts: 9,214
    edited 2008-09-19 04:31
    I don't know or use PLX-DAQ so my program is not -- as I thought I had stated -- an SX/B rewrite of yours. My program demonstrates how to send and receive DEC formatted values in SX/B using custom subroutines and functions.

    As it turns out, I just found SX/B demos for PLX-DAQ on the Parallax site. You should start with them.
Sign In or Register to comment.