Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PIC16F688 'Interrupt on change' vs 'external interrupt' (PORTA) reliability

Status
Not open for further replies.

Gordito

New Member
Hi, i've started programming pics and have a question about interrupts...

How reliable in practice are the external interrupt pin and the interrupt on change pins(PORTA)?
I have two inputs i am thinking of using for interrupts (24khz clock bursts while a 24hz 'enabled' signal is high). If i use them, they must be completely reliable (critical). I've found the following info in the F688 datasheet regarding PORTA interrupt on change (p112, 11.5.3):

If a change on the I/O pin should occur
when the read operation is being executed
(start of the Q2 cycle), then the RAIF
interrupt flag may not get set.

1) How much of a problem is this in reality?

2) Is the 'external interrupt' pin (RA2/INT) also affected by this (they are all on PORTA on my pic)? In case it is, this means that for best reliability i should just use polling?

3) If only interrupt on change is unreliable, i figure i need to use one signal on the external interrupt pin ( sensor 'enabled' line), and poll the sensor's clock line (about 166khz required because clock high is only 12us long). Seems ok to you guys or is my beginner's eyes missing something?


Thanks!

-=-=-
Basic info, this side of my app is for receiving data from a badly documented sensor's 3 outputs. Data (16 bits)comes from the sensor about 24 times a second. I then convert this into ASCII asynch serial rs-232 for output. I will use an internal clock (8mhz or 4 mhz).

1) enabled: 24hz signal (high for around 650us). Indicates data is arriving on signal line. I'd use this know a new data word is coming and prepare.

2) clock: 24khz clock bursts (while enabled = H) (12us HIGH, 41us period square wave). The falling edge of the clock seems to indicate a valid bit on the signal line, i'd use an interrupt for reading the bit.

3) signal: weird unnamed 16 bit data protocol i haven't yet identified (subject to a future thread...). I do know what are the data bits though.
 
Last edited:
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top