We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello, I need to know the exact moment when an input is set. I'm using XC167CI and I have fast interrupts. This way is full, I mean I have used all fast interrupts. I don't know how I can know when an input por is set and reset. What can I do? I which file can I paste the code? Maybe in MAIN.C? Maybe in IO.C? Please, help me.
"How can I get this guide?" The uVision Getting Started Guide is available on the 'Books' tab in the uVision 'Project' Window; The 'Books' window is also available via the 'Help' menu; failing all that, search for GS*.PDF in your Keil folder) If you have the free CD, it has some introductory videos on it showing you the way around the tools: https://www.keil.com/demo/cdrom.asp "Can u say to me any website, please? I'm so lost." Please stop the "u" - if you can't be bothered to type "you", you'll find people can't be bothered to help. When I said, "this very website" I meant this website here - the one you are currently visiting. If you look at the top of the page, you will see a blue bar with words like 'Products' and 'Support'. Click on 'Support' and it will take you to the Support section of this website. Then look in the left-hand column for the links to Examples and Application Notes... The Infineon website is http://www.infineon.com/ You should also be able to find supporting materials there. http://www.keil.com/books/166books.asp
The XC167 has many interrupts that can come from port pins and you are not limited to the fast external interrupts. You could also use the CAPCOM's as interrupts. Please be aware that when you use a fast interrupt you give up the CAPCOM interrupt for the associated channel. Given that you have asked for an example of a fast interrupt on P3.0. So here it is… You will vector to fast external interrupt 1 (EX1IN) whenever there is a change on the P3.0 that for more than two CPU clocks. If you did not protect the registers then you can go ahead and modify the registers directly without the unlock sequence. This code snippet is only for reference as you need to decide on the exact configuration and interrupt level you want. You are free to decide what group and level for any interrupt but make sure you make sure that they are all unique. I won't go into local and global register banks or cached interrupts since they are advance concepts. So to the code…
#include <xc167.h> #include <intrins.h> void main(void) { EXISEL0 = 0x0020; /*input from alternate pin AltB*/ EXICON = 0x000C; /*trigger on either edge*/ /*note EX1IN uses the CC9 interrupt vector */ CC1_CC9IC = 0x0070; /*enable the ISR and choose a group and level */ PSW_IEN = 1; /*globally enable interrupts*/ for(;;) { _nop_(); /*loop forever*/ } } /*here is the interrupt entry*/ void Ex1in_ISR (void) interrupt 0x19 { /*place your ISR code in here */ }