1

I have a project where I have three pins to use and I just realized it would be better to use a memory card than replacing the code each time.

I'm building a Arduino with a push button. Press the button and it sends keystrokes to the connected computer with login details.
The login details need to change every three months so having that on a memory card will be easier.

So since I use a digispark Attiny 85 with a total of 6 pins (where two is used to send the keystrokes).
I have one to the push button, and three pins left.

Is there any card reader that can work with three pins? I only need to read if that makes a difference.
The ones I find use four pins (+ vcc and gnd).

Pretty much any memory card type is ok.

2

Not with an ATTiny85, and not with so few pins, no.

However, all is not lost.

The ATTint85 has 512 bytes of EEPROM inside it where you can store your login details. All you need is some way of telling setting that data in your sketch from the PC - and the simplest way is probably through a USB serial connection.

If you don't have a serial connection available (I think Digispark has a custom interface they use) then you can use whatever interface you have available to do the job.

| improve this answer | |
  • 512 bytes is enough! Interesting! Is this fool proof? It's supposed to be normal people that does this. Not programmers or in any way tech savvy people. – Andreas Nov 29 '19 at 18:55
  • Yes, it's foolproof. Not sur ewhat libraries are available for the attiny85, but the Arduino has the EEPROM library bundled with it... – Majenko Nov 29 '19 at 19:08
  • I found this youtu.be/U9HEov6dDB8 not sure if it will work with digispark boards, but I will try it when I get them. – Andreas Nov 30 '19 at 5:55
1

SD cards work with SPI. This needs only one pin per device (SlaveSelect) but 3 pins for the other common signals ( MISO / MOSI / SCK )

Card reader modules simply do some voltage level shifting (if at all).

But, you need a lot of RAM to work with SD cards, as data transfer always happens in 512 byte "sectors". With a file system, you need at least two such blocks in parallel. An attiny85 is simply too small.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.