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 support@ccsinfo.com

12F1822 INT on pin change ?

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



Joined: 24 May 2010
Posts: 4

View user's profile Send private message

12F1822 INT on pin change ?
PostPosted: Wed Nov 24, 2010 9:21 pm     Reply with quote

Hi all,

For now I had only 3 flowmeters (open collector output) wired to INTx on 18f2620.


Code:
#int_TIMER0
void  TIMER0_isr(void)
{
   clear_interrupt(int_TIMER0);
   set_timer0(0x0);
   int_over = 1;
   debit_i[0] = 0;
   debit_i[1] = 0;
   debit_i[2] = 0;
   debit[0] = 0;
   debit[1] = 0;
   debit[2] = 0;
}

#int_EXT
void  EXT_isr(void)
{
   clear_interrupt(INT_EXT);
   debit_temp = get_timer0();
   set_timer0(0x0);
   debit_i[1] += debit_temp;
   debit_i[2] += debit_temp;
   debit[0] = debit_i[0] + debit_temp;
   int_over = 1;
}

#int_EXT1
void  EXT1_isr(void)
{
   clear_interrupt(INT_EXT1);
   debit_temp = get_timer0();
   set_timer0(0x0);
   debit_i[0] += debit_temp;
   debit_i[2] += debit_temp;
   debit[1] = debit_i[1] + debit_temp;
   int_over = 2;
}

#int_EXT2
void  EXT2_isr(void)
{
   clear_interrupt(INT_EXT2);
   debit_temp = get_timer0();
   set_timer0(0x0);
   debit_i[0] += debit_temp;
   debit_i[1] += debit_temp;
   debit[2] = debit_i[2] + debit_temp;
   int_over = 3;
}


The flow in gal/min is computed later in the main.
This is the only way I saw to get those precious times.
If you got better, feel free to send ! Wink

My next trouble is that I'll have 8 flowmeters to monitor at the same time + 1 wire temp sensors.

I tried to shake my brain but I came with no idea on howto.
Got to tell, that I have a RS232, I2C for RTC, 1 wire bus and sd card hooked up the pic, 2 push buttons and 2 leds.
Not much left pins.

My idea was to use 12f1822's. One for each flow meter, put them on a i2c bus and let them read the flowmeters ticks and read them as necessary.

I have the v4.106 and there is the 12f1822.h.
If I use the i2c on this pic, I lose the INT pin.
Anyway there's an interrupt flag for each other pin, so this could be real good !
But, in the 12f1822.h I saw:
Code:
#define INT_RB                    0x31FF0B08

Dammit, there's no port B !
And more, there is no definition of IOCIE/IOCIF.

How would I detect a tick on any other pin apart from INT ?

If anyone got an idea, please throw it because I'm losing hairs !

Cheers.
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