1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

yet another PIC12F683 ADC problem

Discussion in 'Microcontrollers' started by madderscience, Jan 10, 2008.

  1. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,185
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    ONLINE
    hi,
    Which question do you want answering first.:)

    Oshon Software Homepage

    Download the fully working 30 day or 30 times run, PIC IDE

    Get it and load your program

    BTW: now moved onto the second part of your posted program, there a big sections missing.!. References to an ISR etc, so I will stop.

    Why dont you write a short program that reads the ADC, prove it OK.
    then move forward to the PWM.
    Always debug peripheral subr before writing a full program.

    I'll look thru the MPLAB sim, personally I dont like it, maybe someone with experience will answer.
     
  2. fejesg

    fejesg New Member

    Joined:
    Nov 2, 2008
    Messages:
    19
    Likes:
    0
    Sorry, Eric; I can not understand Your message:

    "BTW: now moved onto the second part of your posted program, there a big sections missing.!. References to an ISR etc, so I will stop."

    So. I think, the program which I wrote is a "small try" one. Can You make smaller test program?

    If You can, please send me a small "test" program, with wich I can try to work ADC.

    Thank You the information about Oshon Simulator.

    fejesg
     
  3. fejesg

    fejesg New Member

    Joined:
    Nov 2, 2008
    Messages:
    19
    Likes:
    0
    I try to make my program shorter:

    But how I check working of ADC? With witch can I sign value of ADRESL or ADRESH?

    fejesg
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. fejesg

    fejesg New Member

    Joined:
    Nov 2, 2008
    Messages:
    19
    Likes:
    0

    Ahoy Eric!

    I downloaded Oshon, runned the program; SUCCESS! I setted up special breakpoints, stop when ADRESL or ADRESH changes - when I modified Voltage (2,39V) of GP0, the program STOPPED, ADRESL and ADRESH have values !!!!!!!!!!!

    I hope, the program will works inside of PIC...

    fejesg
     
  6. fejesg

    fejesg New Member

    Joined:
    Nov 2, 2008
    Messages:
    19
    Likes:
    0
    Yeeeah !!!! ThanX for Eric !

    When I tryed program whith Oshorn PicSim and chacked registers again, I realized, what is the error - I could modify CCP1CON, in place of CCPR1L !

    I corrected ANSEL, that conversion time shall be Fosc/16, I use only GP0. And go! The circuit works; I putted in the "already workable" direction-change-unit, and the program is ready.

     
    Last edited: Nov 3, 2008

Share This Page