Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 15:04 07 Jul 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Reading SD card.

     Page 2 of 3    
Author Message
Phil23
Guru

Joined: 27/03/2016
Location: Australia
Posts: 1667
Posted: 10:20pm 26 Aug 2016
Copy link to clipboard 
Print this post

  Phil23 said  
Really has me wondering if it's something hanging over from when I configured it for LED_A on pin 12.


After Just re-flashing it to 5.1 then back to 5.2 & configuring again, I can confirm that the above is not the case.

Cheers.
 
Phil23
Guru

Joined: 27/03/2016
Location: Australia
Posts: 1667
Posted: 11:39am 28 Aug 2016
Copy link to clipboard 
Print this post

Still not having any luck with this.
Revisited it this morning....

Basically no SD card I have will work.

Checked for shorts & dry joints as per matherp's suggestion & none found.
Re-soldered pins just in case.

Tried the SD card on the display;
Reconfigured for no CD, no change.
Full size card, 32Gig SDHC, Class 10 that just happened to be sitting by the laptop.

Some occasions return "Unable to Access SD Card", other occasions it writes to the card & touch is lost.

Tried the same card, display & code on the E100 this morning;
100% reliable; can't get a failure.

Test portion of the Pump Demo is changed a little for feedback:-

[Code]Case pb_test ' the alarm test button
CtrlVal(led_alarm) = 1
GUI beep 250

Open "Test.txt" For Append As #1
Print "File Opened"
Print #1, "Hello World", Time$
Print "Hello World", Time$
Close #1
Print "File Closed"
[/code]

Can hit the "Test" button multiple times & all records written are present on the card.

Curious if the experiences Geoff mentions are on the E64 or other chips as well.

Cheers

Phil.
 
Phil23
Guru

Joined: 27/03/2016
Location: Australia
Posts: 1667
Posted: 01:10pm 28 Aug 2016
Copy link to clipboard 
Print this post

Hi all,

I don't really understand what goes on inside these chips.
Only that there's different capabilities on each pin & that they seem to be in groups internally; the RA, RB, RC designations etc.

Thing I noticed between the E64 & E100 is the capabilities on some of the pins used is different.

I won't even pretend to know what SOSC1 & USBID mean; just an observation that other might see as relevant or not.





Cheers

Phil.
 
Phil23
Guru

Joined: 27/03/2016
Location: Australia
Posts: 1667
Posted: 02:15pm 28 Aug 2016
Copy link to clipboard 
Print this post

Just noticed a strange anomaly...

Touched the test button 1/2 a dozen times and I didn't loose the touch;
No Changes;
But no data written to the card;
Which means the IRQ sub wasn't run;
Card was inserted correctly;
All GUI objects stayed active.
Even touched the Test button a few time with the card out;
GUI Stayed active, AND it didn't abort the code as expected due to no card present.
Also indicating that the IRQ really wasn't being triggered.

BUT, the USB port was in that state where you can't connect to it with MMchat or Teraterm.

Com12 in my case, & it was present in Device Manager.

Will try & reproduce it.

Still using the USB on the E64.
USB power to the MM; separated 3.3V supply to the display.

Have also tried running it with no USB connection at all, just powering the MM with 5V in, & still the same failure.

Phil.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10215
Posted: 09:05pm 28 Aug 2016
Copy link to clipboard 
Print this post

Phil

Can you post a complete program and any associated files for the SD card. Please provide clear explanations of exactly what you are doing when the problem occurs and then I'm sure one of us can try and replicate. If there is a firmware bug it always helps Geoff to provide the simplest possible program that demonstrates the problem. The 100-pin and 64-pin do have different pin usage so it is not impossible that there is an interaction on the 64 that does not exist on the 100.

Please make the demo program as simple as possible
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2932
Posted: 09:53pm 28 Aug 2016
Copy link to clipboard 
Print this post

Phil,

In your list of 'steps' you mention 'card was inserted'. And at the end you say the issue is you lost comms with your computer.

All this on an E64. Which PCB version? IF it is 1C then do you have the MCP120 supervisor reset device inserted? If you do, then this is your issue I reckon!

Try disconnect the RST pin on the MCP and all will work fine.

I may have missed your point here, but high level reading points to the above MCP 'issue'

WW

EDIT: I see you have other issues you are trying to 'fix'; but would be interested to know if you have the same issue with the MCP120 removed (or at least it's RST pin)Edited by WhiteWizzard 2016-08-30
 
Phil23
Guru

Joined: 27/03/2016
Location: Australia
Posts: 1667
Posted: 12:42am 29 Aug 2016
Copy link to clipboard 
Print this post

  matherp said   Phil

Can you post a complete program...

Please make the demo program as simple as possible


Hi Peter,

When I originally struck the problem in my own code, I reverted to Geoff Pump Demo,
page 36.

I added a print line to print the switch position to the console, for feed back.
Line 90.

For testing writing to the card, I added lines to the Case statement for the alarm test button.
Lines 94-103.

[Code]Case pb_test ' the alarm test button
CtrlVal(led_alarm) = 1
GUI beep 250

Open "Test.txt" For Append As #1
Print "File Opened"
Print #1, "Hello World", Time$
Print "Hello World", Time$
Close #1
Print "File Closed"
[/code]

Pressing the test button should open the file, "Test.txt", and append "Hello World" & the date; then close the file. this also reports to the console.

Both E64 & E100 are using the USB on the board. Both have RTC's.

Full code below.
Simply adds another line to Test.txt every time the test button is pressed.

Thanks

Phil.




2016-08-29_103249_Pump_Control_Demo_-_For_SD_Test.zip
 
Phil23
Guru

Joined: 27/03/2016
Location: Australia
Posts: 1667
Posted: 01:13am 29 Aug 2016
Copy link to clipboard 
Print this post

  WhiteWizzard said  In your list of 'steps' you mention 'card was inserted'. And at the end you say the issue is you lost comms with your computer.[/quote]

To put it in literal terms.

I decided to give up on playing with cards this morning & restore my monitoring code to the E64.

I'd power cycled, reset, & so on.

Opened MM edit to reload the code I wanted in there & it couldn't find Com12, that expected sitution you can get with the USB where it needs to be unplugged & reconnected.

As I was about to reconnect the USB connection to get the com port going I decided to give the screen a poke, I could press the Test button repeatedly without losing touch functionality.

I then removed the SD card to check the results, that's when I realised the GUI was responding but wasn't triggering the interrupt.


[Quote]Which PCB version?[/quote]

Can't actually see the version number at the moment.

It's one that doesn't have a jumper to remove USB power.
I purchased it from you earlier this year, fully assembled.
Think it shipped with a Beta 5.2.
It reported MM.Ver 5.02 & it was before the official release.
Purchased April maybe? (Can't see the record ATM).


Phil.
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9590
Posted: 01:31am 29 Aug 2016
Copy link to clipboard 
Print this post

PCB version is 1B if there is no USB jumper - J1. It should be this one here:







This version of the PCB does NOT have the supervisory IC on the PIC32 MCLR line, so it won't be interfering with the SD card operation. At least we can rule that out.

Watching this thread. Have been reading all your posts Phil, and others. If I have any suggestions, I will chime in, but at the moment I am stumped. If you really can't get any joy out of this one, PM me and I will arrange to send you another one - where I have tested the SD card fully first.

The only thing I can suggest to check is that the soldering is OK on all the pins to the uSD socket - perhaps the solder has not correctly flowed there or something.


Smoke makes things work. When the smoke gets out, it stops!
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10215
Posted: 03:30am 29 Aug 2016
Copy link to clipboard 
Print this post

Phil

Just run your program on my 64-pin backpack

OPTION LCDPANEL SSD1963_5,L
OPTION TOUCH 51,33,21
OPTION SDCARD 52

The SD card writes and touch both work until I get bored

Looks like some sort of problem on your explore64
 
Phil23
Guru

Joined: 27/03/2016
Location: Australia
Posts: 1667
Posted: 10:22am 29 Aug 2016
Copy link to clipboard 
Print this post

  matherp said   Phil

Just run your program on my 64-pin backpack

OPTION LCDPANEL SSD1963_5,L
OPTION TOUCH 51,33,21
OPTION SDCARD 52

The SD card writes and touch both work until I get bored

Looks like some sort of problem on your explore64


Hi Peter,

Difference I see to my own case is:=

[Code]OPTION LCDPANEL SSD1963_5, LANDSCAPE
OPTION TOUCH 51, 33, 50
OPTION SDCARD 12[/code]

for the full sized card on the display;
Or
OPTION SDCARD 12, 14

When using the MicroSD on the MM's board.


I have now tried moving a few connections around;
Still no Successful outcome.

So that should eliminate some hardware level issues.


OPTION SDCARD 55
OPTION TOUCH 51, 21, 50
OPTION TOUCH 18, 21, 50

[Quote]Looks like some sort of problem on your explore64[/quote]

Looking that way.

I also have 2 CGmicroboard2's here, one with an IL9341 display & a scaled down version of the pump demo.

Will try the same on that later & expect it will be successful.


Thanks

Phil.
 
Phil23
Guru

Joined: 27/03/2016
Location: Australia
Posts: 1667
Posted: 10:40am 29 Aug 2016
Copy link to clipboard 
Print this post

  Grogster said   PCB version is 1B if there is no USB jumper - J1. It should be this one here:



[/quote]

That's the one Grog.

[Quote]Watching this thread. Have been reading all your posts Phil, and others. If I have any suggestions, I will chime in, but at the moment I am stumped. If you really can't get any joy out of this one....[/quote]

Yes not a lot of joy.
Also can't get TwoFingers AT24C32 routines to run with stability, although they work fine on all my 28 Pinners & I think??? I also tried the E100 with success.


[Quote]The only thing I can suggest to check is that the soldering is OK on all the pins to the uSD socket - perhaps the solder has not correctly flowed there or something.[/quote]

Will try & have a look; fish out the old Russian stereo microscope from the loft....
Would that issues be dismissible by the same problem with the external card on the display?

I can read & write to the cards, it's the touch loss that's the key condition maybe.

Phil
 
Phil23
Guru

Joined: 27/03/2016
Location: Australia
Posts: 1667
Posted: 12:55pm 29 Aug 2016
Copy link to clipboard 
Print this post

Just tried this no one of the CGmicroboard2's I have.

Used the Pump Control demo that I monified for the 320x240 display.
Added the test code to the alarm test button.

First attempt just worked fine; can't get it to fail.

As Peter did, I got bored pressing the button.

Zero Failure.


Cheers

Phil.
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9590
Posted: 05:26pm 29 Aug 2016
Copy link to clipboard 
Print this post

Sounds suspiciously like a crook unit you have there.

If you PM me or email me, I will arrange to send you a newer 1C version free.

Strange......
Smoke makes things work. When the smoke gets out, it stops!
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2431
Posted: 06:06pm 29 Aug 2016
Copy link to clipboard 
Print this post

possibly not related, and i've only briefly dipped into this thread, but...

i have found that when using a netbook (presumbaly same for a laptop) that when the netbook is running from the AC mains adaptor, an attached micromite becomes very sensitive to being touched.

the reason for this is that most AC adaptors do NOT pass through a ground connection, leaving netbook and micromite floating up in the air at half mains voltage. there is NO current behind this voltage, so no safety risk, but the PIC32 is quite sensitive/vulnerable when in this electrical 'location'.

for myself, i just unplug the AC (the netbook runs for 6 hours on batteries). others may have success with a bonding wire from computer to a good ground connection.


cheers,
rob :-)
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1114
Posted: 10:15pm 29 Aug 2016
Copy link to clipboard 
Print this post

Phil,
I recently had a touch calibrate problem and it turned out to be a dry joint in the spi do line at the 470 chip. Looked fine even with a microscope but at Peter's suggestion, I decide to gently touched the pins with a hot iron - fixed. May net be related buts sounds like a h/w problem.
panky.

... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2932
Posted: 10:40pm 29 Aug 2016
Copy link to clipboard 
Print this post

I was suspecting pin 12 (as you were) but this has been eliminated with what you have posted above.

One question, is the SD card / Touch issue occurring on either SD socket, or only on one socket?

Worth running an iron around the PIC pins as panky suggests as I can't see it being anything else.

WW
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4036
Posted: 02:41am 30 Aug 2016
Copy link to clipboard 
Print this post

  robert.rozee said  i have found that when using a netbook (presumbaly same for a laptop) that when the netbook is running from the AC mains adaptor, an attached micromite becomes very sensitive to being touched.

the reason for this is that most AC adaptors do NOT pass through a ground connection, leaving netbook and micromite floating up in the air at half mains voltage. there is NO current behind this voltage, so no safety risk, but the PIC32 is quite sensitive/vulnerable when in this electrical 'location'.

for myself, i just unplug the AC (the netbook runs for 6 hours on batteries). others may have success with a bonding wire from computer to a good ground connection.


cheers,
rob :-)


hmmmm.... doesn't it point to a problem other than that?

I'm not sure exactly what but for example something not tied up / down / driven appropriately / etc.

I'm thinking the PIC32 board should cope with such stray signals...

John
 
Phil23
Guru

Joined: 27/03/2016
Location: Australia
Posts: 1667
Posted: 11:34am 30 Aug 2016
Copy link to clipboard 
Print this post

  panky said   Phil,
I recently had a touch calibrate problem and it turned out to be a dry joint in the spi do line at the 470 chip. Looked fine even with a microscope but at Peter's suggestion, I decide to gently touched the pins with a hot iron - fixed. May net be related buts sounds like a h/w problem.
panky.


Thanks,

I gave that a try last night.

A couple of bottles of "Flux"; (Read Beer), to steady the hand.

Smallest tip I have is 0.8mm, but I was able to see that it was reworking each joint.
Still no change.

Phil.
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2932
Posted: 11:44am 30 Aug 2016
Copy link to clipboard 
Print this post

  WhiteWizzard said  One question, is the SD card / Touch issue occurring on either SD socket, or only on one socket?


Any clues here?
 
     Page 2 of 3    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025