Still HSEROUT woes


Closed Thread
Results 1 to 35 of 35

Hybrid View

  1. #1
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    Steve, you are absolutely correct. One of my edits went awry.

    Unfortunately, when I put the INT_CODE line in the correct place,
    nothing changes. Still no joy.


    And mister_e,

    The lines are part of my "standard" header file. I can't tell you why they
    are there. Probably some legacy issue. Anyway. I took them out.
    No change in behavior.
    Charles Linquist

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


    Did you find this post helpful? Yes | No

    Default

    O.k then i'll try again

    Beeing said i already heard of some care about the Tim's routine.. i just don't remind where but.. humm.

    Now i'm very bad and slow in assembler debugging so, apologies..
    Steve

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

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


    Did you find this post helpful? Yes | No

    Default

    just an idea... how about replacing the Hserout by a TXREG=Char loop. Just by seeing the output of it, it seems the routine just redo the Hserout line without keeping track of what have been already sent...

    OR it have to exist a character pointer variable in the HSEROUT macro somewhere... if so, you probably didn't save it in the INT Handler... mmm interesting....
    Steve

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

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


    Did you find this post helpful? Yes | No

    Default

    pfff... maybe
    Code:
        IF TimerFlag = 1 THEN
           SecondsCounter = SecondsCounter + 1
           INTCON = 0
           HSEROUT ["Seconds = ",#SecondsCounter,13,10]
           INTCON = %11100000 
           TimerFlag = 0
           Timer = 0
           ENDIF
    
        IF KeyHitFlag = 1 THEN
           INTCON = 0
           HSERIN [Y]
           HSEROUT[Y]
           INTCON = %11100000 
           KeyHitFlag = 0
           ENDIF
    Steve

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

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


    Did you find this post helpful? Yes | No

    Default

    ah come on brain cell (no s)... wake up...
    Code:
    IF INTCON.2 = 1 THEN
    TMR0H = $EC ; Reload TMR0 to 65535 - 5000
    TMR0L = $77
    Timer = Timer + 1
    IF Timer >= 1000 THEN
    TimerFlag = 1
    ENDIF
    
    ENDIF
    
    IF PIR1.5 = 1 THEN
    KeyHitFlag = 1
    ENDIF
    INTCON.2 = 0 ; Clear the timer flag
    where the PIR1.5 is cleared?
    Last edited by mister_e; - 9th July 2006 at 20:53.
    Steve

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

  6. #6
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    In the PBP program. HSERIN clears the flag.
    Charles Linquist

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


    Did you find this post helpful? Yes | No

    Default

    yeah right but how about if you move the main HSERIN to the interrupt routine?
    Steve

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

  8. #8
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    mister_e,

    You insight is very helpful! Interrupts were, indeed killing the HSEROUT routine. Setting INTCON to "0" just before the HSEROUT allows the characters to be output properly.

    Grabbing the character with HSERIN inside the ISR works as well!

    This helps a lot, but I don't believe that I can disable ints during serial transmission. MAYBE I can work around this.

    It would be nice to know if I have a bug in my ISR, or if PBP itself has a bug that prevents HSEROUT from being an interruptable routine.

    By the way. Everyone else seems to have found a nice way to include formatted code without putting it "in line". Could you please tell me how to do that?
    Charles Linquist

Similar Threads

  1. I2C Slave with a PIC
    By ralfmayr in forum mel PIC BASIC Pro
    Replies: 129
    Last Post: - 21st August 2016, 17:44
  2. hserin and sms controller
    By xxxxxx in forum mel PIC BASIC Pro
    Replies: 25
    Last Post: - 10th February 2010, 15:49
  3. HSEROUT and Commas, What? Help Me Understand
    By altech6983 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 20th July 2009, 19:12
  4. Is HSEROUT corrupting bit 7 ?????
    By Robert Wells in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 23rd October 2008, 16:26
  5. Controlling an 240x128 LCD Touchpanel Display
    By Vincent in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 7th June 2006, 23:36

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