---
+ Post New Thread
Results 1 to 7 of 7
  1. #1
    Junior Member level 3
    Points: 892, Level: 6

    Join Date
    Jan 2010
    Location
    TEHRAN
    Posts
    26
    Helped
    3 / 3
    Points
    892
    Level
    6

    Interrupt on change PORTB; RB4,RB5,RB6,RB7 using mikroC PRO

    Hi! everybody.I want to write a program with mikroC PRO V2.5 so that I can use
    the interrupt on change PORTB; RB4,RB5,RB6,RB7 features.I use 4 push buttons
    on pins; RB4(K4),RB5(K5),RB6(K6),RB7(K7) and 4 LEDs' on pins;(respectively) RC4(LED1),RC5(LED2),RC6(LED3),RC7(LED4);I want if each key pressed(K4 to k7)
    the corresponding pins(LED) on POTRC is ON.
    Everybody can write that program,please?

    Thanks,

    •   Alt28th May 2010, 14:34

      advertising

        
       

  2. #2
    Member level 5
    Points: 3,037, Level: 12
    microcon555's Avatar
    Join Date
    Feb 2009
    Posts
    88
    Helped
    9 / 9
    Points
    3,037
    Level
    12

    Interrupt on change PORTB; RB4,RB5,RB6,RB7 using mikroC PRO

    You forget to mention the micro you are using

    MicroCon



    •   Alt28th May 2010, 15:14

      advertising

        
       

  3. #3
    Junior Member level 3
    Points: 892, Level: 6

    Join Date
    Jan 2010
    Location
    TEHRAN
    Posts
    26
    Helped
    3 / 3
    Points
    892
    Level
    6

    Re: Interrupt on change PORTB; RB4,RB5,RB6,RB7 using mikroC

    Hi!I apologize.I use PIC18F452.

    Thanks,Bob



    •   Alt28th May 2010, 15:38

      advertising

        
       

  4. #4
    Full Member level 5
    Points: 5,121, Level: 16

    Join Date
    Mar 2006
    Posts
    309
    Helped
    43 / 43
    Points
    5,121
    Level
    16

    Re: Interrupt on change PORTB; RB4,RB5,RB6,RB7 using mikroC

    hi bob

    why don't you try to do that?
    if someone write the code, how u will learn?
    try it and come to us if there's any problem
    we are happy to help

    regards

    ml


    1 members found this post helpful.

  5. #5
    Junior Member level 3
    Points: 892, Level: 6

    Join Date
    Jan 2010
    Location
    TEHRAN
    Posts
    26
    Helped
    3 / 3
    Points
    892
    Level
    6

    Re: Interrupt on change PORTB; RB4,RB5,RB6,RB7 using mikroC

    Hello.Refering to my previous e-mail,finally I convert the assembly language example firmware,
    that is;(EXAMPLE 4/ page 4 of AN566 application note;[Using the PORTB Interrupt on Change as an External Interrupt] ) into C language and I attached it and AN566 pdf
    with this mail.But would you please anybody answer to the following questions my helping to correct
    program if required?

    1.To XOR the last portB value with the new portB value and detect mismatch and which pin
    caused interrupt ,I read the last portB value in the main ;before interrupt occurs,with this
    instruction;

    [ kpi=PORTB;//reading the initial or previous(old)state or value of PORTB.]

    and read the current portB value in the interrupt after it occurs as so;

    [ kpc=PORTB;//reading the current PORTB state or value]

    are above instructions are valid?

    2.At AN566 application note,says should force microcontroller to interrupt at rising edge,
    but I do not find a special register to set the PORTB INTERRUPT ON CHANGE[RB4,RB5,RB6,RB7] for rising edge.Would you please tell how I do that?



    3.I attached my short and simple program,would you please tell me if it is correct or not?
    (Iused mikroC PRO V2.50 COMPILER for PIC18F452 ).

    Thanks,


    2 members found this post helpful.

  6. #6
    Newbie level 1
    Points: 437, Level: 4

    Join Date
    Jun 2010
    Location
    Malaysia/United Arab Emirates
    Posts
    1
    Helped
    0 / 0
    Points
    437
    Level
    4

    Interrupt on change PORTB; RB4,RB5,RB6,RB7 using mikroC PRO

    Hi, i"m just wondering if you have already solved your problem or you are still wanting that?

    i could help, let me know :)



  7. #7
    Junior Member level 3
    Points: 892, Level: 6

    Join Date
    Jan 2010
    Location
    TEHRAN
    Posts
    26
    Helped
    3 / 3
    Points
    892
    Level
    6

    Re: Interrupt on change PORTB; RB4,RB5,RB6,RB7 using mikroC

    Hi,mustafas84.No I still have the problem.I would be thank if you solve it.


    1 members found this post helpful.

+ Post New Thread
Please login