Serial flow control: how to realize with VoiceBox of sparkfun?

Hi all,

I stacked a voicebox shield on my Arduino. I wrote a small Delphi program to send the phonemes to the arduino which plays the phonemes. This all works great until the text gets too long. The VoiceBox has a buffer 64 bytes that easily overflows. I could make the Arduino tell my Delphi program to stop or simply store all phonemes in an internal buffer of the Arduino and send at requested moments to the VoiceBox with 32 bytes per time. Whatever option I choose I have to know when the buffer is full or ready to receive some more data.

From the VoiceBox user manual http://www.sparkfun.com/datasheets/Components/General/speakjet-usermanual.pdf I learned there are three pins associated with the buffer D0 (buffer half full), D1 (speaking) and D2 (ready). I guess that I should use the Data Out pins to check the status of the VoiceBox. Should I read out D0, when it is HIGH the buffer is half full, wait until the VoiceBox is ready (D2 HIGH) and continue? If that is correct (which I don't know), how can I access those pins? Can I use an interrupt routine to handle the D0 pin going HIGH?

I posted the question first in the audio forum, later on I realized that this question is more appropriate in this group. My apologies for the cross-posting.

Thanks for any help!

Rnold

You should have asked moderator to move the post instead of cross posting. I replied to your other post.

Can I use an interrupt routine to handle the D0 pin going HIGH?

Why is it important to know EXACTLY when the pin goes high? It'll take time to copy the next 32 bytes to the device, which you shouldn't take in an interrupt handler. And which you can't if you are using Serial to send it data, since that relies on interrupts, which are disabled in the ISR.

@riva, i will do that in future. I ll post my reply there.

@paulS , i doen t know whether it is important that the pin goes high. I just want to know how i can send data without overflowing the buffer.

i doen t know whether it is important that the pin goes high.

Sure you do. It's just not important to know the exact nano-second that the pin goes high. So, polling is good enough.

That's good to know, I didn't know that. Thanks for your suggestion!