IOC on pin going HIGH and LOW


Closed Thread
Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    May 2013
    Location
    australia
    Posts
    2,696


    Did you find this post helpful? Yes | No

    Default Re: IOC on pin going HIGH and LOW

    Because I started development using a 16F1937
    unfortunately one of the very few enhanced core pic chips without INPUT THRESHOLD CONTROL.
    Warning I'm not a teacher

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,170


    Did you find this post helpful? Yes | No

    Default Re: IOC on pin going HIGH and LOW

    193x was a nice chip in its time but now comparing to 188xx seems so old...!

    And I have many in stock...

    Ioannis

  3. #3
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: IOC on pin going HIGH and LOW

    Registers associated with Interrupts are in Table 7-1 on p. 153:

    Name:  16F1887xx interrupt registers.png
Views: 643
Size:  68.4 KB


    From my observations, you need 2 entries in the DEFINES for 16F:

    - Result bit,
    - Enable bit.


    #DEFINE {DT-INT interrupt NAME} {result flag REGISTER}, {result flag bit}, {enable bit REGISTER}, {enable bit}

    For example:
    #DEFINE IOC_INT PIR0,IOCIF, PIE0,IOCIE
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  4. #4
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: IOC on pin going HIGH and LOW

    I keep the IOC flags right alongside the pin definitions (this is a EC11-type rotary encoder; 2 shafts + pushbutton):

    Code:
    ;--- Setup pins ----------------------------------------------------------------
    
    COM1_MHz_WiperA             var PortA.2         ' Outer
    IOC_COM1_MHz_WiperA_flag    var IOCAF.2         '       IOC flag
    COM1_MHz_WiperB             var PortA.3         ' Outer
    IOC_COM1_MHz_WiperB_flag    var IOCAF.3         '       IOC flag
    COM1_KHz_WiperA             var PortA.0         ' Inner
    IOC_COM1_KHz_WiperA_flag    var IOCAF.0         '       IOC flag
    COM1_KHz_WiperB             VAr PortA.1         ' Inner
    IOC_COM1_KHz_WiperB_flag    var IOCAF.1         '       IOC flag
    COM1_SPST                   var PortA.4         ' Swap
    IOC_COM1_SPST_flag          var IOCAF.4         '       IOC flag
    It makes it easier (for me) to make sure things are connected exactly where I think they are. It's also much easier to move things about on the pins.
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

Similar Threads

  1. Replies: 10
    Last Post: - 14th April 2014, 21:47
  2. Replies: 8
    Last Post: - 31st March 2014, 21:16
  3. Use of HIGH and LOW for pin outputs
    By rnuke77 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 27th January 2011, 19:40
  4. Replies: 5
    Last Post: - 14th May 2010, 04:21
  5. Reading if Pin is High or Low?
    By Spindle in forum mel PIC BASIC Pro
    Replies: 29
    Last Post: - 1st August 2005, 18:39

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