Hi Vasile,
Thank you for the quick reply.
Is have that feeling about something not right at some point of the code.
In fact tried to exchange some "if/end if" for "case of" but no luck.
Problem persists, but it seems only related to "if/end if" usage..
My code reads the ADC (PIC18F2550), for 100 times
in a "for/end loop".
Then find the median of values read and send that median value to RS232.
Also has a button to do some extra actions.
All this code worked great even in a smaller PIC (16F18313).
Now have changed PIC for the 18F2550 and wanted to add some extra code to manage PWM and ADC reading times to find the median value.
Also added an oled display to show locally that value and the PWM/ ADC nr. of readings parameters. That's when this issue raised up.
Simptoms are the code running sluggish, not hangging...
Any ideas?
Thank you very much.
Cheers,
Filipe Santos