FC8 wave player fat on pic32 not writing to disk

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times
Contact:

FC8 wave player fat on pic32 not writing to disk

Post by stefan.erni »

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)
Wav-fat.PNG
(16.12 KiB) Downloaded 1775 times

User avatar
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

Post by Benj »

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.

stefan.erni
Valued Contributor
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

Post by stefan.erni »

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
Fc8_wave_test.fcfx
(114.3 KiB) Downloaded 210 times
Attachments
WP_20180816_13_32_25_Pro-4.jpg
WP_20180816_13_32_25_Pro-4.jpg (123.16 KiB) Viewed 4027 times

User avatar
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

Post by Benj »

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.

stefan.erni
Valued Contributor
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

Post by stefan.erni »

Hi Ben

I reduced the delay and made the buffer biger and put the stop recording.

still empty disk.... not even a file header...

User avatar
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

Post by Benj »

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.

User avatar
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

Post by Benj »

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.

stefan.erni
Valued Contributor
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

Post by stefan.erni »

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.
wave_test.PNG
(8.69 KiB) Downloaded 1705 times

User avatar
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

Post by Benj »

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.

stefan.erni
Valued Contributor
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

Post by stefan.erni »

Hi Ben

Perfect. It's working now. Thank you for the help.

Stefan

Post Reply