Toggled Pic flip flop Help Please


Closed Thread
Results 1 to 3 of 3

Hybrid View

  1. #1
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    I am not sure why you have these two lines – they will always be false since they follow your HIGH and LOW statements ... delete them (in my opinion)

    Code:
    if outputline0=0 then outputline1=1 (these are the two lines i am having)
    if outputline0=1 then ouputline1=0 ( problems with )
    To get you going, try this for your Loop – Goto Loop section (written close to your style).

    Code:
    Loop:
    '
    '
    'Test for Trigger
    '----------------
    If InputTrigger=0 then
    	pause 30				' Debounce time
    	If InputTrigger = 1 then Loop	' Debounce check – exit out of loop if not low after 30 mS
    
    	While InputTrigger=0			' Wait for button release before updating
    	Wend					' so you do not race through your Loop routine a zillion times before you release the button
    
    	GPIO = GPIO ^ 3			' Toggle bits 0 and 1 - See PBP manual section 4.17.14
    Endif
    Goto Loop
    After this works, you can work on saving the state of the toggle in EEPROM. What PIC are you using?
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

  2. #2
    Join Date
    Oct 2007
    Posts
    35


    Did you find this post helpful? Yes | No

    Default Hi,

    Thanks for your help,

    I have transfered your code (i can see where I went wrong) (yours is a better way)
    and it works well,
    I have decided to run the switching code in a 12F675 on its own as I had run out of ports on my 16F627,

    (Just to put you in the picture the unit is part of a two way radio repeater, and the coding was to switch between to linking radios.)

    Cheers
    Dave...

Similar Threads

  1. Flip Flop
    By tazntex in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 13th November 2008, 20:53
  2. pic to pic ir link versus wired link : help please anyone
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 30th May 2008, 21:01
  3. flip flop for driving latching solenoids
    By kitcat in forum Schematics
    Replies: 3
    Last Post: - 4th February 2006, 22:34
  4. Serial Pic to Pic using HSER
    By Chadhammer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th March 2005, 23:14
  5. need hex code to make 12c509 a flip flop,
    By bruce3mn in forum General
    Replies: 1
    Last Post: - 15th November 2004, 03:23

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