Jumperless/Hardware/TxRxRemovalInstructions.md
Kevin Santo Cappuccio f9640cedd1 probe
2024-02-17 17:23:47 -08:00

7.6 KiB

So, when I was designing the Jumperless, I put in these protection resistors so you wouldn't blow up the RP2040 with the +-9V that could be floating around on the board. Screenshot 2023-12-21 at 9 56 31 AM You still could do that, or we just can trust the built-in protection diodes and make it so the Jumperless is able to flash a 5V Arduino Nano with just one USB cable.

TxRx00083

An Arduino will program with 3.3V logic signals, but the 1K resistor is dropping the voltage below the threshold where it registers as a logic high (if the Arduino's inputs were ideal, infinite input impedance it wouldn't matter, but they're not.)

Also, just in case you're worrying about this, the RP2040's inputs are 5V tolerant even though they're not realy advertised as such.

So we're going to short these 0402 resistors, here's how: TxRx00000

First, peel off the rubber foot right there TxRx00002

0402 resistors are super easy to remove, you just melt a glob of solder onto them and they'll just float in the solder and come off stuck to your soldering iron 3131g

Clean off the blob of solder (with the resistor probably inside) and do the same thing to the other two TxRx00010

TxRx00016

Now get a random resistor, preferably the cheap ones with the skinny legs. Or you can use some thin stripped wire. TxRx00022

Now tin the whole leg with solder. Hot tip: stick it into the GPIO hole to hold it. TxRx00023 TxRx00024

There should be enough solder left on the pads and the leg, so you should need to add any more. Hold the leg across the 2 pads and melt it all down. TxRx00027 TxRx00028 TxRx00030

Now cut off the leg right up near the pads and do the same thing with the rest of them. TxRx00031 TxRx00041 TxRx00044

Now clean off the flux with rubbing alcohol or MG Chemicals Heavy Duty Flux Remover (this stuff is amazing, it'll mess up certain plastics, but the PA-12 Nylon the breadboard is made of isn't one of them) TxRx00047

Replace the rubber foot TxRx00081

Now your hardware should be good to go. Let's flash the Arduino from Arduino IDE.

For this to work, you need to connect your UART lines between the Jumperless and the Arduino in Wokwi first. Save that so it updates on the Jumperless. Screenshot 2023-12-21 at 10 56 45 AM

Here's what those pins on the Logic Analyzer connect to: LogicAnalyzerGuide

Hot tip: those don't necessarily need to go to the Arduino header, you can also just have your Arduino somewhere on the breadboard, in that case you'll also need to connect the RESET lines to the appropriate place.

Now in Arduino IDE, select the higher numbered port (So on my Mac it's /dev/cu.usbmodem03, on a PC it will be COM[higher number] Screenshot 2023-12-21 at 11 02 37 AM

Now hit Upload and it should work. Screenshot 2023-12-21 at 11 06 42 AM

If you're getting something like this

Screenshot 2023-12-21 at 11 08 03 AM

There are a few possible things going on:

  • The Tx and Rx lines aren't connected or swapped, either Wokwi didn't update them or you messed up with the soldering and didn't short the resistors

  • Something is holding the RESET line high, if it's connected somewhere in Wokwi

  • The Arduino is running a sketch where it's outputting Serial data regularly, this happens a lot to me so here's what to do about it.

First, it's a good idea to put some fairly long delay(2500); in your setup() before writing anything to Serial. When flashing over direct USB it's less of an issue, but when you're doing in via the Jumperless, it seems to get in the way.

Then hold down the Reset button on the Arduino, unplug the Jumperless from USB, plug it back in while still holding the Reset button (and continue holding it), make the connections in Wokwi to connect the UART lines and save, then press Upload in Arduino IDE and watch the output. When it gets to here Screenshot 2023-12-21 at 9 40 03 AM let go of the Reset button.

That process along with the delays in setup() make sure the Serial lines are clear when it tries to flash the sketch to the Arduino.

And you should be good! Let me know if this works for you.

Also, once all this works, the Arduino can reprogram the Jumperless by sending commands back over UART

For example, this sketch


void setup() {

 pinMode(LED_BUILTIN, OUTPUT);
 pinMode(10, INPUT_PULLUP);
 delay(3500);
 Serial.begin(115200);
 delay(500);
}

int count = 1;

void loop() {
 digitalWrite(LED_BUILTIN, HIGH);
 delay(160);
 digitalWrite(LED_BUILTIN, LOW);
 delay(10);

 if (digitalRead(10) == 0) {
   delay(3000);
 }

 Serial.write("f 80-"); //f is to recieve connections, 80 is D10
 Serial.print(count);
 Serial.write(",116-70,117-71,");  //these 2 connections reconnect the UART lines so it's ready to send the next connection


 count++;
 if (count > 60) {
   count = 1;
 }
}

Will do this:

https://github.com/Architeuthis-Flux/Jumperless/assets/20519442/362c90fa-3068-4378-ab45-0c57de7f4d49

The Arduino is telling the Jumperless to scan through each row, then pause for 3 seconds when it reads GND somewhere. This is about as fast as it can go right now (~170mS) but I'm working on making it faster.