PIC18F252 ADC Simulation and output

Status
Not open for further replies.

Bloodninja

New Member
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
 

Attachments

  • graph.png
    57.7 KB · Views: 262
  • inj.png
    23 KB · Views: 264
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…