LCD freezing problem with interrupts


Closed Thread
Results 1 to 10 of 10

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default Re: LCD freezing problem with interrupts

    EDIT

    Corrected program part:

    Code:
    ' Menu limits
    IF mpos<1 THEN mpos=1
    IF mpos>5 THEN mpos=5
    Still doesn't works.

  2. #2


    Did you find this post helpful? Yes | No

    Exclamation Re: LCD freezing problem with interrupts

    Nothing? I've also tried to remove serial commands and CGRAM custom-made characters, same problem.

  3. #3
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    967


    Did you find this post helpful? Yes | No

    Default Re: LCD freezing problem with interrupts

    But sometimes when I navigate into this menu (when the AC motor is either on or off), and very randomly, the LCD is "freezing" and after 2 seconds the display is reseted. The 3-phase PWM outputs are not affected at all.

    Now, if I remove only the interrupts (TMR1_INT, INT0, INT2) of my program, this problem doesn't occur.
    Do you get the fault indication? I suspect, you are getting into the FltSub when you say the LCD is frozen.

    You can possibly disable the ocint and the stopint for checking this possibility. Does the LCD still freeze?

  4. #4
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default Re: LCD freezing problem with interrupts

    OSC is defined as 40Mhz, where is the config settings?
    which pic is this?
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  5. #5
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default Re: LCD freezing problem with interrupts

    Completely unrelated to your problem, or perhaps not but anyway.....
    Does these constructs really work? Do they even compile:
    Code:
    ' FWD/RWD button
    IF PORTC.1=%1 THEN
       IF rot=%0 AND run=%0 AND flag4=%0 THEN rot=%1:flag2=%0:flag4=%1
       IF rot=%1 AND run=%0 AND flag4=%0 THEN rot=%0:flag2=%0:flag4=%1
    ENDIF

    I think you need an ENDIF for each of those IF statements.

  6. #6


    Did you find this post helpful? Yes | No

    Default Re: LCD freezing problem with interrupts

    Quote Originally Posted by HenrikOlsson View Post
    Completely unrelated to your problem, or perhaps not but anyway.....
    Does these constructs really work? Do they even compile:
    Code:
    ' FWD/RWD button
    IF PORTC.1=%1 THEN
       IF rot=%0 AND run=%0 AND flag4=%0 THEN rot=%1:flag2=%0:flag4=%1
       IF rot=%1 AND run=%0 AND flag4=%0 THEN rot=%0:flag2=%0:flag4=%1
    ENDIF

    I think you need an ENDIF for each of those IF statements.
    I've no problems with that (but I've modified this part to something like that):

    if rot=%0 then
    if run=%0 then
    if flag4=%0 then
    rot=%1
    flag2=%0
    flag4=%1
    endif
    endif
    endif

    Yeah, not very readable but take less program space than AND operator. And it works good.

  7. #7


    Did you find this post helpful? Yes | No

    Default Re: LCD freezing problem with interrupts

    Quote Originally Posted by sayzer View Post
    OSC is defined as 40Mhz, where is the config settings?
    which pic is this?
    A special PIC for motor control, it's the PIC18F4431, 10MHz quartz with PLL enabled (so 4*10=40MHz).

  8. #8
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default Re: LCD freezing problem with interrupts

    So, while LCDOUT command is being executed, an interrupt is occuring.

    To "test" this, you can disable all interrupts before lcdout command and enable them right after.
    This is just to see.
    But this will definitely effect your motor. It can give you a point anyway.
    Last edited by sayzer; - 6th December 2011 at 22:37.
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  9. #9


    Did you find this post helpful? Yes | No

    Default Re: LCD freezing problem with interrupts

    Quote Originally Posted by Jerson View Post
    Do you get the fault indication? I suspect, you are getting into the FltSub when you say the LCD is frozen.

    You can possibly disable the ocint and the stopint for checking this possibility. Does the LCD still freeze?
    Actually I'm not at home so I will try to remove ocint and stopint next friday.

    And no, I'm not getting into Fltsub when my LCD is frozen: in reality, the menu is reseted to the very first position (1: ISENS).

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