Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] ADC simulating time in MPSIM

Status
Not open for further replies.

p55xp

Member level 3
Joined
Feb 26, 2010
Messages
57
Helped
4
Reputation
8
Reaction score
4
Trophy points
1,288
Location
Calcutta, India
Activity points
1,705
I am using MPLAB IDE 8.92, while simulating ADC in the MPSIM, I found that it takes 46µS. I used RC oscillator as adc clock. The hex code thus generated works flawlessly in the hardware, but I don't know what time it takes in reality. According to datasheet it must take 2-6µS. The chip I am using is 16F676 with internal 4MHz oscillator. I do not use any stimulus file for A/D. Can any one tell me the cause please?:roll:
ADC.JPG
 

The simulator does not run in real time. Typically you tel the simulator the clock speed and it will then tell you the number of clock cycles or simulated time (for things such as the stopwatch).
Further, simulators have bugs: this is one of the reasons why real hardware will always win over simulators.
This is possibly exacerbated by MPLAB V8 is now really old. MPLABx V3.35 is the current version and the simulator i that could well have improvements and bug fixes that are relevant.
Susan
 

Thanks for your reply, Susan.
I also thought this may happen, but was not sure of it. I must check the code in MPLAB X.
p55xp.
 

I downloaded MPLABX-v3.35-windows-installer.exe two times but failed to set it up as it 'encountered a problem'. It's a big download. So I can't check my code in the newest IDE.
But it seems that simulation time taken by the MPLAB IDE 8.92 is OK. I am looking farther, I shall comment on this soon.
Thanks, p55xp.
mplabx_failed.JPG
 

The ADC simulation time in the MPSIM is correct.
The A/D conversion cycle requires 11 TAD. For correct conversion, the A/D conversion clock must be selected to ensure a minimum TAD of 1.6 µS. The A/D RC source has a typical TAD time of 4 µS for VDD > 3.0V. This time range is 2 - 6 µS.
When I selected A/D RC as conversion clock the MPSIM assumed TAD as 4 µS. Therefore 11 TAD equals 44 µS.
I also tested the simulation time selecting FOSC/2 as conversion clock. It takes 22 µS.
It is my misunderstanding, I misinterpreted 1 TAD as conversion time.
Thanks to all viewer for taking interest, thanks to Susan.
p55xp.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top