HSERIN and XOUT command


Closed Thread
Results 1 to 21 of 21

Hybrid View

  1. #1
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    yes I do (and so Darrel @ post #8). Anyway, if you jump to that ISR... your buffer already hold something.. so there's no real advantage to the Timeout, then no advantage to whatch PIR1 either. You get the character, you get out of there as fast as possible, if there's a second character, you'll be redirected over there shortly.

    That Is easy to do that in asm. So it will be faster again, and give you less latency in XOUT... so probably solve most part of the problem.

    You could still get rid of HSERIN and read RCREG directly.
    Last edited by mister_e; - 11th May 2009 at 20:07.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  2. #2
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    You get the character, you get out of there as fast as possible, if there's a second character, you'll be redirected over there shortly.
    Steve, in this case I must change sligthly the Tx string, adding a terminator character.

    The code as it is, using "Hserin 100,ErrorFlag,[str Rdata\9]" works perfectly and Xout do the job.
    I have got away from the trouble when I did remove the "XIN" command.

    I am sure that XIN and Hserin/Hserout are not compatible for unknown (so far) reasons.

    Since I need also the XIN, I am putting togheter a second prototype with two pics on board, so I will separate XIN/SEROUT2 commands, from Hserin/XOUT (Hardware solution to the problem)

    Al.
    All progress began with an idea

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Maybe not
    Code:
    YourArray[YourCounter] = RCREG
    If YourCounter !=9 then 
            YourCounter=YourCounter+1
            ELSE
            NewDataIsReady = 1 
            ENDIF
    a bit of work around the above could work. IF so, then yes maybe there's a conflict between XIN and HSERIN... I don't see where, appart if a Timeout is used on both... or some Systems vars are shared... and if so, they're saved/restore by DT INTS... maybe there's one missing in DT list... but I have some reasonable doubt about it.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  4. #4
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    Steve, this code doesn't work

    Code:
    Getbytes:
    Rdata[A0] = RCREG
    If A0 !=8 then 
    A0=A0+1
    ELSE
    DTReady = 1 
    ENDIF
    @ INT_RETURN
    This one works. But cannot appreciate any difference in speed, perhaps what is gained here is lost in the two variables check:
    "IF Rdata[0] = 36 and DTReady = 1 then"

    Code:
    Getbytes:
    Hserin [Rdata[A0]] 
    If A0 !=8 then 
    A0=A0+1
    ELSE
    DTReady = 1 
    ENDIF
    @ INT_RETURN
    Al.
    All progress began with an idea

  5. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    If you don't have any HSERIN/HSEROUT in your code, you must write to the register RCSTA/TXSTA/SPBRG instead of using DEFINEs, probably this why It doesn't work.

    Not sure of the overhead though... Would be great to have some X-10 device here... never messed with that before. Sure enough, I can't afford to buy any for now
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

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