I'm trying to simulate my project using MPLAB SIM but I get the following message:

ADC-W0008: No stimulus file attached to ADRESL for A/D.

How do I create an ADC Stimulus file?

Info that might be useful:

  • PIC18F4520
  • PicKit2 programmer.

Simulating input in MPLAB is way more complicated than it should be. Making a A/D stimulus file is easy. Just put the sequential numbers you want the A/D to read on sequential lines of a text file. The tricky part is getting MPLAB to understand to use that to take simulated A/D readings from. In the DEBUG menu (I think), there should be a entry called STIMULUS, or something like that. That opens up a little window with a bunch of tabs accross the top.

If I remember right, what you want is on demand register injection into ADRES, but I may not remember right. I usually have to read the help each time I use this, as the procedure is rather arcane. You have to stand on one foot while bowing twice in the direction of Chandler AZ, or something like that. It is in the docs though. That's how I figure it out each time.

| improve this answer | |
  • \$\begingroup\$ Problem is that I am reading from 2 ADC channel and I need to simulate both. So, injecting to ADRES, how will I link it to a specific ADC channel? \$\endgroup\$ – Buhake Sindi May 20 '12 at 21:16
  • \$\begingroup\$ @TheElite: If you are reading the channels alternately, then every other line in your file is for one signal. If the order of reading the channels is unpredictable, then you can't do it directly with stimulus. I and others have asked that we can define each analog input over time in a file, then have the stimuls engine interpolate the value for that time for that channel to simulate a A/D reading, but so far Microchip has not implemented that. \$\endgroup\$ – Olin Lathrop May 20 '12 at 21:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.