CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Rising Edge Interrupt On PIC24FJ64GA004 [Solved]

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
demedeiros



Joined: 27 Dec 2013
Posts: 71

View user's profile Send private message

Rising Edge Interrupt On PIC24FJ64GA004 [Solved]
PostPosted: Tue Dec 06, 2022 9:38 am     Reply with quote

Hi All,

Trying to setup a rising edge interrupt on a PIC24FJ64GA004. I have the signal connected to B12 (Or B13 if needed...).

Looking at the datasheet (PDF page 5), it looks like pins B12 and B13 are listed as Interrupt-on-Change inputs, so I am assuming I have an issue with my code. Any thoughts?



Code:
#include <main.h>
#include "flex_lcd.c"

#int_EXT1
void EXT1_isr(void)
{
   if(input(ENC_B))
   {
      encoderCount += 1;
   }else
   {
      encoderCount -= 1;
   }

}


void main()
{
   ext_int_edge(14,L_TO_H);   //I assumed the source input was the CN#, but I think I am wrong?
   enable_interrupts(INT_EXT1);
   enable_interrupts(GLOBAL);
   lcd_init();
   // Clear the LCD.
   printf(lcd_putc, "\f");
   delay_ms(500);
   output_high(BACKLIGHT);

   while(TRUE)
   {

      printf(lcd_putc, "\fEnc: %lu", encoderCount);

      delay_ms(250);
   }

}
demedeiros



Joined: 27 Dec 2013
Posts: 71

View user's profile Send private message

PostPosted: Tue Dec 06, 2022 9:48 am     Reply with quote

Doh! Nevermind, I didnt realize that CN was for the change notification interrupt!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group