inputs on 12F675 (or for that matter any PIC)


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2005
    Location
    Up the bush, Western Plains, NSW Au
    Posts
    216

    Default inputs on 12F675 (or for that matter any PIC)

    Hi all,
    Short of using interrupts on GPIO change, is there any way to have the digital inputs latch up until read. I think I sorta want an interrupt type of thing but without all the interrupt programming. I remember the old 6821 PIA had provision to latch the inputs, if they changed and cleared when the input register was read. Any such sorta thing available on PICs?
    I am, BTW, R'ingTFM but aren't up to that bit yet.
    I will be having a pretty short change on the inputs with the possibility of missing them while off doing other things. Perfect scenario for interrupts I know, but I just wanna do it the lazy way.
    Serve me bloody right if I hafta use interrupts, won't it?
    I have done the design with RS flip flops, which works beaut, but takes up too much real estate on the PCB.
    Last edited by muddy0409; - 11th April 2007 at 17:44. Reason: Additions
    Peter Moritz.
    Up the bush, Western Plains,
    New South Wales,
    Australia.

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,521


    Did you find this post helpful? Yes | No

    Default

    Hi,
    How many inputs do you need to 'latch' ? And do you need to catch the 'change' or just that there is or has been a high level on the input since last read?

    The only way I can think of without using interrupts or external hardware is to set up TMR0 and TMR1 (for 12F675) as counters. The value of the TMR registers will then be different between reads if the pin(s) have changed from low to high.

    /Henrik Olsson.

  3. #3


    Did you find this post helpful? Yes | No

    Default

    I did something like this a long time ago to catch a change:

    X VAR BIT

    START:
    LET X = (YOUR INPUT PIN)
    NAP 4
    IF X <> (YOUR INPUT PIN) THEN RUN
    GOTO START

    RUN:
    DO YOUR THING HERE

Similar Threads

  1. Midi, Interrupts and Pic better than SX28?
    By Lajko in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 27th September 2008, 00:26
  2. Using portb as inputs PIC goes crazy
    By peterdeco1 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 14th November 2005, 14:15
  3. Long Distance Input's to Pic
    By GregK in forum General
    Replies: 3
    Last Post: - 21st April 2005, 09:37
  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. Pic 12F675
    By sherm in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 12th March 2003, 12:04

Members who have read this thread : 1

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