• AVR Freaks

Helpful ReplyHot!How to run a simple example of SD Card with harmony v2?

Page: < 123 > Showing page 2 of 3
Author
Nmaster88
Starting Member
  • Total Posts : 68
  • Reward points : 0
  • Joined: 2019/06/04 03:30:36
  • Location: 0
  • Status: offline
Re: How to run a simple example of SD Card with harmony? 2019/07/03 04:47:30 (permalink)
0
TS9
Hi,

I suggest..


Will it possible for you connect external Oscillator as mentioned in demo ? and Run it...


If it all works ? Then play with FRC and all...

Yes, i have a crystal SMD of 32 MHz in my PCB i can use.
EDIT: Still i didn't noticed i still had FNOSC ->FRCPLL, so i used the FRC oscillator in this test
And after that i configured the PCB to have:
REFCLKO - 8MHz
SYSCLK - 80MHz
PBCLK - 40 MHz
 
Its the same that we have on the initial example, even though it uses a POSC of 8MHz.
 
I see some activity on:
SD_CS - pulse down of about 25us
SD_DI - no activity
SD_DO - pulses of about 25us
SD_CLK - 8 sequential pulses of about 1.25us each
 
note: i removed SCK1 from Pin Settings it was on RD10, because the sdcard_fat_single_disk demo doesn't set this anywhere on Pin Settings.
 
does this make sense? The mounting of the sd card is still unsuccessful. 
 
post edited by Nmaster88 - 2019/07/04 08:49:36
#21
Nmaster88
Starting Member
  • Total Posts : 68
  • Reward points : 0
  • Joined: 2019/06/04 03:30:36
  • Location: 0
  • Status: offline
Re: How to run a simple example of SD Card with harmony? 2019/07/03 07:47:03 (permalink)
0
TS9
And what about the remaining pins? RF3,RF5 and RD10?

 
Please check attachment and change according ..


@TS9 Looking your attachment image, i see you use SDI2, SDO2 and SCK2. When i look at pin RD10 where i made da connection to SD_CLK i only have SCK1, on RG6 where you connected the SCK2 appears!
 
Can SDI1, SDO1 and SCK1 be used instead? Im guessing it doesn't matter if on DEVCFG0->ICE\ICD Comm Channel Select (ICESEL) i select ICS_PGx1
post edited by Nmaster88 - 2019/07/03 07:53:58
#22
TS9
Super Member
  • Total Posts : 802
  • Reward points : 0
  • Joined: 2010/05/07 10:52:22
  • Status: online
Re: How to run a simple example of SD Card with harmony? 2019/07/03 08:41:34 (permalink)
0
SCK1 is dedicated pin , you can't change that

But SDI1,SDO1 have PPS feature
You can change that.

Please Check Datasheet and do modifications in MHC Pin Setting
#23
TS9
Super Member
  • Total Posts : 802
  • Reward points : 0
  • Joined: 2010/05/07 10:52:22
  • Status: online
Re: How to run a simple example of SD Card with harmony? 2019/07/03 10:45:43 (permalink) ☄ Helpfulby Nmaster88 2019/07/11 00:54:04
0

Also Check SDCard Pin Out :
https://components101.com...-card-pinout-datasheet


 --TS9
post edited by TS9 - 2019/07/03 22:05:56

Attached Image(s)

#24
Nmaster88
Starting Member
  • Total Posts : 68
  • Reward points : 0
  • Joined: 2019/06/04 03:30:36
  • Location: 0
  • Status: offline
Re: How to run a simple example of SD Card with harmony? 2019/07/04 01:26:15 (permalink)
0
TS9

Also Check SDCard Pin Out :
https://components101.com...-card-pinout-datasheet


--TS9


Isn't that the datasheet from a PIC32MZ? It might be different. I'm using a PIC32MX470F512L.
 
Another thing i identified, from the pinout of sd card is that on the link, the sd card is class 4 which means a sequential write speed of 4mbs, i only have a class 10 to test, it works at 10mbs.
 
 
post edited by Nmaster88 - 2019/07/04 01:36:06
#25
TS9
Super Member
  • Total Posts : 802
  • Reward points : 0
  • Joined: 2010/05/07 10:52:22
  • Status: online
Re: How to run a simple example of SD Card with harmony? 2019/07/04 02:56:35 (permalink)
0
Nmaster88
TS9
Also Check SDCard Pin Out :
https://components101.com...-card-pinout-datasheet


--TS9

Isn't that the datasheet from a PIC32MZ? It might be different. I'm using a PIC32MX470F512L. Another thing i identified, from the pinout of sd card is that on the link, the sd card is class 4 which means a sequential write speed of 4mbs, i only have a class 10 to test, it works at 10mbs.  


Did you able to run demo?
#26
Nmaster88
Starting Member
  • Total Posts : 68
  • Reward points : 0
  • Joined: 2019/06/04 03:30:36
  • Location: 0
  • Status: offline
Re: How to run a simple example of SD Card with harmony? 2019/07/04 10:56:47 (permalink)
0
TS9
Nmaster88
TS9
Also Check SDCard Pin Out :
https://components101.com...-card-pinout-datasheet


--TS9

Isn't that the datasheet from a PIC32MZ? It might be different. I'm using a PIC32MX470F512L. Another thing i identified, from the pinout of sd card is that on the link, the sd card is class 4 which means a sequential write speed of 4mbs, i only have a class 10 to test, it works at 10mbs.  


Did you able to run demo?

Unfortunately no, it might be an hardware/SD card problem, I'm not sure.
#27
TS9
Super Member
  • Total Posts : 802
  • Reward points : 0
  • Joined: 2010/05/07 10:52:22
  • Status: online
Re: How to run a simple example of SD Card with harmony? 2019/07/04 11:07:46 (permalink)
0
Ohhhh!!!!

What is exact problem in your hardware. ?

I have checked this demo with
8 GB ,16 GB and 32 GB Scandisk and Samsung micro SD Cards
#28
Nmaster88
Starting Member
  • Total Posts : 68
  • Reward points : 0
  • Joined: 2019/06/04 03:30:36
  • Location: 0
  • Status: offline
Re: How to run a simple example of SD Card with harmony? 2019/07/05 01:26:44 (permalink)
0
TS9
Ohhhh!!!!

What is exact problem in your hardware. ?

I have checked this demo with
8 GB ,16 GB and 32 GB Scandisk and Samsung micro SD Cards

To know if there is signal on the four pins, i configured the pins of SD_DO, SCCLK, SD_DI and SD_CS as GPIO as OUT and toggled them on a while loop. I confirmed that an oscillating signal is happening on all them.
 
Then configured, again, the PIN Settings:
Pin nº | Pin ID |  Name | Function
50      | RF5    |  SDO1  | SDO1
51      | RF3    |  SDI1  | SDI1
70      | RD10  |  SCK1  | SCK1
 
about the SDCS pin its configured in SD Card driver on chip select port as PORT_CHANNEL_F and PORTS_BIT_POS_12.
 
I've configured both SD CARD and SPI with the same speed. Tried 1000000,10000000 and 20000000.
It never mounts with success.
I took some shots of the oscilloscope, i don't remember now the frequency, but probably 20MHz,
only SD_DI did't had a signal, it was always high.
 
What i think that might be creating problems:
-Maybe inside the SD Card connector the pins are not making good contact with the SD Card;
-It's an SD Card problem;
-Its supposed to be a signal on SD_DI and there is none, its always high (i guess this is the answer from the sd card, in that case i think it's ok);
-The signal on SCLK is not good, it seems to have some spikes(?);
-Didn't found the correct frequency to work with the SD Card/SPI;
-On System Service -> File System it has a check on FAT File System, the SD Card is formatted has FAT32, maybe this is imconpatible;
-On SYS_FS_Mount as first arg i have "/dev/mmcblka1" my sd card has only one partition with the label D: is this correct?
 
 
post edited by Nmaster88 - 2019/07/05 03:45:54

Attached Image(s)

#29
TS9
Super Member
  • Total Posts : 802
  • Reward points : 0
  • Joined: 2010/05/07 10:52:22
  • Status: online
Re: How to run a simple example of SD Card with harmony v2? 2019/07/05 04:19:04 (permalink)
0
Hello,
 
Please check screenshots ..Attached screenshots will helps you to diagnose hardware and software problem.
 
1) PIC32MZ_FOR_COMPARISION_PIC32MX470   :   Schematic PIC32MZ <-> SDmicroCARD
2) PIC32MX470F512L_SDCARD_Nmaster88         :   Harmony Generated Code .<Demo should work by following these steps>
3) SDCard_Symbol_Nmaster88                             :   PCB Footprint <---> Schematic
4)  SDCard_Image_Nmaster88                              :   Physical Image of Connectors
 
--
TS9

Attached Image(s)

#30
Nmaster88
Starting Member
  • Total Posts : 68
  • Reward points : 0
  • Joined: 2019/06/04 03:30:36
  • Location: 0
  • Status: offline
Re: How to run a simple example of SD Card with harmony v2? 2019/07/05 07:03:29 (permalink)
0
TS9
Hello,
 
Please check screenshots ..Attached screenshots will helps you to diagnose hardware and software problem.
 
1) PIC32MZ_FOR_COMPARISION_PIC32MX470   :   Schematic PIC32MZ <-> SDmicroCARD
2) PIC32MX470F512L_SDCARD_Nmaster88         :   Harmony Generated Code .<Demo should work by following these steps>
3) SDCard_Symbol_Nmaster88                             :   PCB Footprint <---> Schematic
4)  SDCard_Image_Nmaster88                              :   Physical Image of Connectors
 
--
TS9


I might have found the problem, i was configuring SDI for CMD(DI) pin, and SDO for DAT0(DO) pin of SD Card.
 
Now i'm having problems configuring RF5 as SDI1 and RF3 as SDO1. It generates bad code... how unlucky i am.
 
(In attach i leave an image of what happens)
 
If i correct this by hand it says OUTPUT_PIN_RPF3 doesnt exist.
PLIB_PORTS_RemapOutput(PORTS_ID_0, OUTPUT_FUNC_SDO1,  OUTPUT_PIN_RPF3);
 
post edited by Nmaster88 - 2019/07/05 07:04:35

Attached Image(s)

#31
TS9
Super Member
  • Total Posts : 802
  • Reward points : 0
  • Joined: 2010/05/07 10:52:22
  • Status: online
Re: How to run a simple example of SD Card with harmony v2? 2019/07/05 07:44:17 (permalink)
0
Are you sure you have selected
PIC32MX470F512L ?
#32
Nmaster88
Starting Member
  • Total Posts : 68
  • Reward points : 0
  • Joined: 2019/06/04 03:30:36
  • Location: 0
  • Status: offline
Re: How to run a simple example of SD Card with harmony v2? 2019/07/05 07:47:02 (permalink)
0
TS9
Are you sure you have selected
PIC32MX470F512L ?

Yes i did, on the combobox i have pic32mx470_pim_e16_int_dyn.
Why? With me it gives error. Maybe i will need to start a clean project...
#33
TS9
Super Member
  • Total Posts : 802
  • Reward points : 0
  • Joined: 2010/05/07 10:52:22
  • Status: online
Re: How to run a simple example of SD Card with harmony v2? 2019/07/05 07:56:58 (permalink)
0
Just use fresh project sdcard_fat_single_disk..

Then do modifications as I suggested one by one .
Click On Generate..
#34
TS9
Super Member
  • Total Posts : 802
  • Reward points : 0
  • Joined: 2010/05/07 10:52:22
  • Status: online
Re: How to run a simple example of SD Card with harmony v2? 2019/07/05 07:56:58 (permalink)
0
Just use fresh project sdcard_fat_single_disk..

Then do modifications as I suggested one by one .
Click On Generate..
#35
Nmaster88
Starting Member
  • Total Posts : 68
  • Reward points : 0
  • Joined: 2019/06/04 03:30:36
  • Location: 0
  • Status: offline
Re: How to run a simple example of SD Card with harmony v2? 2019/07/05 08:20:18 (permalink)
0
I think the problem is found, i'm using the PIC32MX470F512L and the pin RPF3 doesn't seem to be compatible with the 100pin case only the 64pin variant... 
 

Attached Image(s)

#36
TS9
Super Member
  • Total Posts : 802
  • Reward points : 0
  • Joined: 2010/05/07 10:52:22
  • Status: online
Re: How to run a simple example of SD Card with harmony v2? 2019/07/05 08:28:05 (permalink)
0
Nmaster88
I think the problem is found, i'm using the PIC32MX470F512L and the pin RPF3 doesn't seem to be compatible with the 100pin case only the 64pin variant...  


I have Used PIC32MX470F512L
And can able to use. RPF3 and RPF5

Strange... Which MCU you are using ?

I think you are making a school project..Is it?
post edited by TS9 - 2019/07/05 08:30:08
#37
Nmaster88
Starting Member
  • Total Posts : 68
  • Reward points : 0
  • Joined: 2019/06/04 03:30:36
  • Location: 0
  • Status: offline
Re: How to run a simple example of SD Card with harmony v2? 2019/07/05 08:59:41 (permalink)
0
TS9
Nmaster88
I think the problem is found, i'm using the PIC32MX470F512L and the pin RPF3 doesn't seem to be compatible with the 100pin case only the 64pin variant...  


I have Used PIC32MX470F512L
And can able to use. RPF3 and RPF5

Strange... Which MCU you are using ?

I think you are making a school project..Is it?

I check now on System Services -> Ports -> Use Ports System Service? -> Port Configuration Settings -> PPS Output Configuration and for function OUTPUT_FUNC_SDO1 there is no OUTPUT_PIN_RFP3.
 
In datasheet it says "2: This selection is only available on 64-pin General Purpose devices."
#38
TS9
Super Member
  • Total Posts : 802
  • Reward points : 0
  • Joined: 2010/05/07 10:52:22
  • Status: online
Re: How to run a simple example of SD Card with harmony v2? 2019/07/05 09:12:17 (permalink)
0
But I can use RPF3 ,RPF5
In 100 Pin device then able to generate code successfully and build successfully.

And Send Screenshots to you ..as previous post.
#39
TS9
Super Member
  • Total Posts : 802
  • Reward points : 0
  • Joined: 2010/05/07 10:52:22
  • Status: online
Re: How to run a simple example of SD Card with harmony v2? 2019/07/05 09:32:21 (permalink)
0
Deleted
post edited by TS9 - 2019/07/05 21:46:47
#40
Page: < 123 > Showing page 2 of 3
Jump to:
© 2019 APG vNext Commercial Version 4.5