Proteus + ADC simulation


Closed Thread
Results 1 to 10 of 10
  1. #1
    Join Date
    Nov 2009
    Location
    London
    Posts
    251

    Default Proteus + ADC simulation

    Hi, it is the first time I am trying to run a simulation of my ADC code in proteus, but I am facing a problem - I cannot even blink an LED currently. Following is my code to blink an led:

    Code:
    Include "modedefs.bas"
    DEFINE OSC 4       ' OSCCON defaults to 4MHz on reset
    DEFINE OSCCAL_1K 1
    
    @ __Config _INTRC_OSC_NOCLKOUT & _WDT_ON & _PWRTE_ON & _MCLRE_OFF & _BODEN & _CP & _CPD
    
    pause 50
    VALUE VAR WORD
    PORTA=0
    PORTC=0
    TRISA = %001000
    TRISC = %001000
    CMCON = 7
    ANSEL=%10000000
    ADCON0=%1011100
    ADCON1=%01010000
    ANSEL = 0
    OPTION_REG = %10001111
    
    SWITCH_ON VAR ADCON0.0
    START VAR ADCON0.1
    CHECK VAR PIR1.6
    
    START1:
    
    WHILE 1
    TOGGLE PORTC.5
    PAUSE 100
    WEND
    GOTO START1
    I have also attached a screenshot of my proteus connections. Once I get this corrected, I will run a simulation of battery monitor using ADC. Thanks
    Attached Images Attached Images  

  2. #2
    Join Date
    Nov 2009
    Location
    London
    Posts
    251


    Did you find this post helpful? Yes | No

    Default

    Another screenshot at the time of simulation. Can someone please tell me what are these blue and red dots appearing in when I simutlate? Thanks
    Attached Images Attached Images  

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Try connecting pin 4 (MCLR) of the pic to the regulator output V+.
    Last edited by mark_s; - 15th October 2010 at 23:14.

  4. #4
    Join Date
    Nov 2009
    Location
    London
    Posts
    251


    Did you find this post helpful? Yes | No

    Default

    Hi Mark, I have tried connecting MCLR to power via 10K. Problem is still there. But I think MCLR should not affect the operation as it is Off.

  5. #5
    Join Date
    Jan 2009
    Posts
    78


    Did you find this post helpful? Yes | No

    Default dsn file

    please provide the schematic design file

  6. #6
    Join Date
    Nov 2009
    Location
    London
    Posts
    251


    Did you find this post helpful? Yes | No

    Default

    Hi, here is the DSN file. I had to make it a zip file as otherwise it does not appear in the 'select attachment' window.
    Attached Files Attached Files

  7. #7
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default It blinks fine here.

    <object id='stUkhdQ01IR1FYQltaWl9aVVBR' width='425' height='344' type='application/x-shockwave-flash' data='http://www.screentoaster.com/swf/STPlayer.swf' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0'><param name='movie' value='http://www.screentoaster.com/swf/STPlayer.swf'/><param name='allowFullScreen' value='true'/><param name='allowScriptAccess' value='always'/><param name='flashvars' value='video=stUkhdQ01IR1FYQltaWl9aVVBR'/></object>
    DT

  8. #8
    Join Date
    Nov 2009
    Location
    London
    Posts
    251


    Did you find this post helpful? Yes | No

    Default

    Hi Darrel, it is really interesting that the code is running on your system.

    Could it be that I have loaded the hex file or some other setting wrongly? I have attached the screenshot of the EDIT COMPONENT. I even tried it with the config word to be '0x3E4C' but no luck.
    Attached Images Attached Images  

  9. #9
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    The only difference was that I put the code in the same folder as the .dsn file.
    But that shouldn't matter.

    Are you running the latest version of proteus?
    I zipped the folder and attached it. Give it a try.
    Attached Files Attached Files
    DT

  10. #10
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Question

    Hi

    Runs fine on v 7.6 SP 4 Pro here ...

    no special trick to use.

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts