A simple trick

A simple trick

I ran out of I/O pins on the PIC18F14K22 But really needed to check if a MMC (SDcard) was in the slot, to avoid long timeouts for the software to try to read it, as the system must immediately switch to EEPROM if no card is present. Now how to do this? The switch on the SDcard connector switches to ground when a card is inserted, not very useful to short some other signal for detection. Thought about it, SPI SDO (output from card is only used here for the card, not for anything else. Normally SPO is pulled up with a pullup or driven low / high by card when it responds. So...

+3.3 +3.3 | | card socket 68k 68k R2 required switch, closed | R1 | pullup by spec if card in slot | |------------------->---- SDO------ PIC input GND ----- | c | ^------------------- b NPN BC548 1k R3 S1 e Q1 | | SDO /// from card

So, when no card is in the card connector then S1 is open, Q1 conducts, and SPO is low, and PIC reads this, and knows it has to use something else than the SDCard to store data, a 24LC1025 EEPROM. When the card is inserted all becomes according to spec, and SDO is high, until activated by the card. R3 prevent the card output being shorted by Q1,

Just tested it, works great.

Reply to
Jan Panteltje
Loading thread data ...

"Jan Panteltje" schreef in bericht news:ldt9ac$i6p$ snipped-for-privacy@news.albasani.net...

Sometimes little things are great.

petrus bitbyter

Reply to
petrus bitbyter

Depending on the physical layout, I'd consider adding 1 uF from the base to ground, just for ESD resistance.

--
Dr Philip C D Hobbs 
Principal Consultant 
ElectroOptical Innovations LLC 
Optics, Electro-optics, Photonics, Analog Electronics 

160 North State Road #203 
Briarcliff Manor NY 10510 

hobbs at electrooptical dot net 
http://electrooptical.net
Reply to
Phil Hobbs

It's a bipolar device... maybe add 1K in series with the base... that ought to be more than enough protection. ...Jim Thompson

--
| James E.Thompson                                 |    mens     | 
| Analog Innovations                               |     et      | 
| Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    | 
| San Tan Valley, AZ 85142   Skype: Contacts Only  |             | 
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  | 
| E-mail Icon at http://www.analog-innovations.com |    1962     | 
              
I love to cook with wine.     Sometimes I even put it in the food.
Reply to
Jim Thompson

On a sunny day (Mon, 17 Feb 2014 18:09:24 -0500) it happened Phil Hobbs wrote in :

Right you are :-)

Reply to
Jan Panteltje

Yeah, ESD events are notorious for never jumping across resistors and never overcoming BJT VBE absmax in reverse polarity...

But being cautious, I'd add either both the bypass cap across the BE junction and a 100R series resistor (to prevent switch wear) or a BAV99 and base series resistor.

--
Thanks, 
Fred.
Reply to
Fred Bartoli

The suggested cap would have been large and perhaps pit the contacts. The diode will certainly provide insurance, but I think it's unnecessary for a typical bipolar. ...Jim Thompson

--
| James E.Thompson                                 |    mens     | 
| Analog Innovations                               |     et      | 
| Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    | 
| San Tan Valley, AZ 85142   Skype: Contacts Only  |             | 
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  | 
| E-mail Icon at http://www.analog-innovations.com |    1962     | 
              
I love to cook with wine.     Sometimes I even put it in the food.
Reply to
Jim Thompson

The voltage is low, and the number of plug/unplug cycles is almost certainly small. Also, any putative switch damage would occur only if the board were hot-plugged, which I think is unlikely.

Putting in an additional resistor is reasonable if any of the above is not true in the given application.

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs 
Principal Consultant 
ElectroOptical Innovations LLC 
Optics, Electro-optics, Photonics, Analog Electronics 

160 North State Road #203 
Briarcliff Manor NY 10510 

hobbs at electrooptical dot net 
http://electrooptical.net
Reply to
Phil Hobbs

Perhaps OK with a small number of cycles, but what does "hot-plug" have to do with it... the capacitor would be straight across the contacts. "Hot-plug" concerns the power-up of the card itself... I've done several such chips. ...Jim Thompson

--
| James E.Thompson                                 |    mens     | 
| Analog Innovations                               |     et      | 
| Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    | 
| San Tan Valley, AZ 85142   Skype: Contacts Only  |             | 
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  | 
| E-mail Icon at http://www.analog-innovations.com |    1962     | 
              
I love to cook with wine.     Sometimes I even put it in the food.
Reply to
Jim Thompson

How can I view the circuit on an IPad ?

Reply to
Gerard

Hot plugging means plugging a board into a powered-up system. In my phone, for instance, you have to remove the battery before you can plug in a CF or SIM card.

If the power is off, there's no voltage across the cap, hence no current transient.

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs 
Principal Consultant 
ElectroOptical Innovations LLC 
Optics, Electro-optics, Photonics, Analog Electronics 

160 North State Road #203 
Briarcliff Manor NY 10510 

hobbs at electrooptical dot net 
http://electrooptical.net
Reply to
Phil Hobbs

I certainly know what hot-plugging is. What kind of phone requires you removing the battery? My LG VN251 certainly doesn't. ...Jim Thompson

--
| James E.Thompson                                 |    mens     | 
| Analog Innovations                               |     et      | 
| Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    | 
| San Tan Valley, AZ 85142   Skype: Contacts Only  |             | 
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  | 
| E-mail Icon at http://www.analog-innovations.com |    1962     | 
              
I love to cook with wine.     Sometimes I even put it in the food.
Reply to
Jim Thompson

Nokia's, LG's & co. The trick is to hide the cards under the battery.

--

-TV
Reply to
Tauno Voipio

Mine comes out a slot in the side. I've only removed it once to plug it into a card reader, then realized I can read/write/delete it directly via the USB port just as if it were a drive... which it is, it comes up as Drive:J. ...Jim Thompson

--
| James E.Thompson                                 |    mens     | 
| Analog Innovations                               |     et      | 
| Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    | 
| San Tan Valley, AZ 85142   Skype: Contacts Only  |             | 
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  | 
| E-mail Icon at http://www.analog-innovations.com |    1962     | 
              
I love to cook with wine.     Sometimes I even put it in the food.
Reply to
Jim Thompson

My previous Moto (Droid RAZR) doesn't. The battery isn't user replaceable. My current Moto (Droid MAXX) fixes that problem. It doesn't have a user SIM card.

Reply to
krw

You need to find a fixed font (Courier, or such). I don't use an IPad, so no clue how to do that.

BTW, please leave some context in your post. It's a PITA, in a threaded view, to go back very far and find out what you're talking about.

Reply to
krw

I have seen a number of TracFones, from the lowly $10 talk-only thru LG types that are "internet enabled" and for them, it is a physical fact that the battery must be removed to get at the SIM.

Reply to
Robert Baer

Exactly!

Reply to
Robert Baer

If viewing form googl groups there is an option to "show original". Clicking that works.. but still adds all the d&*# extra google line feeds.

George h.

Reply to
George Herold

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.