![]() | ![]() | ![]() |
| | |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) |
| Hi anybody here that can help me with some code made in mikroC compiler? Im using this compiler becase of its MMC FAT16 lib.. But its not working (at least not for me
__________________ Simplicity rules Good enought - its perfect ?? 2 Gig of free online backup space Are you a Chemist? | |
| |
| | (permalink) | |
| Quote:
The important note about it thoe is 1. you have to format the MMC/SD card on the PC (the format routine actually does not format the card, but just clear fat table) 2. it is fat16 library *only* meaning if you for e.g. use 32MB MMC card it will *NOT* work, because it is formated using fat12 (I spent 2 days on this until I figured it out and tried 1G card) If you are trying with the "small" card like I did (fat12) you can write "raw data" to card (sectors) and then use some raw read sw on PC to read the data ...
__________________ http://www.it4um.com | ||
| |
| | (permalink) |
| No im using a 1G (SD)card but i cant seem to get anything on it. I have tried to implement the quick format but with no luck (i will keep trying) And using the help file have only confused me (well a bit cos its using portb in code and portc on the schematic example)
__________________ Simplicity rules Good enought - its perfect ?? 2 Gig of free online backup space Are you a Chemist? | |
| |
| | (permalink) | |
| Quote:
have you tried the example ...\Examples\EasyPic4\extra_examples\MMC\Mmc_Fat16 what uC are you using? If IIRC mikroC lib uses hw SPI to talk with the mmc card, most of uC's I used have SPI on port C ... The software SPI might not be fast enough to talk with the card...
__________________ http://www.it4um.com | ||
| |
| | (permalink) |
| Im using a 18F4550 How to determin if its SW or HW spi? Edit: Yes i have formatted on a XP machine
__________________ Simplicity rules Good enought - its perfect ?? 2 Gig of free online backup space Are you a Chemist? Last edited by Kryten; 21st May 2008 at 01:32 PM. | |
| |
| | (permalink) |
| I;m not sure my comment on hw/sw spi had any value as I'm looking now at the dsheet and SPI is on RC7, RB0, RB1 and RA5 ... The test I made with MMC reader was MMC reader dev card connected to portC .. so all 4 lines are connected to portC http://www.mikroe.com/pdf/mmc-sd_board_schematic.pdf CS - C2 SCK - C3 SDI - C4 SDO - C5 and it works for me ...
__________________ http://www.it4um.com | |
| |
| | (permalink) |
| Well I have made a PCB that is purposbuilt for my application. Im using the SPI pins (RB 0,1 and 4 (Using RB4 CSSPP as chip select) and RC7) I might have to change my CS pin to RA5
__________________ Simplicity rules Good enought - its perfect ?? 2 Gig of free online backup space Are you a Chemist? Last edited by Kryten; 21st May 2008 at 02:15 PM. Reason: forgot something | |
| |
| | (permalink) |
| the mmc_fat_init() just takes parameter what pin you want to use for CS ... the other 3 pins are HW spi and for 18F452 they are: RC3/SCK/SCL -> (spi sck) -> SCK pin on MMC RC4/SDI/SDA -> (spi data in) -> Dout pin on MMC RC5/SDO -> (spi data out ) -> Din pin on MMC now, the library use always SCK/SDI/SDO so as you use pic18f4550 then you need to connect the MMC to RB1/SCK/... spi clock RB0/SDI/... - spi data in RC7/RX/DT/SDO - spi data out the "chip select" is passed to mmc_fat_init, so you can use any pin for that I have just tried your project locally and it works but I had to put the 18F452 in, as my MMC board is idc10 connector to easypic4 so I was not able to connect it to pins on 4550, I removed the "adc" part of the project and it just append "blank" data to the file .. and that part is ok .. I'll try later on to connect it using wires to try the project with 4550 but that has to wait a bit as i'm kinda out of free time for now (I can probably test it during weekend)
__________________ http://www.it4um.com | |
| |
| | (permalink) |
| Ok i might have to change it then.. It might be that 600 samples thing
__________________ Simplicity rules Good enought - its perfect ?? 2 Gig of free online backup space Are you a Chemist? | |
| |
| | (permalink) |
| Here is the connections between the SD /MMC card holder and uC (I think now that using a PIC18F425 could have been better
__________________ Simplicity rules Good enought - its perfect ?? 2 Gig of free online backup space Are you a Chemist? | |
| |
| | (permalink) |
| If your running the 18F425 at 5V and the SD card at 3.3V you'll probably need a 74HCT125 or the like as a level converter as the SDI pin is ST (3.3V is too low) The schematic below is for an AVR but the idea is the same. ![]() | |
| |
| | (permalink) |
| blue, I'm not sure as http://www.mikroe.com/pdf/mmc-sd_board_schematic.pdf works perfectly with 18F4520 and that is 5V uC afaik.
__________________ http://www.it4um.com | |
| |
| | (permalink) |
| It's not recommended, the ST inputs want higher than 3.3V when the hardware SPI is used. Check the electrical specifications of the datasheet. http://www.ljcv.net/library/sc/pic10t-2.0.pdf | |
| |
| | (permalink) | |
| Quote:
__________________ http://www.it4um.com | ||
| |
| | (permalink) |
| Try lowering the VDD on the PIC with a diode, your top speed will go down but the ST threshold is VDD * 0.8 so that will go down too. | |
| |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
| | ||||
| Title | Starter | Forum | Replies | Latest |
| mikroC demo version limits | ssylee | Micro Controllers | 8 | 19th October 2007 09:21 PM |