• AVR Freaks

Hot!PICkit4: ICSPCLK and ISPCLK used also as analog input

Author
TechDpt
Starting Member
  • Total Posts : 74
  • Reward points : 0
  • Joined: 2011/06/13 09:29:39
  • Location: 0
  • Status: offline
2021/02/26 01:24:49 (permalink)
0

PICkit4: ICSPCLK and ISPCLK used also as analog input

Dear all,
due to space constraints I need to use also the following pins as analog inputs:
 
- RA0
- RA1
 
the analog signals are taken from an op amp output through a resistive divider as into the attached image, my question is if this type of setup may have some effect on the PICkit4 and programming perspective. The analog signals at the divider input can swing between 1V up to 4V.
 
The PIC have a 3.3V power supply voltage.
 
Pins RA0 and RA1 see an equivalent Thevenin circuit composed of a voltage generator with a voltage swing between 0.5V up to 2V in series with a 5k resistance, these voltage level and source impedance should being compatibile with the PIC ADC input module so my principal doubt is if the PICkit4 will be able to properly work and then perform the PIC programming.
 
Thanks for any hint you can let me know!
 
Best regards
F.
 

Attached Image(s)

#1

7 Replies Related Threads

    ric
    Super Member
    • Total Posts : 30223
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: PICkit4: ICSPCLK and ISPCLK used also as analog input 2021/02/26 01:42:17 (permalink)
    0
    The programming specs typically say a pulldown is ok, but a pullup will cause problems.
    Can you ensure the opamp outputs will be low during programming?
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #2
    TechDpt
    Starting Member
    • Total Posts : 74
    • Reward points : 0
    • Joined: 2011/06/13 09:29:39
    • Location: 0
    • Status: offline
    Re: PICkit4: ICSPCLK and ISPCLK used also as analog input 2021/02/26 05:29:30 (permalink)
    0
    Dear @ric
    during programming the analog voltage can be not equal to zero.
    I've foun over the net a schematic of the PICKIT4, I don't know if this is true, but let suppose of yes, we can do some considerations about it.
     
    Looking at the equivalent circuit and using the Miller theorem give the expression for the voltage at the PIC ICSP pins, then by substituting the numerical values we have:
     
    VICSP_PIN=VPIKIT4*0,98+VAN*3,22*10^-3
     
    so the contribute of the analog signal seems negligible regarding the one that came from the PICKIT4.
    Because I think that the communication from PICKIT and PIC is bidirectional may have some transient glitch related the analog voltage when the pin change direction from input to output and output to input then this may have some inpact or not, it can be subject for some further investigation.
     
    Could you please let me know what is your thinking about?
     
    Thanks and best regards.
    F.
     
    post edited by TechDpt - 2021/02/26 05:37:17

    Attached Image(s)

    #3
    Jerry Messina
    Super Member
    • Total Posts : 701
    • Reward points : 0
    • Joined: 2003/11/07 12:35:12
    • Status: offline
    Re: PICkit4: ICSPCLK and ISPCLK used also as analog input 2021/02/26 07:13:34 (permalink)
    4 (1)
    I've foun over the net a schematic of the PICKIT4

    Just FYI - that's definitely not a schematic of the PICKIT4... it looks to be some cheap attempt at a clone of the PICKIT2.
     
    post edited by Jerry Messina - 2021/02/26 07:21:35
    #4
    NorthGuy
    Super Member
    • Total Posts : 6587
    • Reward points : 0
    • Joined: 2014/02/23 14:23:23
    • Location: Northern Canada
    • Status: online
    Re: PICkit4: ICSPCLK and ISPCLK used also as analog input 2021/02/26 07:23:30 (permalink)
    0
    TechDpt
    I've foun over the net a schematic of the PICKIT4



    Looks more like PICkit2.
     
    The worst case is when the OpAmp is producing higher voltage. When you connect PICkit, and PICkit doesn't drive the programming pins, the PICkit's pulldown will tranform your voltage divider. The low resistor will become 4.7 || 10 = 3.2k. So, the voltage on Vdd will be 0.24 of the OpAmp voltage. If OpAmp goes to 5V, you'll get 1.2V, which may be Ok, even for 3.3V VDD.
     
    BTW: I used similarly sized voltage divider in the design of my new programmer, except that PIC16LF1459 uses RC0 and RC1 as programming pins. Both programming pins are analog during PIC operations. IMHO, analog is very good use for programming pins. It is much better than using these pins to drive LEDs or FETs.
     
    #5
    TechDpt
    Starting Member
    • Total Posts : 74
    • Reward points : 0
    • Joined: 2011/06/13 09:29:39
    • Location: 0
    • Status: offline
    Re: PICkit4: ICSPCLK and ISPCLK used also as analog input 2021/02/26 08:27:22 (permalink)
    0
    @Jerry Messina @NorthGuy,
    thank for your comments, you are right about the schematic, I've found it over the net as PICKIT4 but I was not sure about it, anyway I hope that the output stage is equal to the one used inside the PICKIT4.
     
    @NorthGuy
     So, the voltage on Vdd will be 0.24 of the OpAmp voltage
     
    I think you mean the voltage at the ICSP pin of the PIC not at the Vdd pin ...right? The new divider ratio is as you written 3.2k/(3.2k+10k)=0.24, so when the opamp output is at the maximum value, let it 5V, we have 5*0.24=1.2V that is lower than the 3.3V power supply voltage used for the PIC.
     
    Thanks!
    BR
    F.
    #6
    Murton Pike Systems
    Super Member
    • Total Posts : 247
    • Reward points : 0
    • Joined: 2020/09/10 02:13:01
    • Location: 0
    • Status: offline
    Re: PICkit4: ICSPCLK and ISPCLK used also as analog input 2021/02/26 10:51:59 (permalink)
    0
    I always put a 390r resistor in series with op amp output into a2d.
     
    Be careful with positive going signasl that can go above the rails.
    PIC32 a2d dont have diode to +ve rail so need an external one. BAT85 is good.
    I forgot and my PIC kept crashing.
     
     
     
     
     
    #7
    NorthGuy
    Super Member
    • Total Posts : 6587
    • Reward points : 0
    • Joined: 2014/02/23 14:23:23
    • Location: Northern Canada
    • Status: online
    Re: PICkit4: ICSPCLK and ISPCLK used also as analog input 2021/02/26 12:49:25 (permalink)
    0
    TechDpt
    I think you mean the voltage at the ICSP pin of the PIC not at the Vdd pin ...right? The new divider ratio is as you written 3.2k/(3.2k+10k)=0.24, so when the opamp output is at the maximum value, let it 5V, we have 5*0.24=1.2V that is lower than the 3.3V power supply voltage used for the PIC.

     
    Of course - PGC and PGD. But being below 3.3V is not a goal. In theory, it should be perceived by PICkit as low, because PICkit has a pulldown and expects the signal to go low when not driven. In practice, it may still work even if PICkit3 perceives it as high, as long as PICkit doesn't rely on it being low in this particular moment. You never know.
     
    #8
    Jump to:
    © 2021 APG vNext Commercial Version 4.5