Problems with 12F675


Closed Thread
Results 1 to 40 of 67

Hybrid View

  1. #1
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,651


    Did you find this post helpful? Yes | No

    Talking

    Quote Originally Posted by Darrel Taylor View Post
    That 10µA or less quiescent looks really nice.

    Is there something like that in a fixed voltage TO-92, so fratello can just stick one in his PC board?
    <br>
    Hi, Darrel

    LP 2950 ACZ 5.0 from National, i.e.???

    regards

    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 " !!!
    *****************************************

  2. #2
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    Did you find this post helpful? Yes | No

    Default It is not correct ; why ?

    I try to put another 'tips' in the code of this button.
    At start ( plus by auto's contact) the PIC read from eeprom the value of overrload (variable "calibra"). If this is zero or less than minimum value (setting by me at 270 mV) start subroutine "calibration:". The value of maximum tension reading here are memorized as new value for "calibra".
    One new start : the value of calibra is NOT zero or less than minimum value, so the module works as usual.
    It's correct the code ? I think it's something wrong with reading/writing "calibra" from eeprom ?!? How write correct value of "calibra" in eeprom ?
    Attached Files Attached Files

  3. #3
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    Did you find this post helpful? Yes | No

    Default

    I made some experiments ; the window roll-up (or roll-down) in about 6 seconds. I'm thinking to something like this :
    ...............
    eeprom 0, [0, 0]
    ..............
    read 0, calibra.byte0
    read 1, calibra.byte1
    if calibra =0 then
    high rel1
    ....read U for maximum 7-8 seconds
    ....identify the highest value of U
    ....write this value in eeprom for further using as max.value in check:

    low rel1
    endif
    ..............
    main:
    ....etc,etc.

    Help, please, with the red lines; starting with what ? I use "search" but perhaps not so good ; I can't find one "clue" ! Thanks for supporting me !

  4. #4
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    Did you find this post helpful? Yes | No

    Default

    I read about MAX. It's this correct :
    '------------------------
    read 0, calibra.byte0
    read 1, calibra.byte1
    if calibra =0 then
    high rel1
    gosub calibration
    endif
    '------------------------
    calibration:
    for cnt=0 to 80
    adcin 3, v_cal
    v_cal=v_cal * 5000
    v_cal=div32 1023
    vmax=vmax max v_cal
    pause 100
    next cnt ' reading v_cal for about 8 seconds ?
    endfor
    low rel1
    calibra=vmax
    calibra.highbyte = ADRESH
    calibra.lowbyte = ADRESL
    write 0, calibra.byte0
    write 1, calibra.byte1
    Return
    '---------------------------
    Thanks for any advice !
    L.E.: The problem is : writing vmax ( example: 275) to eeprom, and then reading.
    Last edited by fratello; - 10th August 2009 at 20:59.

  5. #5
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    Did you find this post helpful? Yes | No

    Default

    This is my working code :
    calibration:
    rel1=1 ' rel1 = 1 -->> window roll-up !
    for cnt=1 to 80 ' assuming window roll-up complete in 8 seconds !
    adcin 3, v_cal
    v_cal=v_cal * 5000
    v_cal=div32 1023
    vmax=0 max v_cal
    pause 100
    next cnt

    low rel1
    calibra = vmax
    if calibra > 20 then ' "20" is value knowing by user !
    write 0, calibra.byte1
    pause 10
    write 1, calibra.byte0
    pause 10
    else
    calibra = 19
    write 0, calibra.byte1
    pause 10
    write 1, calibra.byte0
    pause 10
    endif
    RETURN

  6. #6
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    Did you find this post helpful? Yes | No

    Default

    The value for long press button it's a little to big. I want to reduce him. So,
    Please, help :
    Timer1 = 3037 ' 1 second
    Timer1 = ? ' for 0.5 sec
    ' for 0.6 sec
    ' for 0.7 sec
    ' for 0,8 sec
    Thanks !

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


    Did you find this post helpful? Yes | No

    Default

    3037 with a prescaler of 1:8, sets Timer1 to 500mS periods.
    2 of those periods are counted to reach 1 second.

    To calculate the number for any other time period, download mister-e's calculator ...

    PicMultiCalc v1.3.1
    http://www.picbasic.co.uk/forum/atta...achmentid=2957

    In the "Timer Helper" app, set the time to 300ms and it shows the reload value as 28037. Two 300ms periods would give you a total time of 600ms.

    Set it to 500mS and you'll see where I got the original number.

    Any other period can be calculated easily.
    <br>
    DT

Similar Threads

  1. 12F683 vs 12F675.
    By sccoupe in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 11th July 2009, 04:58
  2. LANC code 12F675
    By MikeDD in forum General
    Replies: 4
    Last Post: - 9th May 2008, 05:44
  3. 12F675 cant serout to PC
    By ruijc in forum General
    Replies: 9
    Last Post: - 3rd December 2007, 00:11
  4. USART problems
    By egberttheone in forum mel PIC BASIC Pro
    Replies: 47
    Last Post: - 6th March 2005, 21:45
  5. Serial LCD on 12F675
    By anj in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 31st March 2004, 23:11

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