FAT Initialise is not possible
Moderator: Benj
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
- Contact:
FAT Initialise is not possible
I wrote a small program for the FAT Initialise. The program try to Initialise the FAT (CARD). If it's ok the 5mmLED is turned off. On the clockpin I put an another led, so I can see if the software gives clocks....
The result is always clocking and never ok. The main clock is 8Mega, I tryed all clock-divider 512,320,256,192,128,64,32 but it did not help.
I controled with the osciloscope
The signal on Pin MOSI is ok.
The signal on Pin SCK is ok.
The signal on Pin Chipselect is ok.
But on the Pin MISO It's always 3.3Volt.
The result is always clocking and never ok. The main clock is 8Mega, I tryed all clock-divider 512,320,256,192,128,64,32 but it did not help.
I controled with the osciloscope
The signal on Pin MOSI is ok.
The signal on Pin SCK is ok.
The signal on Pin Chipselect is ok.
But on the Pin MISO It's always 3.3Volt.
- Attachments
-
- Fat_init1.PNG
- (29.98 KiB) Downloaded 2713 times
- 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: FAT Initialise is not possible
Hello,
Please can you attach your Flowcode project file and we will investigate. A schematic or drawing of your circuit to the card might also help.
Note that the pin out for SD and micro SD is not the same.
Please can you attach your Flowcode project file and we will investigate. A schematic or drawing of your circuit to the card might also help.
Note that the pin out for SD and micro SD is not the same.
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
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
- Contact:
Re: FAT Initialise is not possible
Hi Ben
The Harware is from Olimex:
https://www.olimex.com/Products/Duino/P ... e-hardware
There is a schema in pdf. I put a RS232 to USB Adapter. With this adapter it's possible to connect a PIC32 to USB and read error-code with a terminalprogram. The card ist sending always FF
https://www.olimex.com/Products/Modules ... e-hardware.
I tried sd Card from different manufacturer.
regards
Stefan
The Harware is from Olimex:
https://www.olimex.com/Products/Duino/P ... e-hardware
There is a schema in pdf. I put a RS232 to USB Adapter. With this adapter it's possible to connect a PIC32 to USB and read error-code with a terminalprogram. The card ist sending always FF
https://www.olimex.com/Products/Modules ... e-hardware.
I tried sd Card from different manufacturer.
regards
Stefan
- Attachments
-
- Fat_erni1-send.fcfx
- (18.07 KiB) Downloaded 313 times
-
- PIC32-PINGUINO-MICRO-REV-B.pdf
- (29.12 KiB) Downloaded 343 times
- 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: FAT Initialise is not possible
Hello Stefan,
Are you using the updated PIC32 definition files available from here.
http://www.matrixtsl.com/mmforums/viewt ... 63&t=18182
It could be something to do with this?
In the Flowcode generated C file (Build -> View C...) near the bottom of the file at the start of the main function do you have the AD1PCFG line of code?
Are you using the updated PIC32 definition files available from here.
http://www.matrixtsl.com/mmforums/viewt ... 63&t=18182
It could be something to do with this?
In the Flowcode generated C file (Build -> View C...) near the bottom of the file at the start of the main function do you have the AD1PCFG line of code?
Code: Select all
int main()
{
AD1PCFG = 0xFFFF;
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
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
- Contact:
Re: FAT Initialise is not possible
Hi Benj
Yes. I'm using FC7.1.1 and I can see the AD1PCFG = 0xFFFF;
But I found a problem. The output B13 is not working. If I tested without the Card insert, the pin was low(chip is selected) but with the Card, it was always high. So I tried to use this pin as a normal output and set it flashing h/l .But no change on the pin, always low. I think Pin13 is not and output in my software.
regards
Stefan
Yes. I'm using FC7.1.1 and I can see the AD1PCFG = 0xFFFF;
But I found a problem. The output B13 is not working. If I tested without the Card insert, the pin was low(chip is selected) but with the Card, it was always high. So I tried to use this pin as a normal output and set it flashing h/l .But no change on the pin, always low. I think Pin13 is not and output in my software.
regards
Stefan
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
- Contact:
Re: FAT Initialise is not possible
Hi Benj
For a test I solder a wire from B13 to GND to give a "hard" CS and then..... the card is working!
But why the B13 is not following FC?
regards
Stefan
For a test I solder a wire from B13 to GND to give a "hard" CS and then..... the card is working!
But why the B13 is not following FC?
regards
Stefan
- 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: FAT Initialise is not possible
Hi Stefan,
Thanks for letting us know. I'm looking into reasons why B13 would not be functioning as a digital output now.
B13 shares this functionality.
ADC Input - We have already checked this is off by default and setting the AD1PCFG register to 0xFFFF
PMA10 - Parrallel Master Port Address - Looks like this is off by default
TDI - JTAG Test Data Input
In your config settings the setting for "Background Debugger Enable" is currently undefined. Maybe try switching this to disabled and see it that helps at all.
Thanks for letting us know. I'm looking into reasons why B13 would not be functioning as a digital output now.
B13 shares this functionality.
ADC Input - We have already checked this is off by default and setting the AD1PCFG register to 0xFFFF
PMA10 - Parrallel Master Port Address - Looks like this is off by default
TDI - JTAG Test Data Input
In your config settings the setting for "Background Debugger Enable" is currently undefined. Maybe try switching this to disabled and see it that helps at all.
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
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
- Contact:
Re: FAT Initialise is not possible
Hi Benj
I did the
Background Debugger Enable to disabled... did not help
It's looks like I can not use the Pin with TDI,TDO,'TCK
And the B13 is the JTAG Test Data Input.
But how can I do to turn off the JTAG function?
regards
Stefan
I did the
Background Debugger Enable to disabled... did not help
It's looks like I can not use the Pin with TDI,TDO,'TCK
And the B13 is the JTAG Test Data Input.
But how can I do to turn off the JTAG function?
regards
Stefan
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
- Contact:
Re: FAT Initialise is not possible
Hi Benj
I wrote a code in the begin
DDPCON=0;
and now it' working
Thank Your for the help to found the reason.
regards Stefan
I wrote a code in the begin
DDPCON=0;
and now it' working
Thank Your for the help to found the reason.
regards Stefan
- 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: FAT Initialise is not possible
Hi Stefan,
Fantastic news, well done and thanks for letting us know. I'll add this code to the appropriate chip definition files so it hopefully won't catch anyone else out in the future.
Fantastic news, well done and thanks for letting us know. I'll add this code to the appropriate chip definition files so it hopefully won't catch anyone else out in the future.
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
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
- Contact:
Re: FAT Initialise is not possible
Hi Ben
I have some more small things about PIC32MX440F256H.
The clock divider, from the SD-Card, is not working correct.
The fastes clock I can measure with the osciloscope is on the "dived by 6"
If I use the "dived by 4" and "dived by 2" ist 10 time slower as "dived by 6".
And this strange PIC has just 1 SPI Port and Microchip call it SPI2.But FC give a "channel1" (it does not work)
Only in softwaremode.
regards
Stefan
I have some more small things about PIC32MX440F256H.
The clock divider, from the SD-Card, is not working correct.
The fastes clock I can measure with the osciloscope is on the "dived by 6"
If I use the "dived by 4" and "dived by 2" ist 10 time slower as "dived by 6".
And this strange PIC has just 1 SPI Port and Microchip call it SPI2.But FC give a "channel1" (it does not work)
Only in softwaremode.
regards
Stefan
- 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: FAT Initialise is not possible
Thanks Stefan,
I will investigate and see if I can fix this.
I will investigate and see if I can fix this.
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
- 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: FAT Initialise is not possible
Right some progress,
I have found some more bugs related to the SPI and hopefully these are now fixed too. I have added a spacer SPI channel to the definition file so that Channel 2 is now available yet Channel 1 is not.
To apply the fixes you need the following files.
The updated chip definition file lives in the "Flowcode 7/FCD/PIC32" folder.
And the updated CAL file lives in the "Flowcode 7/CAL/PIC32BIT" folder.
Finally the updated CAL component lives in the "Flowcode 7/components" folder.
After you have copied the files restart Flowcode and SPI channel 2 should then be available in the Channel drop down.
Let me know how you get on.
I have found some more bugs related to the SPI and hopefully these are now fixed too. I have added a spacer SPI channel to the definition file so that Channel 2 is now available yet Channel 1 is not.
To apply the fixes you need the following files.
The updated chip definition file lives in the "Flowcode 7/FCD/PIC32" folder.
And the updated CAL file lives in the "Flowcode 7/CAL/PIC32BIT" folder.
Finally the updated CAL component lives in the "Flowcode 7/components" folder.
After you have copied the files restart Flowcode and SPI channel 2 should then be available in the Channel drop down.
Let me know how you get on.
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
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
- Contact:
Re: FAT Initialise is not possible
Hi Ben
Thank you for the time.
I tried the software SPI also. But the problem of the divider is still the same.
(the "dived by 4" and "dived by 2" ist 10 time slower as "dived by 6".)
The hardware CH2 is now working and has a much faster speed. So I use this setup.
For Initial Prescalar of the sd-card there are a lot of possible divider.
Is it a big problem to have the same divider for the highspeed? or just add the /2 /6 /8.
But anyway, I think , the card is now fast enough for my Project.
and a small Thing in the Project option I think it's not 48000000 it's 80000000 for the max speed. regards
Stefan
Thank you for the time.
I tried the software SPI also. But the problem of the divider is still the same.
(the "dived by 4" and "dived by 2" ist 10 time slower as "dived by 6".)
The hardware CH2 is now working and has a much faster speed. So I use this setup.
For Initial Prescalar of the sd-card there are a lot of possible divider.
Is it a big problem to have the same divider for the highspeed? or just add the /2 /6 /8.
But anyway, I think , the card is now fast enough for my Project.
and a small Thing in the Project option I think it's not 48000000 it's 80000000 for the max speed. regards
Stefan
- 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: FAT Initialise is not possible
Hello Stefan,
Thanks for letting me know how you've got on.
Thanks for letting me know how you've got on.
Thanks I will investigate the software mode. I did make some minor changes but it sounds like it has not fixed the issue.I tried the software SPI also. But the problem of the divider is still the same.
(the "dived by 4" and "dived by 2" ist 10 time slower as "dived by 6".)
Yes the "High Speed" should be the same list as the "Initial Speed" settings. I will investigate why this is not working.For Initial Prescalar of the sd-card there are a lot of possible divider.
Is it a big problem to have the same divider for the highspeed? or just add the /2 /6 /8.
You should be able to type in the 80000000 value directly into the clock speed setting. The list is just some common clock speeds but you can type in any value. If the number you type in is too large for the target then Flowcode will warn you about it and set the clock speed to what it thinks should be the max speed.and a small Thing in the Project option I think it's not 48000000 it's 80000000 for the max speed.
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
- 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: FAT Initialise is not possible
Found and fixed the issue. Simply copy the attached file into your "Flowcode 7/Components" folder and restart Flowcode and the high speed prescaler issue should be fixed.Yes the "High Speed" should be the same list as the "Initial Speed" settings. I will investigate why this is not working.
This should also be fixed in the attached file. This lives in the "Flowcode 7/CAL/PIC32BIT" folder. You are right in that /6 would have been the fastest prescaler option for the software channel. Now /2 is the fastest and this will correspond with the /6 speed you were getting before. The hardware channels are always going to be much faster so best to use these if they are available especially for something like FAT where you are shifting a lot of data.Thanks I will investigate the software mode. I did make some minor changes but it sounds like it has not fixed the issue.
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