Page 1 of 1
FC7 and SDCARD FAT
Posted: Fri Dec 16, 2016 12:22 pm
by ylanchec
Hi,
I am testing flowcode 7 with arduino and a FAT SDCARD. All works on flowcode, i read a little text file and display 5 car.
If i compile in hex and link it to a proteus project, the program stay in the initialize function.
Has someone tested SDCARD with arduino and FC7 ?
Best regards
Yannick
Re: FC7 and SDCARD FAT
Posted: Fri Dec 16, 2016 12:53 pm
by Benj
Hello Yannick,
Yes I have been recently testing the FAT component with an Arduino Uno and all is working well.
AVR's have a known bug with SPI you need to either use pin B2 as your CS pin or you need to at least output a 1 to pin B2. If B2 is left as an input it can put the SPI into slave mode which will lock up the SPI comms.
If this is not an option then you will have to use the software channel though this will not be as fast as the hardware channel.
Re: FC7 and SDCARD FAT
Posted: Fri Dec 16, 2016 1:29 pm
by ylanchec
Hi Benj,
Thank you for your response.
I have put the spi on software and use b2 and set it as an output.
But this does not seems to be ok.
What is wrong ?
Can you look up at my code please ? do you have your working example ?
Best regards
Yannick
Re: FC7 and SDCARD FAT
Posted: Fri Dec 16, 2016 1:39 pm
by Benj
Hello Yannick,
First of all can you check you are using the latest FAT component from here.
http://www.matrixtsl.com/mmforums/viewt ... 356#p78721
Your program looks ok, here is my test program I was using.
Re: FC7 and SDCARD FAT
Posted: Fri Dec 16, 2016 2:26 pm
by ylanchec
Hi Ben,
I have opened your program and change pins for LCD, it also stay on the init...
I have update the components FAT.
Yannick
Re: FC7 and SDCARD FAT
Posted: Fri Dec 16, 2016 3:57 pm
by Benj
Looks like the program is waiting for the card. I get the same thing if I run the program with the card out of the socket.
Do the arrows on the card simulation in Proteus allow the card to be inserted and detected?
Re: FC7 and SDCARD FAT
Posted: Fri Dec 16, 2016 4:24 pm
by ylanchec
Hi Benj,
I have test with the button to insert and extraxt the sdcard.
It's the same.
Here is the full project
Thank you
Yannick
Re: FC7 and SDCARD FAT
Posted: Fri Dec 16, 2016 6:04 pm
by Benj
Hi Yannick,
I'm afraid I don't have a license for Proteus that allows me to simulate so I can't check the file you have sent.
However it appears it is Proteus that has the problem as the Flowcode sim and the real world Arduino both seem to be working well.
Re: FC7 and SDCARD FAT
Posted: Fri Dec 16, 2016 6:22 pm
by ylanchec
Hi Benj,
I'm going to test with the real hardware.
If the problem comes from proteus, i will write to labcenters.
I have tested examples found on internet with pics and sdcard, and they work on proteus...
Thank you
Yannick