Urahara
Member
Hi All
I have a C18 interrupt routine that I wish to convert to assembly codes in an attempt to reduce latency in some high frequency counting situation (Variable gl_pulse_cnt seems to reach its limit at about 30,000 counts with the C18 codes). Here's snippets of the codes :
What is the assembly code equivalent of the 2-liner C18 codes within the "isr_low" routine? Would also like to insert this assembly code directly into the "low_vector" routine, within the _asm and _endasm block to reduce latency due to function calling. Is this workable?
Thanks!
I have a C18 interrupt routine that I wish to convert to assembly codes in an attempt to reduce latency in some high frequency counting situation (Variable gl_pulse_cnt seems to reach its limit at about 30,000 counts with the C18 codes). Here's snippets of the codes :
Code:
unsigned long int gl_pulse_cnt=0;
#pragma code low_vector=0x18
void low_vector (void)
{
_asm GOTO isr_low _endasm
}
#pragma interruptlow isr_low
void isr_low(void)
{
gl_pulse_cnt++;
PIR1bits.CCP1IF=0; //clear interrupt flag
}
What is the assembly code equivalent of the 2-liner C18 codes within the "isr_low" routine? Would also like to insert this assembly code directly into the "low_vector" routine, within the _asm and _endasm block to reduce latency due to function calling. Is this workable?
Thanks!