Hello everyone,
I've been assigned to use the Timer 2 interrupt feature in PIC18F252 to sample an incoming signal using the ADC at regular intervals. I was given a test file that contains a series of numbers that represent a signal if you plot it in MATLAB and our aim is to use the Stimulus Register Injection feature to inject these data into the program and receive an output from the Stimulus Register Trace feature which represents the sampled signal.
I've written the code and simulated it and I got the output file. I wanted to make sure if the output is correct or not, because as far as I know is that the output is supposed to be similar to that of the input since its only a sampling process.
I attached the code, an image of the input signal and the output I got.
I actually have doubts on the usage of the Stimulus register injection feature, so I've also attached a screenshot of the settings.
Thank you in advance