Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

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
    graph.png
    57.7 KB · Views: 259
  • inj.png
    inj.png
    23 KB · Views: 258
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top