MMC card reader on ECIO
MMC card reader on ECIO
Hello,
I want to connect the MMC card reader with teh ECIO 40P, is it possible?
Do I have to use the batch system or connect it to a specific port?
Thank you in advance,
Best Regards,
Achillis.
I want to connect the MMC card reader with teh ECIO 40P, is it possible?
Do I have to use the batch system or connect it to a specific port?
Thank you in advance,
Best Regards,
Achillis.
- Steve
- Matrix Staff
- Posts: 3433
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
Re: MMC card reader on ECIO
The MMC card reader uses SPI. If you want to use the ECIO's hardware, then there is a small problem in that the SPI module of the chip is split across ports B and C. There is also a software implementation of SPI, which means you can use any port you like.
Re: MMC card reader on ECIO
Hello Steve,
This is the first time I will use the SPI, can you help me a little bit with it?
I am trying to find the pins on the ECIO that I will have to connect to the card board but I cannot find them all.
On the MMC board, on the patch system it writes: SD0, SDI, CLK and CS.
On the ECIO I can see only the SDO and SDI! THis is from the PIC view on Flowcode.
Can you please point me out to the right pins?
Also Steve you said about software implementation of the SPI, can you give me a hint about that?
Thank you in advance,
Best Regards,
Achillis.
This is the first time I will use the SPI, can you help me a little bit with it?
I am trying to find the pins on the ECIO that I will have to connect to the card board but I cannot find them all.
On the MMC board, on the patch system it writes: SD0, SDI, CLK and CS.
On the ECIO I can see only the SDO and SDI! THis is from the PIC view on Flowcode.
Can you please point me out to the right pins?
Also Steve you said about software implementation of the SPI, can you give me a hint about that?
Thank you in advance,
Best Regards,
Achillis.
- Steve
- Matrix Staff
- Posts: 3433
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
Re: MMC card reader on ECIO
SCK = B1
CS = anything you like (you will need to manipulate this by hand)
When using the FAT16 component, the connections you set will be determined on whether you are using the hardware SPI module or not. If you are using the software SPI code, you will need to specify connections for all 4 SPI lines rather than just the CS line.
CS = anything you like (you will need to manipulate this by hand)
When using the FAT16 component, the connections you set will be determined on whether you are using the hardware SPI module or not. If you are using the software SPI code, you will need to specify connections for all 4 SPI lines rather than just the CS line.
Re: MMC card reader on ECIO
Hello Steve,
When you say SCK you mean CLK on the ECIO side? Because on the MMC board pin description at the patch system it writes: CLK.
So in order to write on an MMC card I will have to manipulate every time the SPI component? I have lost you a little bit
.
As for the software implementation of SPI I did not exactly understand how I am going to specify the connections. Through the SPI properties? If there is C code involved, I know nothing!
As for the CS, is this the Clear to Send? If so then I will have to make high every time I will write data?
It seems that I will need more than just a hint!!!
I would appreciate the help.
Thank you,
Best Regards,
Achillis.
When you say SCK you mean CLK on the ECIO side? Because on the MMC board pin description at the patch system it writes: CLK.
So in order to write on an MMC card I will have to manipulate every time the SPI component? I have lost you a little bit

As for the software implementation of SPI I did not exactly understand how I am going to specify the connections. Through the SPI properties? If there is C code involved, I know nothing!
As for the CS, is this the Clear to Send? If so then I will have to make high every time I will write data?
It seems that I will need more than just a hint!!!

I would appreciate the help.
Thank you,
Best Regards,
Achillis.
Re: MMC card reader on ECIO
Hello,
OK, I think that I might have figured it out! As for the SPI lines, in software manipulation I will have to determine them through the Custom Component properties?
If so then I will have to specify a "card port" and a "card tris" e.x "portd" , "trisd". Yes?
If I do so, then on the following rows when I am going to specify which pin will act as SDO,SDI,CLK and CS, then I will have to choose all of them from the same port?
Also can you tell me if portE on ECIO has 3 or 4 pins? When I look on the ECIO I find only 3 but in Flowcode if you have an input or output icon and choose port E it gives you 4 pins!!!!!!
P.S
I discovered that while I was trying to manually enter the properties of the Custom Component, the rows were allmost empty, even if I had replaced the custom code with the one downloaded from your site. Is that the way supposed to be?
Thank you,
Best Regards,
Achillis
OK, I think that I might have figured it out! As for the SPI lines, in software manipulation I will have to determine them through the Custom Component properties?
If so then I will have to specify a "card port" and a "card tris" e.x "portd" , "trisd". Yes?
If I do so, then on the following rows when I am going to specify which pin will act as SDO,SDI,CLK and CS, then I will have to choose all of them from the same port?
Also can you tell me if portE on ECIO has 3 or 4 pins? When I look on the ECIO I find only 3 but in Flowcode if you have an input or output icon and choose port E it gives you 4 pins!!!!!!
P.S
I discovered that while I was trying to manually enter the properties of the Custom Component, the rows were allmost empty, even if I had replaced the custom code with the one downloaded from your site. Is that the way supposed to be?
Thank you,
Best Regards,
Achillis
- Steve
- Matrix Staff
- Posts: 3433
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
Re: MMC card reader on ECIO
If you want to communicate with the MMC card reader, use the FAT16 component in Flowcode - this does the SPI for you. I'm sure there is an article and/or examples on our website.
The MCLR pin can be configured as an input line (E3) - this is the 4th PORTE pin. But be aware that it is connected to the reset switch on the ECIO itself.
The MCLR pin can be configured as an input line (E3) - this is the 4th PORTE pin. But be aware that it is connected to the reset switch on the ECIO itself.
Re: MMC card reader on ECIO
Hello,
Thank you Steve. I was trying before to test the MMc board but my PC cannot format my SD card into FAT16!!!!! Only FAT(default) and FAT32.
I am trying to find a solution now.
Thank you Steve. I was trying before to test the MMc board but my PC cannot format my SD card into FAT16!!!!! Only FAT(default) and FAT32.
I am trying to find a solution now.
Re: MMC card reader on ECIO
I have tried FAT(default) but when I run the program(read_file.fcf-downloaded from Matrix) the LCD continuously print "waiting for card".
I thought that this was cause by the fact that the card was not properly formatted.
I connected the MMC board on pins B7,B6,B5 and B4 at SDO,SDI,CLK and CS respectively(patch system). Doing that I opened the custom component's properties and set portb, trisb and for the connections the appropriate pins, as mentioned before.
Have you got any idea what might be wrong?
I thought that this was cause by the fact that the card was not properly formatted.
I connected the MMC board on pins B7,B6,B5 and B4 at SDO,SDI,CLK and CS respectively(patch system). Doing that I opened the custom component's properties and set portb, trisb and for the connections the appropriate pins, as mentioned before.
Have you got any idea what might be wrong?
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: MMC card reader on ECIO
Hello
What version of Flowcode are you using? There is a FAT component that is much better then the old custom component though the function names remain the same. Eg if you are using an example then you can simply swap the custom component macro calls for a FAT16 component call.
This also allows you to define your pin connections inside Flowcode.
When formatting your SD / MMC card use the FAT option to format your card with the FAT16 file system.
What version of Flowcode are you using? There is a FAT component that is much better then the old custom component though the function names remain the same. Eg if you are using an example then you can simply swap the custom component macro calls for a FAT16 component call.
This also allows you to define your pin connections inside Flowcode.
When formatting your SD / MMC card use the FAT option to format your card with the FAT16 file system.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: MMC card reader on ECIO
Hello,
I am using version 3.6.11.53. Where can I find the other FAT component?
I have formatted my SD card with FAT but nothing happens after I power up the ECIO, only "waiting for card".
I am using version 3.6.11.53. Where can I find the other FAT component?
I have formatted my SD card with FAT but nothing happens after I power up the ECIO, only "waiting for card".
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: MMC card reader on ECIO
Hello
Ok it looks like the FAT component was not officially released until v4.
Here is the custom component code with a slightly updated set of routines that should allow your program to get past the waiting for card message.
Ok it looks like the FAT component was not officially released until v4.
Here is the custom component code with a slightly updated set of routines that should allow your program to get past the waiting for card message.
- Attachments
-
- Custom_Code.c
- (38.72 KiB) Downloaded 431 times
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: MMC card reader on ECIO
Hello,
I have copied the new custome code in the flowcode directory but when I open the component's properties it only writes "my value"!
Is that the way supposed to be? I have to fill in the rest of the information?
Thank you.
I have copied the new custome code in the flowcode directory but when I open the component's properties it only writes "my value"!
Is that the way supposed to be? I have to fill in the rest of the information?
Thank you.
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: MMC card reader on ECIO
Hello
Yes you will have to replace the myvalue and the blank values with the values used in the example or values that are compatible with your hardware.
Here is the list of what the values should be.
%a //Card Port
%b //Card Data Direction
%c //Card Chip Select
%d //Card SPI Clock
%e //Card DATA In
%f //Card DATA Out
%g //File / Folder creation time
%h //File / Folder creation date
%i //FAT16 / FAT32
%j //BitBanged / Hardware SPI
%i and %j can be ignored as they are not used.
Yes you will have to replace the myvalue and the blank values with the values used in the example or values that are compatible with your hardware.
Here is the list of what the values should be.
%a //Card Port
%b //Card Data Direction
%c //Card Chip Select
%d //Card SPI Clock
%e //Card DATA In
%f //Card DATA Out
%g //File / Folder creation time
%h //File / Folder creation date
%i //FAT16 / FAT32
%j //BitBanged / Hardware SPI
%i and %j can be ignored as they are not used.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: MMC card reader on ECIO
Hello,
Thank you for yor quick reply, I have a few questions.
By what I saw above it means that the SD card can be formatted in FAT32 format?
When you say card data direction you mean "trisx"? It has to be the same as the card port(portx)?
As for %g and %h in what format I will enter the time and date? How can the PIC know time and date?
Also I am attaching a screenshot of what I had on my previous program taken from an example of yours.
Thank you for yor quick reply, I have a few questions.
By what I saw above it means that the SD card can be formatted in FAT32 format?
When you say card data direction you mean "trisx"? It has to be the same as the card port(portx)?
As for %g and %h in what format I will enter the time and date? How can the PIC know time and date?
Also I am attaching a screenshot of what I had on my previous program taken from an example of yours.
- Attachments
-
- custom.jpg (37.42 KiB) Viewed 14573 times
Re: MMC card reader on ECIO
Hello,
I have made the connections as above. It seems that SD card cannot be detected by the card board. So I have inserted an MMC card and the program worked. LCD printed that file created and file exists. But when I put my card on the PC then no file was found! Actually the card was not formatted and there were numerous files but mainly pictures. So I deleted a file by the name "file", I thought that, that was the one that flowcode created but when I did that then the card became unreadable by the PC. Howerver e-blocks recognise it and when I run the program then Lcd prints the above.
After I took another MMC card and inserted it to e-blocks and again the message was succesfull but the PC when I open the card just recognises it empty!
Could be an error of the program and missprints the succesful message?
Can you confirm the above data-connections at the custom component's properties?
Thank you.
I have made the connections as above. It seems that SD card cannot be detected by the card board. So I have inserted an MMC card and the program worked. LCD printed that file created and file exists. But when I put my card on the PC then no file was found! Actually the card was not formatted and there were numerous files but mainly pictures. So I deleted a file by the name "file", I thought that, that was the one that flowcode created but when I did that then the card became unreadable by the PC. Howerver e-blocks recognise it and when I run the program then Lcd prints the above.
After I took another MMC card and inserted it to e-blocks and again the message was succesfull but the PC when I open the card just recognises it empty!
Could be an error of the program and missprints the succesful message?
Can you confirm the above data-connections at the custom component's properties?
Thank you.
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: MMC card reader on ECIO
Hello
Ok thats strange that the SD card is not working? What type of SD card is it maybe I could get one and give it a test here.
The Connections you have defined are correct if the E-Block is attached to PortD and also the four way jumper is in the A position.
The time and date are automatically generated for you in version 4 as being the compilation time and date. In v3 you must define these properties yourself. The way that the FAT stores the time and date is a bit odd but can be used to add your own time and dates to the files.
Currently only the FAT file system is supported and not FAT32.
Ok thats strange that the SD card is not working? What type of SD card is it maybe I could get one and give it a test here.
The Connections you have defined are correct if the E-Block is attached to PortD and also the four way jumper is in the A position.
The time and date are automatically generated for you in version 4 as being the compilation time and date. In v3 you must define these properties yourself. The way that the FAT stores the time and date is a bit odd but can be used to add your own time and dates to the files.
Currently only the FAT file system is supported and not FAT32.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: MMC card reader on ECIO
Hello,
First, please ignore the screenshot above, because it was taken from an FCF file dowloaded from Matrix, as an example. At my hardware configuration I use portB.
So at card port row I put "portB", at card tris I put "portB", chip select "7", CLK "6", SDI "5", SDO "4", create time and date as is.
Then I set jumper at "C" position so that I can manually define the pins via the patch system.
As far as the cards I use, let me start from the "working" card. I use one MMC Kingstone 512MB dual voltage. The other one that it used to work, it does not write one but it was included with a mobile phone I use to have the Nokia 6230. The only thing I know is that is 32 MB and has 7 pins.
I thing that MMC cards have 7 pins and SD have 9 pins.
Now, the non working SD cards are: a Canon 16MB which writes on it:"SDC-16M".
The other one just writes 128MB Kingston.
Ben, the one thing I know that both are the old type of SD cards, I mean that they are not HC SD cards-High Capacity.
Hope this helps.
Thank you.
First, please ignore the screenshot above, because it was taken from an FCF file dowloaded from Matrix, as an example. At my hardware configuration I use portB.
So at card port row I put "portB", at card tris I put "portB", chip select "7", CLK "6", SDI "5", SDO "4", create time and date as is.
Then I set jumper at "C" position so that I can manually define the pins via the patch system.
As far as the cards I use, let me start from the "working" card. I use one MMC Kingstone 512MB dual voltage. The other one that it used to work, it does not write one but it was included with a mobile phone I use to have the Nokia 6230. The only thing I know is that is 32 MB and has 7 pins.
I thing that MMC cards have 7 pins and SD have 9 pins.
Now, the non working SD cards are: a Canon 16MB which writes on it:"SDC-16M".
The other one just writes 128MB Kingston.
Ben, the one thing I know that both are the old type of SD cards, I mean that they are not HC SD cards-High Capacity.
Hope this helps.
Thank you.
- Steve
- Matrix Staff
- Posts: 3433
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
Re: MMC card reader on ECIO
I think I've only ever used MMC cards with this. The software may need to be modified to work with SD cards, but I do not know too much about this to comment.
Re: MMC card reader on ECIO
Hello,
OK there is no problem not being able to work with SD cards for the time being.
What about the MMC? The LCD prints that it has created the file but when I insert the card on my PC then there is no file!!!
Can I do anything about that?
Thank you,
Regards,
Achillis.
OK there is no problem not being able to work with SD cards for the time being.
What about the MMC? The LCD prints that it has created the file but when I insert the card on my PC then there is no file!!!
Can I do anything about that?
Thank you,
Regards,
Achillis.
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: MMC card reader on ECIO
Hello
Please can you attach your flowcode file and C code file to the forums for me to look at. The code should work correctly with both MMC and SD cards so I will see if I can find the cause of your problem.
Please can you attach your flowcode file and C code file to the forums for me to look at. The code should work correctly with both MMC and SD cards so I will see if I can find the cause of your problem.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: MMC card reader on ECIO
Hello,
This was taken from Matrix download section and I only changed the port, tris and pins.
Thank you.
This was taken from Matrix download section and I only changed the port, tris and pins.
Thank you.
- Attachments
-
- Create_File.fcf
- (9.5 KiB) Downloaded 356 times