CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

"Pointer type do not match" error MMCSD.c and FAT.
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
newguy



Joined: 24 Jun 2004
Posts: 1909

View user's profile Send private message

PostPosted: Thu Jan 09, 2020 1:21 pm     Reply with quote

dluu13 wrote:
Personally, I was never able to get the CCS FAT/SD card drivers working and I ended up buying the Brush Electronics driver. It does cost a bit, but it's easy to use and the author (asmallri on this forum) is responsive to questions.


To be honest, they're a bargain at twice the price. As temtronic is often heard to ask, "what's your time worth?"

They "just work". The $ invested in them will save you many days, if not weeks, of development time. If you contracted someone to write that driver for you, you'd be looking at a bill in the thousands.

Another hearty endorsement for Brush Electronics from me. Well worth the money.
dluu13



Joined: 28 Sep 2018
Posts: 395
Location: Toronto, ON

View user's profile Send private message Visit poster's website

PostPosted: Thu Jan 09, 2020 1:24 pm     Reply with quote

newguy wrote:
dluu13 wrote:
Personally, I was never able to get the CCS FAT/SD card drivers working and I ended up buying the Brush Electronics driver. It does cost a bit, but it's easy to use and the author (asmallri on this forum) is responsive to questions.


To be honest, they're a bargain at twice the price. As temtronic is often heard to ask, "what's your time worth?"

They "just work". The $ invested in them will save you many days, if not weeks, of development time. If you contracted someone to write that driver for you, you'd be looking at a bill in the thousands.

Another hearty endorsement for Brush Electronics from me. Well worth the money.


Well said... I wasted a bunch of time/money trying to fart around before just spending the couple hundred bucks. At this point, based on how many questions there are about it, there should be a sticky for the Brush driver :P
PeWa



Joined: 15 Jan 2019
Posts: 22
Location: Sweden

View user's profile Send private message

PostPosted: Fri Jan 10, 2020 2:30 am     Reply with quote

temtronic wrote:
OK, basic Hardware questions.... What voltage is the PIC VDD and what interface is between PIC and SD card ?


I run MCU on 3.3V and SDcard from the same 3V3 line, it is a demoboard Olimex PIC-WEB i use for different testing purposes.
Ttelmah



Joined: 11 Mar 2010
Posts: 19541

View user's profile Send private message

PostPosted: Fri Jan 10, 2020 3:12 am     Reply with quote

dluu13 wrote:
newguy wrote:
dluu13 wrote:
Personally, I was never able to get the CCS FAT/SD card drivers working and I ended up buying the Brush Electronics driver. It does cost a bit, but it's easy to use and the author (asmallri on this forum) is responsive to questions.


To be honest, they're a bargain at twice the price. As temtronic is often heard to ask, "what's your time worth?"

They "just work". The $ invested in them will save you many days, if not weeks, of development time. If you contracted someone to write that driver for you, you'd be looking at a bill in the thousands.

Another hearty endorsement for Brush Electronics from me. Well worth the money.


Well said... I wasted a bunch of time/money trying to fart around before just spending the couple hundred bucks. At this point, based on how many questions there are about it, there should be a sticky for the Brush driver :P


Put a third vote in for these. Very Happy
Ttelmah



Joined: 11 Mar 2010
Posts: 19541

View user's profile Send private message

PostPosted: Fri Jan 10, 2020 3:24 am     Reply with quote

PeWa wrote:
temtronic wrote:
OK, basic Hardware questions.... What voltage is the PIC VDD and what interface is between PIC and SD card ?


I run MCU on 3.3V and SDcard from the same 3V3 line, it is a demoboard Olimex PIC-WEB i use for different testing purposes.


The PIC web board does not have an SD card on it. So you are connecting
this to something else. Big issue then is does the card have the
reservoir capacitor adjacent to the SD card socket?. This is absolutely
vital to get SD's working. They generate really short high frequency
pulses of supply current, and if this is not handled by a low ESR capacitor
adjacent to the card, you will get issues. Also, if the card is 'off board',
you may well have to lower the SPI clock rate to have any hope of working.
Also remember the initial communications have to be done at slow speed.
400KHz maximum. Remember ths DSPIC will default to clocking the
SPI bus much faster than the PIC18.
Then getting the pattern of pull up resistors right is also vital. You need
a pull up on DAT1, DAT2, DATA_OUT, and CS. Vital to ensure the card
wakes correctly. These lines must wake pulled high.
PeWa



Joined: 15 Jan 2019
Posts: 22
Location: Sweden

View user's profile Send private message

PostPosted: Fri Jan 10, 2020 3:33 am     Reply with quote

dluu13 wrote:
One of the first things to try is to read the sticky thread in the code library about mmcsd.c and fat.c to fix the library (MBR fix) and the sticky thread about SD card in the General CCS C Discussion forum.

If you want to see if it's the hardware, one of the things you can try is to directly use functions from mmcsd.c rather than trying to use the FAT filesystem. One quick thing to check is if you get good results from mmcsd_print_cid() and mmcsd_print_csd().

Then, you can format the card to all zeros, and then start to write known numbers into memory locations that you define. Use a hex editor like HxD on your PC to view the data and make sure that you actually wrote what you expected.

If these all work as expected then it's probably something to do with the FAT code rather than your hardware.

A good resource for SD card if you want to read further is http://www.elm-chan.org/. Wikipedia is also pretty good.

Personally, I was never able to get the CCS FAT/SD card drivers working and I ended up buying the Brush Electronics driver. It does cost a bit, but it's easy to use and the author (asmallri on this forum) is responsive to questions.



Thank´s for information about Brush Electronics I did not know about them.
I will sure get a driver from them so I can get on with the project.

BR
PeWa



Joined: 15 Jan 2019
Posts: 22
Location: Sweden

View user's profile Send private message

PostPosted: Sat Jan 11, 2020 8:29 am     Reply with quote

Ttelmah wrote:
PeWa wrote:
temtronic wrote:
OK, basic Hardware questions.... What voltage is the PIC VDD and what interface is between PIC and SD card ?


I run MCU on 3.3V and SDcard from the same 3V3 line, it is a demoboard Olimex PIC-WEB i use for different testing purposes.


The PIC web board does not have an SD card on it. So you are connecting
this to something else. Big issue then is does what has the card have the
reservoir capacitor adjacent to the SD card socket?. This is absolutely
vital to get SD's working. They generate really short high frequency
pulses of supply current, and if this is not handled by a low ESR capacitor
adjacent to the card, you will get issues. Also, if the card is 'off board',
you may well have to lower the SPI clock rate to have any hope of working.
Also remember the initial communications have to be done at slow speed.
400KHz maximum. Remember ths DSPIC will default to clocking the
SPI bus much faster than the PIC18.
Then getting the pattern of pull up resistors right is also vital. You need
a pull up on DAT1, DAT2, DATA_OUT, and CS. Vital to ensure the card
wakes correctly. These lines must wake pulled high.


Ok I did not tell about how I connected the SD holder, I simply removed the EEprom from the board and hard wired SPI lines from that SO8 pads.
One other thing I had forgotten was that I used FAST_IO for B port and setting TRIS myself so I had forgotten SDO from card must have input on PIC. I also use pin_select so it is many thing that can be faulty.

I have the Brush SD software now so I am running Ok on the PIC24 i was beginning with.

Thank´s for all support
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group