problem with a/d in pic12f675


Closed Thread
Results 1 to 13 of 13

Hybrid View

  1. #1
    Join Date
    Jun 2011
    Location
    iran
    Posts
    7


    Did you find this post helpful? Yes | No

    Default Re: problem with a/d in pic12f675



    input gpio.0
    output gpio.1
    output gpio.2
    define osc 8
    define adc_clock 3
    include "modedefs.bas"
    ansel=%00000001
    adcon0.7=1
    define adc_bits 10
    w0 var byte
    w1 var word
    w2 var word
    cmcon=7
    start:
    adcin 0,w1
    pause 100
    w2=w1
    for w0=65 to 90
    serout gpio.1,t9600,[254,128]
    serout gpio.1,t9600,[#w1]
    pause 1000
    serout gpio.1,t9600,[254,1]
    next w0
    goto start
    end


    thank you very very much men
    i used your tricks(henrik) and used your examples(archangel).
    but it isnt working yet.
    please check my example out.
    can you find an error?
    oh,thank you veryyyyyy much!
    in the software all the critical words are with capital letters,when i copied them they turned to lowercase.
    oh, excuse me if my english speaking is weak!!!

  2. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Re: problem with a/d in pic12f675

    Quote Originally Posted by samannikzad View Post


    i
    oh,thank you veryyyyyy much!
    in the software all the critical words are with capital letters,when i copied them they turned to lowercase.
    oh, excuse me if my english speaking is weak!!!
    From last up,
    I am sure your English is truly better than my Farsi, and your English needs no apologies, it is good enough.
    As FOR CHANGING TO LOWERCASE, You have been punked by MCS . MCS Automaticaly shows reserved words as UPPERCASE, but they remain lowercase in the code, this forum will show a copy paste in it's raw format, so go back and retype the define statements in ALL UPPERCASE LETTERS like so:
    DEFINE OSC 8
    DEFINE ADC_CLOCK 3

    and report back here with the results. Mister_e asked about the config fuses
    study this post and solve some of your headaches:
    http://www.picbasic.co.uk/forum/showthread.php?t=543
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  3. #3
    Join Date
    Jun 2011
    Location
    iran
    Posts
    7


    Did you find this post helpful? Yes | No

    Default Re: problem with a/d in pic12f675

    hello,
    i did what you said.
    i wrote t with capslock on, and i set the fuse bits and settings on
    my programmer software(practical) or in the simulating software.
    this is a simple program.but it doesn't work neither
    in simulatin software nor on the breadboard(practical)
    see:
    INPUT GPIO.0
    OUTPUT GPIO.1
    OUTPUT GPIO.2
    DEFINE OSC 4
    DEFINE ADC_CLOCK 3
    INCLUDE "MODEDEFS.BAS"
    ANSEL=%00000001
    ADCON0.7=1
    DEFINE ADC_BITS 10
    W1 VAR WORD
    CMCON=7
    GPIO.1=1
    GPIO.2=0
    PAUSE 1000
    GPIO.1=0
    GPIO.2=1
    PAUSE 1000
    GPIO.1=0
    GPIO.2=0
    START:
    ADCIN 0,W1
    PAUSE 100
    IF W1>500 THEN
    GPIO.1=1
    GPIO.2=0
    PAUSE 100
    ELSE
    GPIO.1=0
    GPIO.2=1
    PAUSE 100
    ENDIF
    GOTO START
    END



    but it doesn't work yet.
    there is sth that i should say.
    my microcode studio's version is 2.3.0.0
    and it had no support libraries for 12f675.
    then i downloaded "12f675.bas" and "m12f675.inc" and copied them to the mcs
    folders in my drives(near other inc and bas files).
    is there any problems with this process?
    and i can drive the adc module on 16f877a,but not on 12f675.
    since the library files were present in the software.
    thank you for helping me from the other side of the world!
    thank you

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: problem with a/d in pic12f675

    then i downloaded "12f675.bas" and "m12f675.inc"
    That is most likely the main problem, you do not have a legal copy. PicBasicPro is not a download.
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Jun 2011
    Location
    iran
    Posts
    7


    Did you find this post helpful? Yes | No

    Default Re: problem with a/d in pic12f675

    oh thank mackrackit
    and i have to find a legal,not a cracked version
    of course it's too hard to find it!

  6. #6
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: problem with a/d in pic12f675

    This is a good place to start
    http://store.melabs.com/prod/software/PBP.html

    You might be able to change the chip you are using and get by with the demo version.
    Dave
    Always wear safety glasses while programming.

Members who have read this thread : 0

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