IOC flag triggered when PIC is unplugged...?


+ Reply to Thread
Results 1 to 14 of 14

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default Re: IOC flag triggered when PIC is unplugged...?

    These are pushbuttons, not rotary encoders with wonky shafts that can jitter whenever the cat farts.
    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!

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


    Did you find this post helpful? Yes | No

    Default Re: IOC flag triggered when PIC is unplugged...?

    I'm certain it has something to do with voltage levels as the PIC loses power.

    IOC flags are randomly triggered when VDD is cut with a switch, but not on MCLR.

    Values are READ from DATA at PIC start-up. IOC flags on pushbuttons are used to swap values left to right, then WRITE back to memory.* By the end of the video, all values have swapped places without pushing any buttons.

    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,645


    Did you find this post helpful? Yes | No

    Default Re: IOC flag triggered when PIC is unplugged...?

    Ceramic bypass/decoupling capacitors are often better .

    IOC flags on pushbuttons are used to swap values left to right, then WRITE back to memory
    a particularly bad practice, you should always check that it was an actual keypress [ in that was held for a definitive time] before actioning it

    key activity should be ignored until power is stable
    Warning I'm not a teacher

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


    Did you find this post helpful? Yes | No

    Default Re: IOC flag triggered when PIC is unplugged...?

    Quote Originally Posted by richard View Post
    Ceramic bypass/decoupling capacitors are often better ...
    I have 0.1uF on VDD/VSS pins, 0.1uF on the switch input pins and 0.01uF on the encoder input pins; all ceramic caps.


    Quote Originally Posted by richard View Post
    ...a particularly bad practice, you should always check that it was an actual keypress [ in that was held for a definitive time] before actioning it...
    That's what the IOC flag was used for; to check if a button was activated. If I'm going to have to check if a key has been pressed, IOC is of no advantage to me. I didn't understand why you guys were not in favour of using IOC for this, but now I'm understanding a lot better why it wasn't good idea.

    I've already gutted the IOC code and I'm checking the pins for change in value. Those 4 SWAP buttons were the last ones, and then I noticed things were going wacky with my stored data.


    Quote Originally Posted by richard View Post
    ... key activity should be ignored until power is stable
    I always have at least PAUSEUS 200 at program startup. I have no idea how to check if power is stable on shut-down.


    I've given up on the 16F18877; I had switched to these for IOC, internal pull-ups and Schmitt Trigger features. But they're much more finicky than a 16F1937 with external pull-ups, 74HC14 ICs and just polling the pins in MainLoop.

    The 16F1937 is like a tank; less fancy but it keeps on trucking.
    Last edited by Demon; - 22nd September 2024 at 03:32.
    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: 9
    Last Post: - 1st November 2016, 14:37
  2. DT_INTS-14.bas Reset Flag
    By Larryd in forum Serial
    Replies: 2
    Last Post: - 8th April 2013, 22:44
  3. Replies: 1
    Last Post: - 12th May 2012, 12:37
  4. How to know what pin triggered an interrupt?
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 13th October 2008, 07:29
  5. DS18B20 Busy Flag
    By CocaColaKid in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 6th November 2006, 13:21

Members who have read this thread : 9

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