TMR2 not working..


Closed Thread
Results 1 to 18 of 18

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    What pins are the LCD hooked up to?

    Without the DEFINES, the LCD defaults to PORTA 0-3 for the data, but those pins are configured for analog.

    You had the same settings before and said it was working so I assumed there were defines that you didn't show. But now it looks like there aren't any.
    <br>
    DT

  2. #2
    Join Date
    Jan 2007
    Location
    Brazil
    Posts
    108


    Did you find this post helpful? Yes | No

    Default

    The lcd defines are the same. It's hooked up on PORTB. I did not change defines.
    I've added the two .bas instant interrupt files, added the asm code and changed all the interrupt statement to the instant interrupt. I have no ideia where the problem is located to.. i'm still trying to do so..

    I still have some doubts about instant interrupts and timer using, like reloading and also configuring Option_reg or intcon...

    did not you really read anything wrong in the code posted?

    Thanks for the attention Darrel.
    Sylvio,

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by sirvo View Post
    The lcd defines are the same. It's hooked up on PORTB. I did not change defines.
    That's the part I don't get. There are no DEFINEs for the LCD. So it won't work on PORTB. Unless you just didn't include them in the post.

    did not you really read anything wrong in the code posted?
    No I don't.
    I've run the program here, with a few changes. Using a 16F877.

    I did change the $A0 in the LCDOUT statement.
    Changed it to $80. All works fine.
    <br>
    DT

  4. #4
    Join Date
    Jan 2007
    Location
    Brazil
    Posts
    108


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    That's the part I don't get. There are no DEFINEs for the LCD. So it won't work on PORTB. Unless you just didn't include them in the post.
    I'm sorry. I did not post them here, but they are correct.
    I'll try again later...I'm sleepy now..

    Thank you very much..
    Sylvio,

  5. #5
    Join Date
    Jan 2007
    Location
    Brazil
    Posts
    108


    Did you find this post helpful? Yes | No

    Default

    As I have said, the LCD gets a cleared screen. IN order to test the ASM routine of instant interrupt, I have added 2 LCDOUT commands. The first before the ASM routine and the Second after the ASM ROUTINE.

    Code:
    ' LCD defines on portB
    ' All registers set
    ' just like the code posted before
    
    Pause 1000
    
    LCDOUT $FE, $80, "TEST 1"
    
    ASM
    ;T0IF = TMR0IF
    ;T0IE = TMR0IE
    INT_LIST  macro    ; IntSource,        Label,  Type, ResetFlag?
            INT_Handler   TMR2_INT,  _tick,   PBP,  yes
        endm
        INT_CREATE               ; Creates the interrupt processor
    ENDASM
    @    INT_ENABLE  TMR2_INT     ; Enable Timer 1 Interrupts 
    
    LCDOUT $FE, $80, "TEST 2"
    
    'and the rest of the code goes i here..
    Well.. Now the LCD displays only "TEST 1".. it seems that the pointer is stuck in the ASM lines... Anything to say?

    Thanks!
    Sylvio,

  6. #6
    Join Date
    Jan 2007
    Location
    Brazil
    Posts
    108


    Did you find this post helpful? Yes | No

    Default

    Darrel.... are you there?

    I 'discovered' that if I set PR2 to any number it DO NOT interrupt...
    If I let PR2 'unset' it interrupts normal...

    In this case I am going to use it in this way, letting TMR2 count until 0FFh. Anyway, do you know what is hapening?

    Thanks...
    Sylvio,

  7. #7
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Working on it.

    Building a 16F88 breadboard now. (Last couple hours)

    I'll get back to you.
    <br>
    DT

Similar Threads

  1. 2x16 lcd not working with pic16f72
    By vu2iia in forum Schematics
    Replies: 4
    Last Post: - 16th February 2011, 14:59
  2. Blink.Bas on 18f45k20 Newbie seeks working example.
    By DiscoEd in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 29th December 2009, 03:36
  3. Pic 16 F628A not working
    By turkuaz in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 17th March 2009, 12:26
  4. Troubled with Instant Ints and TMR2
    By Josuetas in forum mel PIC BASIC Pro
    Replies: 27
    Last Post: - 7th October 2007, 06:23
  5. Hserin not working...
    By robert0 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 22nd August 2005, 12:25

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