I would like to know how to set up an input in mplab sim to trigger an a/d pin an0 to trigger my program. I get this but I don't know what to do with it.
Stimulus: Synchronous stimulus applied successfully.
ADC-W0008: No stimulus file attached to ADRESL for A/D.
I've tried to set up the input, but I really have no idea what I need to do to modify if to get it to work. If you could give me a description or a sample input that I could use to base mine off of that would help alot. Thanks!
It's always nice when someone asks a question, figures it out, and never says how they did it. Then later on, when someone searches to try and find the answer to the same question, they find that thread and are disappointed to find no answer. It becomes yet another useless thread that just clutters up search results, and discourages people from searching for existing answers instead of asking the same old questions over and over.
Anyway, just in case the original poster doesn't come back and do it themselves, the answer (to the question as I understood it) pretty much lies in the warning message about "no stimulus file attached"... the ADC module picks values from a stimulus file during simulation - it's something you can make easily in a text editor, and there is enough information in the MPLAB help files to get you going.
Sorry, no fix yet, just some head scratchin'. Still haven't figured out how to put the right value to my input. once the a/d conversion is finished it just reads like there was nothing 0 on the input.
Stimulus Dialog
Use the Stimulus dialog to create synchronous or asynchronous stimuli. The Stimulus dialog allows you to enter stimulus information which is saved in a file called a workbook. To open a new workbook, select Debugger>Stimulus>New Workbook. To open an existing workbook for editing, select Debugger>Stimulus>Open Workbook.
I've tried to set up the input, but I really have no idea what I need to do to modify if to get it to work. If you could give me a description or a sample input that I could use to base mine off of that would help alot.
I've got stimulus on an0, ra0, adresh, adresl, but I must not be doing something right, its still not working. I've been reading the help and it helps a little but I'm still fuzzy on my particular problem. I'll try changing the values some more and see if that helps tonight, even though I'm not getting any results any way. I may take a sixxer to fix it.
just setting up stimulus in the "pin/register actions" section, or are you doing an actual stimulus file via "register injection"?
since you mention ADRESH and ADRESL separately I'm guessing you're using regular stimulus rather than register injection.
In the register injection method, you feed in 12-bit values (as 16-bit hex numbers) from a stimulus file, to the ADRESL register. It's smart enough to break the value in two and put it in both ADRESH and ADRESL appropriately.
A picture is worth a thousand words, so one is attached. This is from MPLAB 7.50, things may be different in old versions as I remember they changed the stimulus stuff quite a bit a few releases ago.
The contents of 'adcstimulus.txt' is just hex values, one per line:
0x0101
0x0123
0x0321
(etc...)
Every time the program performs a read on the ADC, it will just grab the next value from this file.
Sweet, man! Thanks for the screenshot it was just what I needed! I built a text file with all the analog values and slid it into the "data filename" slot and it worked great! I've had this project on the shelf for a while, but this is just what I needed to get it going again! Many thanks!
ADC-W0010: A Minimum of 2 TADs are required before another conversion should be started.
MAXIMUM number of warnings/errors exceeded 200, program execution halted.
Can anyone please sort me out whats the problem in this program
MOVLW 0X00
BSF STATUS,RP0
MOVWF ADCON1 ; left justified
MOVLW 0XFF
MOVWF TRISA ;port a i/p
MOVWF TRISE ; port e i/p
MOVLW 0X00
MOVWF TRISC ;port c and port d o/p
MOVWF TRISD
Sorry but I am new to using PIC. I have tried to program this onto my pic microcontroller so that i can display stuff on the LCD of my PIC millenium board. But for some reason I cant program it. Is it because I need to include a driver for LCD? The port used should be D. Can somebody sort this problem out. Thanks