PICKIT WI-Fire PIC32MZ2048EFG100 SD-Card
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
- Contact:
PICKIT WI-Fire PIC32MZ2048EFG100 SD-Card
Hi Ben
on my board PICKIT WI-Fire PIC32MZ2048EFG100 200MHz is an sd-card.
I can write to the card nice if I use the software pin like in the png.
But to use the hardware spi pins (SPI3) it's not possible to choose.
It's not in the MOSI/MISO remap. How can I add them?
on my board PICKIT WI-Fire PIC32MZ2048EFG100 200MHz is an sd-card.
I can write to the card nice if I use the software pin like in the png.
But to use the hardware spi pins (SPI3) it's not possible to choose.
It's not in the MOSI/MISO remap. How can I add them?
- 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: PICKIT WI-Fire PIC32MZ2048EFG100 SD-Card
Hello,
Right the remappable functionality is organised into banks on the selected device. We have added all the banks to the definition file but only the first bank is currently functional.
So for now I have swapped the bank order which should allow you to select the correct pin to drive the SD card.
Simply copy the attached file into your "Flowcode 7/FCD/PIC32" folder and restart Flowcode.
Let us know how you get on.
Right the remappable functionality is organised into banks on the selected device. We have added all the banks to the definition file but only the first bank is currently functional.
So for now I have swapped the bank order which should allow you to select the correct pin to drive the SD card.
Simply copy the attached file into your "Flowcode 7/FCD/PIC32" folder and restart Flowcode.
Let us 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
- 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: PICKIT WI-Fire PIC32MZ2048EFG100 SD-Card
I think I've now fixed it so that the SPI CAL will work to bring in both MOSI banks if more than one bank is available.
Simply copy the attached file into your "Flowcode 7/components" folder. The above fix should not be needed now but will not harm anything.
Simply copy the attached file into your "Flowcode 7/components" folder. The above fix should not be needed now but will not harm anything.
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: PICKIT WI-Fire PIC32MZ2048EFG100 SD-Card
it's working now with the pin. So I wrote a macro to insert easy in all my programs to write a testfile.
There is a problem on the end of the macro, with "write to the next sector". If I open the file, only the first sector is correct.
Can You help me with this?
There is a problem on the end of the macro, with "write to the next sector". If I open the file, only the first sector is correct.
Can You help me with this?
- 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: PICKIT WI-Fire PIC32MZ2048EFG100 SD-Card
Hello Stefan,
The problem could be that you are setting .idx_local to 0 outside of the loop 10 times loop. If you move the calculation to the start of the loop before the loop 512 times loop then hopefully that will work correctly.
Let me know how you get on.
The problem could be that you are setting .idx_local to 0 outside of the loop 10 times loop. If you move the calculation to the start of the loop before the loop 512 times loop then hopefully that will work correctly.
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: PICKIT WI-Fire PIC32MZ2048EFG100 SD-Card
Hi Ben
Yes perfect. 10 block's are nice on the disk.
There is a question more...
How Can I enable and read the timer1 before start writing and after writing, and write both to uart?
Yes perfect. 10 block's are nice on the disk.
There is a question more...
How Can I enable and read the timer1 before start writing and after writing, and write both to uart?
- 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: PICKIT WI-Fire PIC32MZ2048EFG100 SD-Card
The easy way is to use a count variable maybe of type UINT, set this to 0 before enabling the interrupt.How Can I enable and read the timer1 before start writing and after writing, and write both to uart?
Enable the interrupt with a fairly fast interrupt frequency just before you start writing to the file.
Inside the interrupt macro increment the count variable. count = count + 1
At the end of the file write loop disable the timer interrupt.
The count variable now contains the number of interrupts, which you can then convert to a time by multiplying by (1 / interrupt frequency).
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: PICKIT WI-Fire PIC32MZ2048EFG100 SD-Card
Hi Ben
Good idea. But the Irq on this chip is not working........
I tried also with the bootladerversion, but its the same. On another chip I used IRQ.
Do I something wrong here?
Good idea. But the Irq on this chip is not working........
I tried also with the bootladerversion, but its the same. On another chip I used IRQ.
Do I something wrong here?
- Attachments
-
- Flowcode1-chipkit-wi-fire-1.fcfx
- IRQ is not working...
- (22.45 KiB) Downloaded 350 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: PICKIT WI-Fire PIC32MZ2048EFG100 SD-Card
Hello,
I'm investigating this for you now. It seems the timer interrupt is firing after the correct amount of time but then locking up.
I'm investigating this for you now. It seems the timer interrupt is firing after the correct amount of time but then locking up.
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: PICKIT WI-Fire PIC32MZ2048EFG100 SD-Card
Right I've got further on this but so far not managed to fix the issue.
The timer interrupt is working fine and running as expected. However as soon as you add any code to the interrupt macro the interrupt causes the program to hang.
I have proven this by taking code out of the timer interrupt macro and adding it to the interrupt definition C code and there it is working.
I'm currently in discussions with Microchip to try and get this resolved.
The timer interrupt is working fine and running as expected. However as soon as you add any code to the interrupt macro the interrupt causes the program to hang.
I have proven this by taking code out of the timer interrupt macro and adding it to the interrupt definition C code and there it is working.
I'm currently in discussions with Microchip to try and get this resolved.
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: PICKIT WI-Fire PIC32MZ2048EFG100 SD-Card
Right this FCD seems to solve the problem. You will get a warning when compiling that the optimisation level is not supported and being removed however it does fix the freezing interrupt problem for me.
Strangely just switching off optimisation does not fix the problem.
I'm still investigating so hopefully we can find a better solution that allows optimisation to function.
Strangely just switching off optimisation does not fix the problem.
I'm still investigating so hopefully we can find a better solution that allows optimisation to function.
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: PICKIT WI-Fire PIC32MZ2048EFG100 SD-Card
Hi Ben
Thank You for the Bootloader.fcdx. Is it possible to have it for the PIC32MZ2048EFG100 chip also.
I like the Bootloader version, but I use the USB Pin's for sending controldate to the PC. So I did not jet change to the Bootloaderversion. What about the another USB port from the board. Is it soon possible to use?
Thank You for the Bootloader.fcdx. Is it possible to have it for the PIC32MZ2048EFG100 chip also.
I like the Bootloader version, but I use the USB Pin's for sending controldate to the PC. So I did not jet change to the Bootloaderversion. What about the another USB port from the board. Is it soon possible to use?
- 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: PICKIT WI-Fire PIC32MZ2048EFG100 SD-Card
Hi,
You can make the change for any PIC32MZ chip by doing the following.
Click Build -> Compiler Options
Ensure the PIC32 Default is selected
Ensure the Compiler Tab is selected
Find the part of the Parameters that says -O1
Change this to -Os
Click the save button top right of the window.
Give the new setting a name, e.g. PIC32MZINT
Click OK
Highlight the new option on the left menu and check the Default tickbox is ticked.
Click OK.
Hopefully now the interrupts won't crash the chip any more.
To go back simply go back into the compiler options, select default on the left and tick the default tickbox.
You can make the change for any PIC32MZ chip by doing the following.
Click Build -> Compiler Options
Ensure the PIC32 Default is selected
Ensure the Compiler Tab is selected
Find the part of the Parameters that says -O1
Change this to -Os
Click the save button top right of the window.
Give the new setting a name, e.g. PIC32MZINT
Click OK
Highlight the new option on the left menu and check the Default tickbox is ticked.
Click OK.
Hopefully now the interrupts won't crash the chip any more.
To go back simply go back into the compiler options, select default on the left and tick the default tickbox.
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: PICKIT WI-Fire PIC32MZ2048EFG100 SD-Card
Hi Ben
First I would like to mention that the chipkit WI-Fireboard is very nicely integrated into Flowcode. Thank you very much.
But I have a little problem with the IRQ ant the chipkit Wi-Fire
I tried to change from 01 to 0s but in the bootlaoder is alway this 01. I can not even click in the box with the mouse....
First I would like to mention that the chipkit WI-Fireboard is very nicely integrated into Flowcode. Thank you very much.
But I have a little problem with the IRQ ant the chipkit Wi-Fire
I tried to change from 01 to 0s but in the bootlaoder is alway this 01. I can not even click in the box with the mouse....
- 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: PICKIT WI-Fire PIC32MZ2048EFG100 SD-Card
Hello,
Some of the Flowcode FCD (Flowcode Chip Definition) files override the compiler options.
To edit these you need to edit the FCD file in a text editor. Please note that Windows will not let you edit the file in it's default location. You need to copy to somewhere you can edit the file and then copy back.
Some of the Flowcode FCD (Flowcode Chip Definition) files override the compiler options.
To edit these you need to edit the FCD file in a text editor. Please note that Windows will not let you edit the file in it's default location. You need to copy to somewhere you can edit the file and then copy back.
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: PICKIT WI-Fire PIC32MZ2048EFG100 SD-Card
Hi Ben
I changed and in the Box now I it's 0s.
something changed with the IRQ.
But I can put only one command in the IRQ-macro. If it's more than one the programm is not running anymore
I changed and in the Box now I it's 0s.
something changed with the IRQ.
But I can put only one command in the IRQ-macro. If it's more than one the programm is not running anymore
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
- Contact:
Re: PICKIT WI-Fire PIC32MZ2048EFG100 SD-Card
Hi Ben
I wrote a small program for the IRQ
It's working if I disable the part.
What can be the problem? In the attachment is the small program.
I wrote a small program for the IRQ
It's working if I disable the part.
What can be the problem? In the attachment is the small program.
- Attachments
-
- Flowcode7_bootloader_IRQ_test.fcfx
- (12.77 KiB) Downloaded 214 times
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
- Contact: