Controlling an 240x128 LCD Touchpanel Display


Closed Thread
Results 1 to 13 of 13

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    i saw 2 things
    1. You can't use Gosub in a interrupt handler
    2. I don't see that you re-enable the interrupts

    And it should be only a part of your program 'cause i don't see any ON Interrupt goto statement.
    Steve

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

  2. #2
    Vincent's Avatar
    Vincent Guest


    Did you find this post helpful? Yes | No

    Smile One of Two

    Thanks mister_e!

    I will try to reprogram the interrupthandler without using GOSUB.

    The on interrupt goto statement is written in a GOSUB init: funktion which is called befor the main: loop
    '--------------------------------------------------------------------------
    inter_default:
    on interrupt goto inter
    return
    '--------------------------------------------------------------------------

    The reenabeling of interrupt is done in this two funktions:
    '--------------------------------------------------------------------------
    int_ende: 'Interrupt Ende

    z1_tmp=10
    z2_tmp=10
    z3_tmp=10
    z4_tmp=10

    resume main_ende
    enable

    '--------------------------------------------------------------------------
    main_ende:
    pause 10
    goto main

  3. #3
    Vincent's Avatar
    Vincent Guest


    Did you find this post helpful? Yes | No

    Unhappy reprograming done

    No my interrupthandler is working without any GOSUB routine.
    But the problem with having a variable counted up via a timer1 interrupt is still there.
    ???

    by NVM

  4. #4
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    > You can't use Gosub in a interrupt handler

    Not true.

    You just got to watch how many Interrupts & Gosubs you've got pushed on the stack and not exceed the maximum allowed. The sum total in most cases must not exceed FOUR.

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


    Did you find this post helpful? Yes | No

    Smile

    mmm interesting... it's different from what i already heard somewhere. I should test it one day.

    Usually my interrupt handler are just short and mostely set Flag and variable wich are tested in the main program, then it react depending of them.
    Steve

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

  6. #6
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Try the TIMER (Buttons.bas) example I just posted under the SINGLE BUTTON FUNCTION thread or OLYMPIC TIMER, both contain a GOSUB within an ISR.

    You have to treat an ISR as if it was a SUBROUTINE except you exit with a RESUME rather than a RETURN.

    The only thing you have to remember is the TOTAL number of pushes made on the stack do not exceed the maximum allowed for your PIC.

  7. #7
    Vincent's Avatar
    Vincent Guest


    Did you find this post helpful? Yes | No

    Default This answer migth solve both of my problems!

    Hello Melanie ,mister_e

    Yes its possible to use GOSUB in the interrupt handler.

    But i do not really understand the thing with "TOTAL number of pushes made on the stack" What exactly are pushes and how do they get stored on the controller?
    I posted another thread because the controller is reseting every 20 to 30 interrupst i guess it could stick on overflowing stack?

    by NVM

Similar Threads

  1. LCD Display
    By lambert in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 16th January 2010, 23:18
  2. LCD display not working properly
    By dilpkan in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 2nd February 2008, 08:43
  3. Replies: 14
    Last Post: - 26th September 2007, 06:41
  4. LCD Display not working - PIC heating...
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 32
    Last Post: - 24th September 2006, 08:35
  5. A/D display result on LCD
    By winsthon in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 10th January 2004, 11:09

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