How to simulate analog signal in MPLAB SIM?

Status
Not open for further replies.

jumpjack

New Member
I'd like to simulate an analog sinusoidal input on a pin; can it be done with MPLAB Simulator, or anyother FREE simulator?

It's a 440Hz sinusoid.
 
I'd like to simulate an analog sinusoidal input on a pin; can it be done with MPLAB Simulator, or anyother FREE simulator?

It's a 440Hz sinusoid.

hi,
Extract from MPLAB Help:

Because simulation is to the register level, and not the pin level, bit/pin names will be read as `0', as required for analog, although injected stimulus may have actually changed the value to `1'.
 
I read the help for hours, it's really complex!!!!
I was not able to figure out how to define the signal I need.... Any tip?
I need to put pin high, then low after 26 ms, then high after 26.... Should I add one line per each level change? at 26, 52, 78 ms..... 440 times?!? There is a REPEAT function, but I can't understand how it must be set: repeat every... what? Repeat which rows?!?
 
Is this what you are trying to do? Note it's 2.6mS (will give 192Hz). For 440Hz it should be 2.2mS overall - 1.1mS each half cycle.

Mike.
 

Attachments

  • 44Hz.png
    22.1 KB · Views: 1,481
Is this what you are trying to do? Note it's 2.6mS (will give 192Hz). For 440Hz it should be 2.2mS overall - 1.1mS each half cycle.

Mike.

almost. I have to act on the comparator, not on the AD converter.
So the number after the "after:" has the same unit of "time units" on the left... What a hugly GUI....

Anyway you're right, I have 2.27 ms, not 26!

But the help says that timings in first columns are absolute, not relative, they all start counting from 0; so I guess I should use 2600 and 5200. And I can't understand what to put in "restart at:" field...
 
Last edited:
Yes, my mistake, they are absolute. In that case I would put in 1300,3900 and restart at 5200.

Mike.
 
Sorry, mixed my boxes up. It should be repeat after 5200 and restart at zero. Does that make more sense?

Mike.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…