Using arduino for fast clocking with peripherals

I am currently trying to generate a serial clock and data bus with the arduino. I have a max/msp program that communicates to the board and toggles the digital I/O as necessary. My issue is that I cannot seem to get fast enough switching speeds on the outputs. I am not sure if this is a problem with max/msp software, arduino software, or arduino hardware.

In general, how fast can the digital outputs be toggled if the mode of operation is through a peripheral driver? Am I just encountering the slow speed of reprogramming the outputs or can the arduino only switch this fast? Currently I am seeing toggles down to 14ms but I need to get even faster than this.

Any ideas or comments would be most appreciated. Thanks.

The arduino itself can toggle outputs at several megahertz if you really work hard at it, 50 kilohertz is easy from the high level code. If you are toggling from your computer then it must get through the drivers there, go over usb, get converted to rs232, do the io and then make the return trip. I don't know what baud rate you have going on the serial, but at 9600 baud each character will take about 1ms right there so 14ms doesn't seem too unreasonable.

Try to put as much of the timing and data moving logic inside the arduino as you can and send as high a level command as possible from the computer.