Reading info from one device to another

I am trying to make a cartridge based system that will need to do a couple of things and was wondering about the feasibility.

I want to have the primary device use an edge connector to accept cartridges that contain data. The primary device will have an OLED display that will need to display information from the cartridge. There will be different cartridges with different information on each one, like a game console but much more simple.

So for example you plug in cartridge A, and on the oled screen it will say things pertaining to cartridge A, like "You have inserted cartridge A".

What would be the best way to go about doing this, and is it even possible? Thanks for any guidance!

What are these cartridge devices?

Explain more. Are you wed to cartridges? Have you considered RFID?

Can the "cartridges" be SD cards?

...R

well the cartridge would essentially just be another PCB that has the points connected to the motherboard via the edge connector. So think of the cartridge as just being a part of the primary pcb that can be removed and swapped out with another cartridge that has different code on it. So the user can swap out these cartridges and have the display read out different things depending on what cartridge is connected to the pcb.

Think old school cartridge based video games.

I was thinking there could be an arduino on the motherboard, and an arduino on the cartridge, that communicate via I2C, but I cant find any info about sending strings through the wire protocol.

I am open to other ideas but key to this vision is the nostalgia video game cartridge aspect.

I2C would work fine, SPI would also be good. I would suggest that you have Vcc, GND, (insert required pins for your choice of serial protocol), AND also have a pin that is connected to GND on the cartriges' side but connected to a digital input pin (with internal pullup enabled) on the motherboard side - that way the motherboard knows when you plug a cartridge in and when you disconnect one.

Make the cartridges really simple: just a couple of traces connecting different pads.

If your Arduino finds that pins 0 and 1 are connected and no others are, then it can print "Cartridge A" just fine.

Will the stuff that gets displayed be resident in the cartridge, or does the cartridge merely identify itself and that triggers the display of text associated with that cartridge, but all cartridges' texts are resident in the primary device?

(Reads like the former, but just for clarity?)

Yes.

timyoyoyo:
I was thinking there could be an arduino on the motherboard, and an arduino on the cartridge, that communicate via I2C, but I cant find any info about sending strings through the wire protocol.

I didn’t realize you were thinking of having an Arduino on the cartridge as well as on the motherboard.

With a pair of Arduinos you have many communication options, including Serial - which I think is what I would use.

However if you prefer to use SPI then sending any kind of data over SPI just requires sending it byte by byte

If you are interested in a Serial option have a look at the examples in Serial Input Basics - simple reliable ways to receive data. There is also a parse example to illustrate how to extract numbers from the received text.

The technique in the 3rd example will be the most reliable. It is what I use for Arduino to Arduino and Arduino to PC communication.

You can send data in a compatible format with code like this (or the equivalent in any other programming language)

Serial.print('<'); // start marker
Serial.print(value1);
Serial.print(','); // comma separator
Serial.print(value2);
Serial.println('>'); // end marker

…R

Power_Broker:
I2C would work fine, SPI would also be good. I would suggest that you have Vcc, GND, (insert required pins for your choice of serial protocol), AND also have a pin that is connected to GND on the cartriges’ side but connected to a digital input pin (with internal pullup enabled) on the motherboard side - that way the motherboard knows when you plug a cartridge in and when you disconnect one.

yes thats the plan! this would be the thing to trigger screen clearing when there is no cartridge plugged in.

MorganS:
Make the cartridges really simple: just a couple of traces connecting different pads.

If your Arduino finds that pins 0 and 1 are connected and no others are, then it can print “Cartridge A” just fine.

This actually is kind of a brilliant idea. The only problem would be, every time I develop a new cartridge I would have to reprogram the motherboard. I will have to think on this idea but it might make things easier.

elvon_blunden:
Will the stuff that gets displayed be resident in the cartridge, or does the cartridge merely identify itself and that triggers the display of text associated with that cartridge, but all cartridges’ texts are resident in the primary device?

(Reads like the former, but just for clarity?)

Thats exactly right! the text would live on the cartridges, along with eeprom data.

Robin2:
I didn’t realize you were thinking of having an Arduino on the cartridge as well as on the motherboard.

With a pair of Arduinos you have many communication options, including Serial - which I think is what I would use.

However if you prefer to use SPI then sending any kind of data over SPI just requires sending it byte by byte

If you are interested in a Serial option have a look at the examples in Serial Input Basics - simple reliable ways to receive data. There is also a parse example to illustrate how to extract numbers from the received text.

The technique in the 3rd example will be the most reliable. It is what I use for Arduino to Arduino and Arduino to PC communication.

You can send data in a compatible format with code like this (or the equivalent in any other programming language)

Serial.print('<'); // start marker

Serial.print(value1);
Serial.print(’,’); // comma separator
Serial.print(value2);
Serial.println(’>’); // end marker




...R

excellent, this is what I’m thinking will be the best option. One thing I’ve been looking for info on is if I use a 5v arduino as the cartridge, and a 3.3v arduino as the motherboard/reader, would I run into different voltage issues? Could I simply voltage divide the 5v down to 3.3?

The 5V arduino may have a crystal that is incompatible with 3.3v. 3.3v runs 8 MHz while 5v runs at 16MHz. It would be best if you matched the reader to the cartridge.

wolframore:
The 5V arduino may have a crystal that is incompatible with 3.3v. 3.3v runs 8 MHz while 5v runs at 16MHz. It would be best if you matched the reader to the cartridge.

The fact that the two devices run at different speeds should not matter.

But it will be important to ensure that a 5v Arduino OUPUT pin does not apply a 5v signal to a 3.3v Arduino. A voltage divider or diode circuit should be used to prevent that.

The 5v Arduino INPUT pin should have no difficulty working with a 3.3v signal

...R