Shop OBEX P1 Docs P2 Docs Learn Events
VMUSIC2 question — Parallax Forums

VMUSIC2 question

MarkRMarkR Posts: 6
edited 2008-02-29 18:45 in BASIC Stamp
Most of the VMUSIC2 interface schematics show the CTS line tied to ground (signalling the VMUSIC2 that the Stamp is always ready for characters), and RTS not connected (so no way for VMUSIC2 to tell Stamp that it is 'not ready').

I'm ok with the CTS, as the Stamp can be designed to be always ready for the next char, but what about the RTS line - does anybody know if the VMUSIC2 ever tries to signal 'not ready', and the Stamp should hold off on sending chars then?

I have seen one snippet of code where the author connects RTS and allows the VMUSIC2 to flow-control the Stamp transmitter.... but in my own experimentation I've yet to see the VMUSIC2 actually assert the RTS line to throttle the Stamp, so I hate to add the hardware connection, use up an input on the Stamp, and add flow-control code in the Stamp, if the VMUSIC2 never asserts RTS.

Anybody know?

-mark

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-02-29 14:59
    I'm sure the VMusic2 can signal that it's "not ready" using RTS. I'm not sure it's that useful. If the Stamp waits for responses to its commands, you should never need RTS to indicate that the VMusic2 is busy with one command while the Stamp is sending another. The only other case is when the Stamp is sending a block of data for a long write command that's longer than the VMusic2's buffer and the VMusic2 is busy writing the first part for some reason. The solution there is to limit the size of the blocks of data being written. The Stamp doesn't have enough data storage normally to do this very well, so that's not a problem either.
  • MarkRMarkR Posts: 6
    edited 2008-02-29 18:45
    Yes, agreed Mike.···

    I was thinking about this when considering concatenating multiple commands together and sending to VMUSIC2 without waiting, transactionally, for the responses:

    ChangeDir, Openfile, Writefile+data,

    and it occurred to me that perhaps the VMUSIC2 would not be able to buffer or keep up, and I hadn't connected the RTS line.

    Even without concatenating commands, there is a point in my program where I want to stream about·64 bytes to a file on the VMUSIC2, so still concerned about flow-control.·· I could take your suggestion and break it up into smaller writes with time between but a bit ugly if unnecessary.

    I really don't want to use the extra port on the processor to read RTS.... but quite concerned about loss of data and the loss of sync tween processor and VMUSIC2 if VMUSIC2 says 'stop' and I keep sending it data.... when it says 'start' again it will be waiting for more bytes and nothing is coming.... then the two are out of sync and ensuing commands will·be viewed as write-data still....

    I wrote FTDI tech-support with same question and got a somewhat braindead response from someone that was trying to be helpful but.... if I were them I'd just say, "assume the hardware flow control is necessary" as it's the safe answer.

    thanks for quick reply btw

    -mark

    ·
Sign In or Register to comment.