Still HSEROUT woes


Closed Thread
Results 1 to 35 of 35

Hybrid View

  1. #1
    Join Date
    May 2006
    Location
    Del Rio, TX, USA
    Posts
    343


    Did you find this post helpful? Yes | No

    Default

    Correction: The HSEROUT works as expected, the HSERIN does not. But I was really only looking at the interaction between interrupts and HSEROUT to begin with. I'll take a closer look at the HSERIN now.

    Steve
    Last edited by SteveB; - 10th July 2006 at 03:06.

  2. #2
    Join Date
    May 2006
    Location
    Del Rio, TX, USA
    Posts
    343


    Did you find this post helpful? Yes | No

    Default

    Well, Just moving
    HSERIN [Y]
    HSEROUT[Y]
    into the ISR solved the HSERIN as mentioned.

    Despite getting it working on my equipment, we still don't know why it isn't working for Charles. I'd like to know why the difference.

    Steve

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


    Did you find this post helpful? Yes | No

    Default

    well let's see it in the simplest way... an Interrupt flag have been set, it jump to the ISR but he's not clear before going out... what happen? it return back to the ISR as soon as possible.

    As it's just a single character.. HSERIN can be changed to
    Code:
    x=RCREG
    While RCREG : Discard=RCREG : Wend
    or few lines of assembler...

    OUF, at least i wasn't too far.. that's good for my own self esteem
    Last edited by mister_e; - 10th July 2006 at 03:20.
    Steve

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

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


    Did you find this post helpful? Yes | No

    Default

    I can deal with the requirement to read the RCREG from within the ISR, but having to shut off the interrupts while running HSEROUT is more problematic. I have to run full-duplex in my application. That is why I needed it interrupt-driven in the first place!
    Charles Linquist

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


    Did you find this post helpful? Yes | No

    Default

    SteveB:

    Confirming - I took your code and loaded it into my 8720. It works as expected, except that it doesn't handle USART interrupts (as you mentioned). I'm thinking that your routine works better because you saved/restored BSR, while I was was saving/restoring FSR0L and FSR0H.

    I have an email to MELABS. Maybe they can shed some light on this.

    When we are done, I think we will have a good framework for how to deal with interrupts in the 18F series!
    Charles Linquist

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


    Did you find this post helpful? Yes | No

    Default

    PROBLEM SOLVED!

    I have been conversing with Tim Box. Although he no longer writes in PBP, he had some great insights.

    I'll be able to write a short tutorial on using interrupts with 18F parts and PBP tonight.

    Many thanks to all who contributed!
    Charles Linquist

  7. #7
    Join Date
    Oct 2004
    Location
    Hangover, Germany
    Posts
    289


    Did you find this post helpful? Yes | No

    Default

    ...I'm using interrupts with the 18Fxxxx and...

    the WSAVE...etc-part in front of a interrupt-handler is ONLY neccessary for PICs with up to 2048 words ? (PIC16F872). Bigger PICs don't need the code in the beginning, it is placed by PBP. The restore-code before the retfie is only used for PICs <PIC18, because they know the "retfie 1"-solution to restore all this silly registers, saved by an interrupt... (PBP doesn't support high/low-priority-Ints, so no other interrupt is used!)

    But don't try to use PBP inside a interrupt-service-routine !
    PBP 2.50C, MCS+ 3.0.0.5, MPLAB 8, MPASM 5.14, ASIX Presto, PoScope, mE mikroBasic V7.2, PICKIT2

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