IOC on pin going HIGH and LOW


+ Reply to Thread
Results 1 to 8 of 8

Hybrid View

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


    1 out of 1 members found this post helpful. Did you find this post helpful? Yes | No

    Default Re: IOC on pin going HIGH and LOW

    followed by a 74HC14,
    why the redundant extra schmitt trigger?

    in the pic 16F1885x family all input pins are ST by default unless you clear the INPUT THRESHOLD CONTROL bit in the INLVLx register
    Warning I'm not a teacher

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


    Did you find this post helpful? Yes | No

    Default Re: IOC on pin going HIGH and LOW

    Quote Originally Posted by richard View Post
    why the redundant extra schmitt trigger? ...
    Because I started development using a 16F1937 and didn't notice the ST on the 16F18877.

    (runs over to the datasheet)



    EDIT: Wow! That PIC is amazing; every pin has ADC and ST. That's gonna help bring costs down from those 74HC14 ICs.
    Last edited by Demon; - 30th August 2024 at 01:31.
    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!

  3. #3
    Join Date
    May 2013
    Location
    australia
    Posts
    2,643


    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

  4. #4
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    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

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


    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: 355
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!

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


    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, 20:47
  2. Replies: 8
    Last Post: - 31st March 2014, 20: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, 18:40
  4. Replies: 5
    Last Post: - 14th May 2010, 03:21
  5. Reading if Pin is High or Low?
    By Spindle in forum mel PIC BASIC Pro
    Replies: 29
    Last Post: - 1st August 2005, 17:39

Members who have read this thread : 10

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