12f675 making me a crazy person


Closed Thread
Results 1 to 17 of 17

Hybrid View

  1. #1
    Join Date
    Oct 2006
    Location
    Edmonton AB Canada
    Posts
    52


    Did you find this post helpful? Yes | No

    Default

    Jerson,

    That won't work. The Chubb needs to be high or low irrespective of the Led.

    Alain,

    P&J, toast and jam, goSUB and return. Can't change one without the other. Code works like a charm. It may not be elegant, but I'm not charging myself very much for it either...

    Cheers
    Gary

  2. #2
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    967


    Did you find this post helpful? Yes | No

    Default

    Try this for the PM assembler. If you hold Chubb high, foto1 will fire repeatedly. Release Chubb and trig will go low

    Enjoy

    Code:
    @ device  INTRC_OSC_NOCLKOUT, WDT_OFF
    @ device  MCLR_OFF, PWRT_ON
    @ device  CPD_ON, PROTECT_ON
    
    DEFINE OSC 4
    ANSEL=%00000000
    CMCON=7
    trisio = %00000100
    
    ' Chubb input gpio.5
    ' Output to panel - Trig var gpio.2
    ' Photo Guy gpio.4
    input gpio.5
        Chubb var gpio.5
    output gpio.4
        Led var gpio.4
        low led
    output gpio.2
        Trig var gpio.2
        low trig
    
    'Variable for the photo guy
    x var word
        x = 10
        
    ' Test the photo guy
    PAUSE 2000
        HIGH LED
            PAUSE 250
        LOW LED
            PAUSE 250
        HIGH LED
            PAUSE 250
        LOW LED
    PAUSE 2000
    
    'start here
    loop:
        if Chubb = 0 then
            high trig
            if X < 11 then
                X = 12
                gosub cola
            endif
        else
            low trig
        endif
    
        if x > 11 then
            x = (x + 1)
        endif
    
        if x >= 300 then
            x = 10
        endif
    
        if x = 100 then
            GOTO foto1
        endif
    
    pause 100
    goto loop
    end
    
    
    foto1:
        high led
            pause 100
        low led
                pause 250
        high led
            pause 100
        low led
    goto loop
    
    cola:
        high led
            pause 100
        low led
    return
    end

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


    Did you find this post helpful? Yes | No

    Wink

    Quote Originally Posted by Meriachee View Post

    Code works like a charm.Gary
    Hi, Gary

    I did understand it was the reason for you to show it here ... sure !

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

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


    Did you find this post helpful? Yes | No

    Default

    Originally Posted by Meriachee

    Code works like a charm.Gary
    So you have it all figured out now? What did you do to fix it?
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Oct 2006
    Location
    Edmonton AB Canada
    Posts
    52


    Did you find this post helpful? Yes | No

    Default

    There was a goto a subroutine, and a return at the end of it. Funny how PBP doesn't understand that it was s'posta go back to where we left off.

    The panel got installed this afternoon, and after a small expected timing change to the photoguy, it works like a charm.

    Thanks for all the help.

    Gary

Similar Threads

  1. 12F683 vs 12F675.
    By sccoupe in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 11th July 2009, 04:58
  2. Instant Interupts with a 12f675
    By wlundonly in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 26th January 2008, 01:52
  3. 12F675 won't reprogram or erase
    By modifyit in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 19th May 2006, 05:07
  4. 12f675 serial pic2pic
    By tagan in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 12th March 2006, 22:55
  5. Multitasking 12F675 I/O
    By jpeakall in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 26th November 2003, 00:57

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