• AVR Freaks

Hot!PIC16F19197, High-Drive I/O Ports: How to turn off?

Author
christerb
New Member
  • Total Posts : 10
  • Reward points : 0
  • Joined: 2019/04/25 05:23:24
  • Location: 0
  • Status: offline
2019/05/21 06:53:50 (permalink)
0

PIC16F19197, High-Drive I/O Ports: How to turn off?

This about the PIC16F19197. I am driving a number of indicator LEDs directly from output pins and without current limiting resistors. I expected no more than 3.5 mA at 5 V (standard I/O port) from the outputs and have chosen low-power LEDs. But I measure 55 mA! This corresponds to a high-drive I/O port (see datasheet page 668 under Output High Voltage) with HIDCx=1. My problem could be easily solved by setting HIDCx=0 (for some pins in PORTD, PORTB, and PORTG in my case) but I cannot find such a register, not in the datasheet, nor in MPLAB X/MCC. I only find a HIDRVF register.
#1

6 Replies Related Threads

    pcbbc
    Super Member
    • Total Posts : 1101
    • Reward points : 0
    • Joined: 2014/03/27 07:04:41
    • Location: 0
    • Status: offline
    Re: PIC16F19197, High-Drive I/O Ports: How to turn off? 2019/05/21 07:12:20 (permalink)
    +1 (1)
    You are reading TABLE 39-4 chart wrong.
    You are assuming that the current will be limited to the value shown in the "condition" column.
    What that table actually tells you for parameter D090/Voh, is that at 5v Vdd with a load that sinks 3.5mA you can expect no more than a 0.7v drop on a standard data pin.
    It says nothing about what happens if you exceed the 3.5mA condition (edit: except that you should expect more than a 0.7V drop on the output pin).
     
    Note that only PORTF has high-drive functionality as far as I can see.  For those pins you can draw more current (54mA @ 5V Vdd) and still have the pin meet its specified typical output voltage (Vdd - 0.7).
    post edited by pcbbc - 2019/05/21 07:22:34
    #2
    1and0
    Access is Denied
    • Total Posts : 9314
    • Reward points : 0
    • Joined: 2007/05/06 12:03:20
    • Location: Harry's Gray Matter
    • Status: offline
    Re: PIC16F19197, High-Drive I/O Ports: How to turn off? 2019/05/21 07:42:34 (permalink)
    +1 (1)
    christerb
    This about the PIC16F19197. I am driving a number of indicator LEDs directly from output pins and without current limiting resistors. I expected no more than 3.5 mA at 5 V (standard I/O port) from the outputs ...

    Oh boy!
     
    #3
    pcbbc
    Super Member
    • Total Posts : 1101
    • Reward points : 0
    • Joined: 2014/03/27 07:04:41
    • Location: 0
    • Status: offline
    Re: PIC16F19197, High-Drive I/O Ports: How to turn off? 2019/05/21 07:48:15 (permalink)
    0
    Oh boy! indeed.


     
    #4
    christerb
    New Member
    • Total Posts : 10
    • Reward points : 0
    • Joined: 2019/04/25 05:23:24
    • Location: 0
    • Status: offline
    Re: PIC16F19197, High-Drive I/O Ports: How to turn off? 2019/05/21 09:04:09 (permalink)
    0
    Thank you pcbbc. I always thought there was a limit to how much current an pin could "supply", and that this was a couple of mA. Instead I should think of how much current can be drawn.
    My excuse is that my teacher has always told me the resistors are unnecessary when driving LEDs from a MCU. And indeed it has worked. That is how I developed my understanding. 
    #5
    mbrowning
    Just a Member
    • Total Posts : 1424
    • Reward points : 0
    • Joined: 2005/03/16 14:32:56
    • Location: Melbourne, FL
    • Status: online
    Re: PIC16F19197, High-Drive I/O Ports: How to turn off? 2019/05/21 09:13:08 (permalink)
    +2 (2)
    My excuse is that my teacher has always told me the resistors are unnecessary when driving LEDs from a MCU. And indeed it has worked. That is how I developed my understanding.

    Bad teaching.
    It didn't work right. Excessive LED current - stresses IO, stresses LED, wastes power, Vdd drop when LED is on, big Vdd transient every time the LED is turned on or off.
    Bad Bad understanding.

    Oh well - there's always next year
    #6
    christerb
    New Member
    • Total Posts : 10
    • Reward points : 0
    • Joined: 2019/04/25 05:23:24
    • Location: 0
    • Status: offline
    Re: PIC16F19197, High-Drive I/O Ports: How to turn off? 2019/05/21 12:16:20 (permalink)
    0
    Good answer!
    #7
    Jump to:
    © 2019 APG vNext Commercial Version 4.5