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 support@ccsinfo.com

18F4550 with MMC/SD
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
Picmouse



Joined: 20 Mar 2007
Posts: 7

View user's profile Send private message

PostPosted: Wed Mar 21, 2007 8:48 am     Reply with quote

Thank you ckielstra to answer.

Quote:
- Are you using an MMC or SD card?

I am using SDcard

Quote:
- Are both the MMC card and the PIC running at 3.3V? If not, than you will have to add voltage level converters.


The pic this working at 5v, for that reason use the following circuit:



Quote:
- Do you have pull-up resistors (100k) on Data_in and Data_out?


Din of the pic, doesn't have resistance pull-up

Quote:
- Note that the data lines are crossed; MMC_DO of the PIC must be connected to Data_In (pin 2) of the MMC. MMC_DI of the PIC is connected to Data_Out (pin 7) of the MMC.


that part this well

According to what you tell me, I should also place pull-up to the pic?
Picmouse



Joined: 20 Mar 2007
Posts: 7

View user's profile Send private message

PostPosted: Wed Mar 21, 2007 9:16 am     Reply with quote

Place resistance pull-up in Din of the PIC and I don't work. That another test can make? Crying or Very sad
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Thu Mar 22, 2007 5:13 am     Reply with quote

The pull-up on Din is required as the MMC/SD cards power up in an Open-Drain mode. After initialization the outputs change into a Push-Pull mode where the pull-up is no longer needed.

Which compiler version are you using? I tested v3.249 with an SD card and it passed the initialization without a problem (though my hardware is all running at 3.3V).

I suspect your problem is in the hardware 5V to 3.3V conversion. An MMC card expects an input LOW voltage of maximal 0.25*Vdd (= 0.825V). With the voltage drop over your 1N4148 diode added to the output low voltage of the PIC this is a critical factor.
For a quick test you could replace the diode/resistor combination by a voltage divider (for example 1k8 with 3k3).
Code:
PIC output ----
              |
             ---
             | |
             | | 1k8
             | |
             ---
              |
              |------ to MMC
              |
             ---
             | |
             | | 3k3
             | |
             ---
              |
             ---
              -


The 3.3V Do from the MMC to the PIC should be OK as you connected this to RB0 which is one of the few TTL inputs. TTL inputs of the PIC will accept anything above 2.0V as a logic high.
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