MOSI Pin is Broken can I reconfigure a different pin as MOSI?

Hello folks,

Clarification: I am working with 4 different arduino uno wifi dev ed boards. On top of the esp I am working with an NRF24L01+ chip, and that is where my problem lies. One of the boards (the others are fine) has an issue with pin 13 (MOSI hardset) being burned out or not functioning (won’t light an LED and no RF24 functionality on that arduino). I have tried using the ICSP MOSI as well but it doesn’t seem to work for the NRF24L01.

So, my question is can the SPI.h or arduino hardware pin layout be changed to use a different pin for MOSI instead?

Thanks in advance,
CIL

More information:
I am working with the RF24mesh library by TRMh20.
The project program is already created and functions with all 3 other boards, just the last board is needed and I’m trying to avoid buying a new one.
I am not using the on-board ESP of the Uno Wifi boards as they do not function the same as an external ESP would, and the flashing serial1 method does not work on my board version.

can the SPI.h or arduino hardware pin layout be changed to use a different pin for MOSI instead?

No, this is fixed in the hardware of the chip.

You could bit bang the SPI protocol but it will be about 8 times slower than the hardware.

Hi

If it's one of these boards:-

Then it should be easy to replace the ATmega 328P chip with another one purchased from somewhere like Amazon, e-Bay or Banggood for a couple of pounds/dollars (it is worth paying a few pence/cents to get one with the arduino bootloader pre-installed).

By the way MOSI is pin 11, MISO is pin 12 and SCLK is pin 13 they are routed directly to the 328P pins 17, 18 and 19 respectively. It would be worth buzzing out your faulty board to ensure it's not a damaged track/faulty header socket that's causing your problem.

Ian

A quick Google for "arduino uno wifi dev ed board" shows me a whole lot of different boards. Which exact board do you have? URL link please.

On the AVR-based Arduinos (UNO and others) this hardware pin is not reassignable. On some Arduino-compatible devices such as the Teensy 3.x series, you can reassign MOSI to a different (fixed) pin. On the ESP-based devices, I believe that it's all software SPI and it doesn't care which pin.

It may not be burned out. There may just be a fragment of solder or wire bridging the exposed metal parts. Look very closely with a magnifying glass. You may find there's a fine whisker of metal which can be removed.

IanCrowe:

Then it should be easy to replace the ATmega 328P chip with another one

By the way MOSI is pin 11, MISO is pin 12 and SCLK is pin 13 they are routed directly to the 328P pins 17, 18 and 19 respectively.

That would be the board I'm using. And I mean the SCLK. I don't think changing the ATmega 328P chip would work but I'll look into it.

I'm not sure what you mean by buzzing out, but I've followed the track direct issues or anything with the physical pin itself based on visual inspection.

I tried the SCLK on the ICSP and the Pin 13 using a known working NRF24L01+ board and the RF24 test program and other known working programs.

I also tried a program using pinMode(13, OUTPUT) and digitalWrite(13, HIGH) but that produces no output voltage.

As for the person wondering about the board, it is a 2015 Arduino.com product that looks as shown in the picture above. Arduino Uno Wifi Dev Ed is an Arduino Uno with a built in I2C to ESP8266.

"Buzzing out" refers to using a multimeter or tester which has a buzzer or beeper setting. When you touch the probes to the ends of a wire the tester will beep to show that the wire is intact. If the wire has a break (like burned out) then it won't beep.

Buy a multimeter. You can get an adequate one for under $4 in the USA.

If you have the 328P chip on a socket like that photo then it should not be hard to identify which pin is the one connected to the Arduino pin 13. Then see if you can get a beep from your tester connected to the chip's pin and the Arduino position 13.

That pin also has an LED attached to it on the UNO board. That LED may be what's burned out. Do you get a beep between pin 13 and ground when it's off and unplugged? Try to desolder the LED and its associated components to remove them from the board.

"That pin also has an LED attached to it on the UNO board. " No, the pin connects to an LM358, which then drives the LED.

"I tried the SCLK on the ICSP and the Pin 13 using a known working NRF24L01+ board and the RF24 test program and other known working programs.

I also tried a program using pinMode(13, OUTPUT) and digitalWrite(13, HIGH) but that produces no output voltage."

Sounds like you fried the pin. Does the '328P feel warm or hot to the touch?

CIL: That would be the board I'm using. And I mean the SCLK. I don't think changing the ATmega 328P chip would work but I'll look into it.

I'm not sure what you mean by buzzing out, but I've followed the track direct issues or anything with the physical pin itself based on visual inspection.

I tried the SCLK on the ICSP and the Pin 13 using a known working NRF24L01+ board and the RF24 test program and other known working programs.

I also tried a program using pinMode(13, OUTPUT) and digitalWrite(13, HIGH) but that produces no output voltage.

As for the person wondering about the board, it is a 2015 Arduino.com product that looks as shown in the picture above. Arduino Uno Wifi Dev Ed is an Arduino Uno with a built in I2C to ESP8266.

I take it that running the Blink sketch from examples does not flash the on-board led (this should test pin 13)?

The ATmega 328P is the large 28 pin chip in the bottom right of the image. It is easy to replace as they have put it in a socket. All you need to get it out is a small screwdriver and a little patience. Pin D13 on the arduino connector is wired directly to pin 19 on the 328P (pin 1 is at the top right as you look at the image and numbering goes anti-clockwise from there until you get to pin 28 at the bottom right). It is connected to the onboard led (labelled L on the silk screen) via a LM358 op-amp buffer to avoid loading the pin.

Ian

Blink should blink the on-board LED. If it doesn't, either arduino-pin 13 (physical pin 19) is damaged internally, or there's damage elsewhere on the board (the opamp that buffers line 13 is easy to blow, but usually doing that breaks other things more catastrophically)