UART vs software RS232


Closed Thread
Results 1 to 28 of 28

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default


    That is how you WAIT using SERIN
    From the manual:
    ‘ Wait until the character “A” is received
    serially on Pin1 and put next character into B0
    SERIN 1,N2400,[“A”],B0
    You are waiting on
    [QUAL1, QUAL2]

    Now to use a time out, again from the manual
    SERIN
    Pin,Mode,{Timeout,Label,}{[Qual...],}{Item...}
    See what we can do here
    Code:
    SERIN PORTA.4, T1200, [QUAL1, QUAL2], LOWER, HIGHER
    change to this to wait on two QUALs and if QUALs are not received in 100ms, then it jumps to "LABELofCHOICE"
    Code:
    SERIN PORTA.4, T1200,100,LABELofCHOICE, [QUAL1, QUAL2], LOWER, HIGHER
    Me thinks you are looking at this to hard, relax a bit .
    Dave
    Always wear safety glasses while programming.

  2. #2


    Did you find this post helpful? Yes | No

    Default

    You're right -- that's always the case.

    In fact, here is the conclusion.....

    I "thought" that I had my code at T1200 but it was at N1200.....BUT, I didn't really care anyway because it was my (mis) understanding that as long as BOTH pics were the same, that it didn't mean diddly squat.

    After all, it's just inversion isn't it?...and I was using CMOS inverters on my breadboard...so in my mind, I was trying it "both ways". ?

    So, anyway, I just changed both sides to T1200 (I know, that was suggested in the first place).....and all is fine.

    BUT what am I missing here?

    Like I say, when I set up my wired connection, it didn't matter if I used T1200 or N1200....as long as the were both the same.....it worked either way......so, what am I missing here?

    What a pisser.

    --Michael

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Also --

    Is there ANYTHING I can do other than changing the code to T1200?

    I have some units already out there using N1200 and was hoping to add wireless function to them.

    Again, I tried 4011's but no luck.

    When I say anything, I mean ANYTHING.

    Could I put another PIC in my wireless module and do something there?

  4. #4


    Did you find this post helpful? Yes | No

    Default

    I think also Brian may have hit on it but I still can't plant in my mind why N or T even matter.

    He commented that without a line driver use N....with, use true.

    I suppose there may be a driver on the module but I'm still totally in the dark why N and T even make a difference -- I mean data is data -- whether it's upside down or not?

  5. #5
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    With your wired connection you had full control over both modes so you could just program
    both PICs to send/receive in inverted or non-inverted modes.

    With the Maxstream units your only option is to program the sending/receiving PICs to use
    non-inverted modes - if connected directly to the Maxstream modules.

    If you prefer inverted mode, then a simple inverter on both ends should do the trick, but it
    has to be fast enough to handle whatever data rate you use without messing with timing.

    I would opt for a simple firmware change before adding new hardware though. Just my 2c.

    data is data
    Data is data, but inverted or non-inverted does matter. Think about about it like this -
    suppose you program a PIC to receive data in non-inverted mode. This PIC is the RF
    module. Now connect another PIC to it that you've programmed to send & receive in
    inverted mode. It doesn't work.

    If you reprogram the 1st one to use the same mode, it works. You have control over that.
    You don't with the Maxstream unit. So you program controllers on both ends to use the correct
    mode, or insert a data inverter.
    Last edited by Bruce; - 5th September 2008 at 14:35. Reason: Why
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  6. #6


    Did you find this post helpful? Yes | No

    Default

    Ok Bruce....thanks.

    It's working fine with a direct connection using T1200 on both.

    I HAVE to get this solved in hardware though because I have some product out there and the pics are N1200.

    Dagnabit...I tried a 4011, a 4093 and even a transistor and couldn't get it to work. I used pullups....tried it all.

    Certainly a 4011 can handle the 1200 baud? I'd appreciate any ideas but I must get this thing to work with some external hardware.

    I'm using a 4mhz osc but that's not an issue....I just need to pass the 1200 baud right?

    I'll always use non-inverted from now on!

  7. #7
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Maybe the 4011 is wired backwards for the direction you need to go? Never used one, just guessing.
    Dave
    Always wear safety glasses while programming.

  8. #8


    Did you find this post helpful? Yes | No

    Default

    Sorry to bore you guys with all of this but that's the wonderful thing about forums --
    MORAL support.

    I now have that eureka moment.

    As it turns out, my ultimate intention was to use an RS485 line driver with my wireless because that's the way my wired connection is set up.

    But all of my experiments were with the driver out and RS232...I figured I'd work my way up.

    Bottom line....

    If you want to use N1200 in your PICS, use an SN75176 and simply reverse A and B on the 485 side.

    Works great now.

    For the life of me though, I couldn't get the RS232 hardware inversion to work.

    HIP HIP FRIGGIN HOORAY.

Similar Threads

  1. PIC uart basics
    By Michael in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 27th September 2008, 19:11
  2. Software RS232 and wireless modules
    By Michael in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 17th August 2008, 05:27
  3. Software Stack
    By yasser hassani in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 18th December 2007, 10:04
  4. Replies: 3
    Last Post: - 26th November 2006, 21:47
  5. Infrared Communications over RS232 UART or with B0 interupt
    By modifyit in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 9th December 2005, 19:17

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts