evandude
New Member
Are interrupt flags updated even when GIE is cleared? IE- if I clear GIE for a short time while doing something in my program, and an interrupt event occurs during that time, when I set GIE again will the interrupt occur?
part of my program needs to constantly receive data packets from a PS/2 mouse, but it also needs to be outputting PWM on 4 separate channels at the same time. I have 4 values (0-12000) corresponding to 0-12mS, which are sorted into ascending order. I am using timer1 and the CCP module to generate an interrupt each time one of the 4 desired values is reached (then the next highest is loaded into it, the proper output is toggled, and it continues)
my problem is that there is no way that a PS/2 packet will be recieved properly if the PWM interrupt gets serviced during it. So I am hoping that I can clear GIE as soon as the PIC sees the start of a data packet, recieve the packet, and then set GIE as soon as that's done; granted, it will delay the PWM toggle, and so throw off the duty cycle somewhat
so my question, more specifically, is if there is supposed to be a level shift on one or more PWM outputs while the data packet is being received, once it is done and I set GIE again, will the CCP interrupt immediately occur?
(if you have any ideas for how to better handle the PWM generation, I'm interested in hearing that as well)
thanks in advance.
part of my program needs to constantly receive data packets from a PS/2 mouse, but it also needs to be outputting PWM on 4 separate channels at the same time. I have 4 values (0-12000) corresponding to 0-12mS, which are sorted into ascending order. I am using timer1 and the CCP module to generate an interrupt each time one of the 4 desired values is reached (then the next highest is loaded into it, the proper output is toggled, and it continues)
my problem is that there is no way that a PS/2 packet will be recieved properly if the PWM interrupt gets serviced during it. So I am hoping that I can clear GIE as soon as the PIC sees the start of a data packet, recieve the packet, and then set GIE as soon as that's done; granted, it will delay the PWM toggle, and so throw off the duty cycle somewhat
so my question, more specifically, is if there is supposed to be a level shift on one or more PWM outputs while the data packet is being received, once it is done and I set GIE again, will the CCP interrupt immediately occur?
(if you have any ideas for how to better handle the PWM generation, I'm interested in hearing that as well)
thanks in advance.