Arduino Pro Mini SPI Slave problem

Hello Arduino Gurus

I have a little problem with the Arduino Pro Mini (16Mhz/5V), I will try to dump all the info in the question to help get this done with the least effort from you guys

I am trying to use it as an SPI slave, but the results are not as expected, I am testing it with the code from http://www.gammon.com.au/spi in the "How to get a response from a slave" section.

When i replace the Arduino pro mini with an Arduino UNO, things work perfectly, when i use the Arduino pro mini, I get the same results of the addition for both addition and subtraction (As shown in the photo).

So i hooked up a Logic Analyzer, and what i get is that pin 10 is on logic low all the time, never goes high, hence, the slave never teats the command to subtract as a command, and the letter S falls through the switch statement with no action. (results are the same whether the interrupt Pin 2 is tied/connected to pin 10 or not)

I have tried several pro mini boards, from different clone manufacturers, they all have the same problem, I have checked continuity from pin 10 to it's corresponding pin on the chip with a multi-meter, and it in indeed connected (if it were not connected, it would have gone high since that works without the board, but the point is that it is connected directly to the correct corresponding pin).

the workarounds with a constantly active SS pin won't work for me as I need to use multiple slaves.

I have a couple of hundreds of those pro mini boards that i got from several places online for a project, So i am looking for a workaround that allows me to make use of the boards i have.

As you would expect, I have a common ground, and everything that i am aware of to allow SPI communication, it works with the UNO and the wires are simply moved to the pro mini to get that problem, so it is unlikely that the problem is with the connections, but i have taken a photo of the breadboard to help assure you that this is the case

Out of completion (probably useless information), the master is an Arduino mega pro embed, pin 10 on the pro mini slave is connected to pin D9 on the master, but it used to be connected to the standard D53 before, and it made no difference (The code was obviously modified by switching SS to 9). the extra bunch of wires you see are connected to the logic analyzer.

Thank you in advance

prom_serial.jpg

prom_serial.jpg

yazeed1:
As you would expect, I have a common ground, and everything that i am aware of to allow SPI communication, it works with the UNO and the wires are simply moved to the pro mini to get that problem, so it is unlikely that the problem is with the connections, but i have taken a photo of the breadboard to help assure you that this is the case

As the Pro Mini and UNO use the same processor, ATmega328, the code and pin functions are the same.

So logic would suggest that the problem is indeed one of how the two are wired and powered.

Thank you for this prompt response srnet

The master (not the problem) has been powered by the USB cable all along, the pro mini in this photo has been powered by the FTDI adapter form the same PC, with a common ground as you can see, I have also tried to power it from the mega's 5V pin to it's VCC pin with the FTDI unplugged from the pins, but nothing seems to make a difference.

I have tried powering the UNO in both ways as well, and it seems to work in both cases, the UNO always works, and the pro mini always fails

When switching to the uno, all i am doing is moving ALL the pins from the pro mini and connecting them to the UNO, and then it works perfectly

A reminder, those are clone boards from different clone board manufacturers, but none of them comes from sparkfun, boards from banggood, aliexpress, and other providers, the boards have white, red, and gold reset buttons, in addition, the ones with the gold button have a reverse order for the FTDI pins so i am assuming they are from different manufacturers

Can anybody try to replicate my results with an authentic sparkfun board ? or even validate my finding by replicating the results i have on a clone board ?

UPDATE: I found one old pro mini board (not from any of the 4 batches i got online), It's a few years old, (also a clone board) that works perfectly. It is an 8Mhz 3.3V board, but i ran it on 5V (Both power and Logic), it works just fine.

So now that we know it is a hardware issue with my specific clones (from popular retailers :S), and not an issue specific to the PRO MINI, can anyone think of something to work around the problem on those new boards, i would really rather not throw out 500 dollars worth of microcontrollers. :frowning:

Thank you in advance

Check the schematics of the UNO and Pro Mini, as far as the SPI pins are concerned the circuit is identical.

You seem to be suggesting that Arduino pin 10 on some ATmega328s behaves or needs configuring differently to other ATmega328s, which of course makes no sense at all.

Maybe you have a big pile of fake ATmega328s.

Thank you srnet

Yes, i was suggesting the clone boards had fake ATMegas, and was looking to see if there is a workaround.

but it turned out I made a very silly mistake

the soldered pins on the end of the ATMEGA are on the same row as pin 10, so 10, A6 and A7 were connected to ground

Once the chip is removed from the breadboard, it works perfectly

sorry for wasting your time :frowning:

yazeed1:
but it turned out I made a very silly mistake

We all make mistakes, it happens all the time.

However in order to solve problems we need to accept we do make made mistakes and not go forward on the basis of 'it is unlikely that the problem is with the connections'.

I agree

Again, thank you for your time and your help and patience and the knowledge and expertise you try to share

Have a wonderful day/evening

Yours
Yazeed

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.