Sunday is a good day for a question about SD

Admit I am a Neanderthal code writer but… (Neanderthal code. Go at it with a BIG club)

I have a G130 Dev Board 1.2 that is giving me a fit with the SD card.
NO, I am not blaming the board as it is most likely me.

Using:
RemovableMedia.Insert += new InsertEventHandler(RemovableMedia_Insert);
RemovableMedia.Eject += new EjectEventHandler(RemovableMedia_Eject);

This occurs with a SD Card already inserted at Program Start.

When I mount the SD I receive multiple RemovableMedia_Insert events.
Sometimes two and I have seen as many as 6 in a row.


 //SDCARD Events - After Mounted
 SD = new SDCard();
 if (!SD.Mounted)
 {
       SD.Mount(); //Receive RemovableMedia events on mounting
 }

I have added a lab quality power supply set a 12 volts DC so it should not be a power issue.

Any ideas where to start?

Have a GREAT day!

Have you tried with different brands of SD card? One time I was experiencing problems it turned out to be the card not the NEMF device.

@ Mr. John Smith -

I tried several different SD Cards…

I think I have found my problem.

I had RemovableMedia.Insert += new InsertEventHandler(RemovableMedia_Insert);

TWICE in my code.

One in Program started and I found that I had another where I set up the SD Card on a button press.
So I guess they were fighting each other.

Thanks for the reply!

@ willgeorge - I’ve found that, I don’t find the issue until I post a question on this forum. Something about the act of wanted to find out helps.