Page 1 of 2 There is an unfortunate problem with the new Pico 2 - its input stage has more leakage than you might expect and what is more this is non-linear and so leads to some strange behavior. This is an extract from my newly published book all about the Pico/W and Pico 2/W in C.
Programming the Raspberry Pi Pico In C Third Edition
By Harry Fairhead

Buy from Amazon.
Contents
- Preface
- Chapter 1 The Raspberry Pi Pico – Before We Begin
- Chapter 2 Getting Started
- Chapter 3 Using GPIO Lines
- Chapter 4 Some Electronics
Extract: Erratum E9 Pull Down Problems ****NEW!
- Chapter 5 Simple Input
Extract: GPIO Input ***
- Chapter 6 Advanced Input – Events and Interrupts
- Chapter 7 Pulse Width Modulation
Extract: Basic PWM ***
- Chapter 8 Controlling Motors And Servos
- Chapter 9 Getting Started With The SPI Bus
- Chapter 10 A-To-D and The SPI Bus
- Chapter 11 Using The I2C Bus
- Chapter 12 Using The PIO
Extract: A 1-Wire PIO Program ***
- Chapter 13 The DHT22 Sensor Implementing A Custom Protocol
- Chapter 14 The 1‑Wire Bus And The DS1820
- Chapter 15 The Serial Port
- Chapter 16 Using the Pico W
Extract: Simple Web Client *** Extract:A Better Connect ***
- Chapter 17 The Pico/W In C: Direct To Hardware *
- Chapter 18 Multicore and FreeRTOS
Extra: Adding WiFi To The Pico 2
*** Extracts from Edition 2 not yet updated.
In chapter but not in this extract
- How to Think About Circuits
- Electrical Drive Characteristics
- Driving an LED
- LED BJT Drive
- A BJT Example
- A MOSFET Driver
- MOSFET LED
- Setting Drive Type
- Push-Pull Mode
- Pull-Up Mode
- Pull-Down Mode
- Open Collector
- Setting Output Mode
Pull Down Problems Erratum E9
There is a design fault in the RP2350 chip which causes problems with GPIO use in pull down mode. In fact the problem is independent of the pull up mode selected but it shows itself more clearly with pull down enabled. The problem is input stage itself. In principle the input stage of the PAD should not draw only a tiny current that we can usually regard as zero. Unfortunately the design fault means that when in input mode the PAD draws a current that depends on the voltage applied:

In principle the leakage current should be less than 1 µA.
What this means is that any of the GPIO lines in input mode will distort an input signal if the source cannot supply sufficient current to overcome the leakage. This isn’t usually a problem for digital inputs with active outputs. However for passive pull up/down it can be a big problem.
Analyzing what happens in this non-linear circuit is difficult and uses techniques that are not usually encountered in digital electronics – load line, differential resistance and equilibrium points.
For a moment consider using the internal pull down resistor which has a value of 80 to 50kΩ. The driver is nonlinear as represented by the graph but the resistor is linear. To analyze what happens we can draw a line on the current voltage chart that shows the behavior of the pull down resistor. The system can only operate in equilibrium where the line and the curve intersect – the current in the resistor has to be the same as the leakage current.
The resistors “load line” intersects in three places as shown in the diagram:

The equilibrium point corresponding to zero current is stable. The one at around 1.5V is unstable as the differential resistance of the leakage source is positive but the one at around 2V is stable as the differential resistance is negative.
Now consider what happens when you ground the line. In this case the stable state is 0V and 0 µA and this is where the line stays when you release it.
Now consider what happens when you pull the line high i.e. to 3.3V and then release it. What should happen is that the line returns to 0V because of the pull down resistor. What actually happens is that the voltage starts to fall but it stops falling at around 2V when it reaches the first stable state. What this means is that the line does not return to 0V and as 2V is still in the region that represents one this means that once the line has been driven by another device to one it stays set to one even after the device releases the line.
|