A discussion group for the PICMicro microcontroller. Also called the Microchip PIC, this list is dedicated to the use and abuse of this fine, simple, microcontroller. Close to topic posts are welcome, ie. general electronics.
|
hello sir, i modified it further by including bsf status,rp0... i am just not understanding the problem...i have been trying to simulate by using "goto $-1 " as somebody suggested but we didn't get any values for adresh n adresl....if any of u have got it..please tell me where i have gone wrong. i had sent a pwm pgm for the same pic earlier pls check that pgm also... but unless adc is complete i cannot proceed to pwm since i am feeding values to pwm from adc. further i have a doubt that an i/p analog value should be fed to pgm to get o/p values on adresh n adresl...i don't know how to feed the i/p values...in mplab....is it something to do with pin stimulus.... thank you for suggestions and help. regards, vaishnavi |
|
|
|
In MPLAB, as far as I know, you must set the values in ADRESH and ADRESL for testing. If you check the datasheet, you will see different registers are in different banks. The bank select bit is RP0 in the STATUS register. To access a register that exists only in bank 1, RP0 must be set. To access a register in bank 0, RP0 must be cleared. If your program never exits the AtoD status checking loop, then you are probably not starting the AtoD. Chad --- vaishnavi236 <> wrote: > hello sir, > i modified it further by including bsf status,rp0... > i am just not understanding the problem...i have been trying to > simulate by using "goto $-1 " as somebody suggested but we didn't get > > any values for adresh n adresl....if any of u have got it..please > tell me where i have gone wrong. i had sent a pwm pgm for the same > pic earlier pls check that pgm also... > but unless adc is complete i cannot proceed to pwm since i am feeding > > values to pwm from adc. > further i have a doubt that an i/p analog value should be fed to pgm > to get o/p values on adresh n adresl...i don't know how to feed the > i/p values...in mplab....is it something to do with pin stimulus.... > thank you for suggestions and help. > > regards, > vaishnavi ===== My software has no bugs. Only undocumented features. __________________________________ |
|
Using the Register Stimulus function under the Debug/Stimulator Stimulus tab you can enter values into one sfr. You must create a file which contains the values you want. See Help/MPLAB IDE Help/Debugging and MPLAB SIM/Simulator Stimulus/Register Stimulus Files for how and what to put into the file. Also browse to ../Simulator Device Specific Issues/14 bit core device simulator issues/Peripherals/A/D Converter(Limited) for additional info. Then use Debug/Simulator Stimulus/Register Stimulus/Enable. Browse for the file you created, enter the memory address you want the values to be inserted at (look for this in the Program Memory Window) and the register you want the value stored in (ADRESH). Then as you step through the program one of the values you entered will be loaded with each pass at the memory address you specified to the sfr you entered. You will see this value appear in the approproate location in the File Register Window. You can only set one register at a time but that should be enough to test your code. pr --- In , "vaishnavi236" <vaishnavi236@y...> wrote: > hello sir, > i modified it further by including bsf status,rp0... > i am just not understanding the problem...i have been trying to > simulate by using "goto $-1 " as somebody suggested but we didn't get > any values for adresh n adresl....if any of u have got it..please > tell me where i have gone wrong. i had sent a pwm pgm for the same > pic earlier pls check that pgm also... > but unless adc is complete i cannot proceed to pwm since i am feeding > values to pwm from adc. > further i have a doubt that an i/p analog value should be fed to pgm > to get o/p values on adresh n adresl...i don't know how to feed the > i/p values...in mplab....is it something to do with pin stimulus.... > thank you for suggestions and help. > > regards, > vaishnavi |