Hi Ben
Thats a very nice component this waveplayer,easy to understand and easy to use.
But still I did not make it.
I tested the hardware I can write to the disk with the component fat. I also have a Led in the Macro TimerInt, it flashes.
and the connection to the fat looks ok.
The chipcard is empty, even if I look at it with a disk editor
(link to a free disk editor)
https://mh-nexus.de/en/hxd/
https://www.matrixtsl.com/wiki/index.ph ... _(Storage)
FC8 wave player fat on pic32 not writing to disk
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:
- 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: FC8 wave player fat on pic32 not writing to disk
Hello and many thanks, glad you like the component.
Please can you attach your project file to the forums and I'll take a look through for you at what might be going wrong.
Please can you attach your project file to the forums and I'll take a look through for you at what might be going wrong.
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: FC8 wave player fat on pic32 not writing to disk
Hi Ben
Thanks Ben here the program a little smaller, so it is easier.
The 5second delay is just to prevent the program from starting during the pic flush
Thanks Ben here the program a little smaller, so it is easier.
The 5second delay is just to prevent the program from starting during the pic flush
- Attachments
-
- WP_20180816_13_32_25_Pro-4.jpg (123.16 KiB) Viewed 4027 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: FC8 wave player fat on pic32 not writing to disk
Hello,
It could be the size of the buffer combined with the length of the delay in the loop that is causing you problems.
You have a sample rate of 8K and a bit depth of 16-bit. In your loop you have a delay of 100ms in between processing the buffer.
8000 * 2 bytes * 0.1s = 1600 bytes that will accumulate during the 100ms delay but your WAV buffer is only 512 bytes.
Hopefully this should let you tweak things to allow you to get further and get the component working. Ideally you want plenty of RAM assigned to the WAV buffer so you can cope with any delays and any further delays imposed by accessing the FAT file system on the card inside the ProcessBuffer macro.
The ProcessBuffer macro does have a return variable so you can more easily see if a buffer overrun event has happened during recording or playback.
You also probably need to call the StopRecording function after the Timer interrupt disable icon if you want the file to end.
Let me know if your still having problems and I'll investigate further for you.
It could be the size of the buffer combined with the length of the delay in the loop that is causing you problems.
You have a sample rate of 8K and a bit depth of 16-bit. In your loop you have a delay of 100ms in between processing the buffer.
8000 * 2 bytes * 0.1s = 1600 bytes that will accumulate during the 100ms delay but your WAV buffer is only 512 bytes.
Hopefully this should let you tweak things to allow you to get further and get the component working. Ideally you want plenty of RAM assigned to the WAV buffer so you can cope with any delays and any further delays imposed by accessing the FAT file system on the card inside the ProcessBuffer macro.
The ProcessBuffer macro does have a return variable so you can more easily see if a buffer overrun event has happened during recording or playback.
You also probably need to call the StopRecording function after the Timer interrupt disable icon if you want the file to end.
Let me know if your still having problems and I'll investigate further for you.
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: FC8 wave player fat on pic32 not writing to disk
Hi Ben
I reduced the delay and made the buffer biger and put the stop recording.
still empty disk.... not even a file header...
I reduced the delay and made the buffer biger and put the stop recording.
still empty disk.... not even a file header...
- 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: FC8 wave player fat on pic32 not writing to disk
Ok thanks, I'll double check that nothing's gone wrong with the macro re-directs i.e. the bit that allows the WAV component to take control of the FAT component.
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: FC8 wave player fat on pic32 not writing to disk
Hello,
I've been back through the component and found out the re-directs were not working correctly. I have now fixed these and double checked they are generating the correct code.
I've pushed the changes to the update system now so hopefully these should solve the problems you're having.
I've been back through the component and found out the re-directs were not working correctly. I have now fixed these and double checked they are generating the correct code.
I've pushed the changes to the update system now so hopefully these should solve the problems you're having.
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: FC8 wave player fat on pic32 not writing to disk
Thank you Ben
I tried it and now data is written on the disk. But not as a wave file. I can not delete the data anymore. I have to format the card. But I think we are close to the solution.
I tried it and now data is written on the disk. But not as a wave file. I can not delete the data anymore. I have to format the card. But I think we are close to the solution.
- 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: FC8 wave player fat on pic32 not writing to disk
Hello,
Many thanks for getting back so quickly. I have had another go at the component and pushed the change to the update system, hopefully this should now fix the issue for you.
Let me know how you get on.
Many thanks for getting back so quickly. I have had another go at the component and pushed the change to the update system, hopefully this should now fix the issue for you.
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: FC8 wave player fat on pic32 not writing to disk
Hi Ben
Perfect. It's working now. Thank you for the help.
Stefan
Perfect. It's working now. Thank you for the help.
Stefan