Hi all again. I want to use an interrupt on change on pin rc2 on my current long running project using pic16f18877.
Couple of questions really
Q1: can i put an interrupt anywhere in my code eg in a loop or must it be near the start i.e in an initialisation macro?
Q2; Im using a piece of c code to do a software reset and having dug though a lot of forum messages, I'm trying to use the xc8 function reset() and it doesnt seem to work, but it may be because of q1 above or i'm just a noob
ioc
-
- Matrix Staff
- Posts: 1913
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 619 times
- Been thanked: 644 times
Re: ioc
Hi.
1. You need to place the IOC (or any other interrupt) before the main loop, so it's only called once.
2. Within a C Code block use
It must be all upper case & end with a semicolon.
Otherwise, if it does not, you will get an error.
1. You need to place the IOC (or any other interrupt) before the main loop, so it's only called once.
2. Within a C Code block use
Code: Select all
RESET();
Otherwise, if it does not, you will get an error.
Martin